tag:blogger.com,1999:blog-3895896102723512919.post3116996303704036554..comments2022-03-24T18:16:37.162+01:00Comments on A Raspberry Pi dashcam with two cameras and a GPS: Wiring a button, some LEDs and a GPSThat's trickyhttp://www.blogger.com/profile/11701523282236812970noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-3895896102723512919.post-37224496547688359412019-09-23T15:40:38.854+02:002019-09-23T15:40:38.854+02:00Hi guys,
Anybody look at this lately? Thinking o...Hi guys,<br /><br />Anybody look at this lately? Thinking of a dashcam system and wondering what route to go.Naenychttps://www.blogger.com/profile/06906718124277508461noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-27910129388354670322017-06-23T03:17:36.643+02:002017-06-23T03:17:36.643+02:00Anyone tried the image on a Raspberry Pi Zero? I d...Anyone tried the image on a Raspberry Pi Zero? I don't have a spare one to test it out.Anonymoushttps://www.blogger.com/profile/14090745893556459601noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-14064805768520113932016-06-14T01:48:51.697+02:002016-06-14T01:48:51.697+02:00Loaded the binaries you provided and it worked gre...Loaded the binaries you provided and it worked great. Thanks again.Anonymoushttps://www.blogger.com/profile/10167903797449404200noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-33774181290225880742016-06-07T22:15:19.866+02:002016-06-07T22:15:19.866+02:00It would seem the current binaries do not work wit...It would seem the current binaries do not work with the Pi 1. If you try running them separately they probably fail. I have recompiled flash, pwr_butt & gps_logger for the Pi 1. Please download them from here: https://drive.google.com/open?id=0B3C9fv6-yJclZlNYVUhlZEQ4OWs and replace the old versions with them. Let me know how you get on.That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-5030051856133851162016-06-04T22:00:35.215+02:002016-06-04T22:00:35.215+02:00Hi There,
I'm glad you like the guide, not th...Hi There,<br /><br />I'm glad you like the guide, not the most exciting read to be honest but hopefully it provides some good information. I have heard of this issue before on the Pi 1. With the original guide I made (for my Pi 1) I used different GPIO pins than what are used now and I think the newer pin choice does not work well with the Pi 1. I will do some testing when I can and get back to you.<br /><br />Thank you for the link btw, it has some very nice information and tips.<br /><br />Regards,<br />Alan.That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-50346090194950154452016-06-02T06:43:10.439+02:002016-06-02T06:43:10.439+02:00Hello,
Wonderful guide you have made! I have bee...Hello,<br /><br />Wonderful guide you have made! I have been working on this for a couple of nights and I am really happy with this. A couple of problems I have run into is in using the pwr_butt program. Seems like my PI (Original v1) has GPIO4 mode set to IN. If I manually set the mode to OUT the LED that I have wired for the Status comes on without issue. Is there a way around this. I also cannot get the momentary switch that I wired up to reboot or shutdown the RPi. I made a test python script for testing the button presses and when I press the button I do get output from the python script, so I know the button is working and wired to the correct pin on the PI. Is there something I am missing. I believe that all my parameters in the global.rc file are correct. I am currently not using a gps if that helps.<br /><br />The following is the URL to the guide I used to write the python script to test the button presses. (http://razzpisampler.oreilly.com/ch07.html)Anonymoushttps://www.blogger.com/profile/10167903797449404200noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-70972220197022017812015-12-16T20:29:53.988+01:002015-12-16T20:29:53.988+01:00Absolutely. I have the Pi camera positioned at the...Absolutely. I have the Pi camera positioned at the top of the driver's side windscreen and the GPS unit over the front passenger side with the Pi itself in the middle. You can get very long ribbon cables to feed the Pi camera and easily extend the GPIO wires for the GPS. I am not sure if either of these have limitations on length so best check for your own piece of mind. Some people have used a bluetooth GPS with good results to avoid having a wired GPS. Things like power, USB cabling etc are easy to sort out.<br /><br />I did test recording audio via my USB webcam which is located on the rear headrest and it works well but it is recorded to a separate file and so was not very useful for me. I usually leave it disabled.That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-45939202344133158762015-12-16T16:40:53.378+01:002015-12-16T16:40:53.378+01:00I would like to install the camera on one side of ...I would like to install the camera on one side of the dash and the GPS receiver on the other side - with all other electronics several feet away, probably in the console between the seats. I haven't yet decided to do audio recording. Would this be possible with the components you have used?treshohttps://www.blogger.com/profile/02272402503219630060noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-21508826878787609172015-09-25T19:37:52.351+02:002015-09-25T19:37:52.351+02:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/00178545276838845479noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-25883543583377144062015-09-16T20:08:12.530+02:002015-09-16T20:08:12.530+02:00Thanks Atharva, I had fun making it. I hope all go...Thanks Atharva, I had fun making it. I hope all goes well with you.That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-46718791047806901202015-09-16T02:51:12.841+02:002015-09-16T02:51:12.841+02:00Really interesting project. Gathering all the piec...Really interesting project. Gathering all the pieces for the dashcam Atharva Danihttps://www.blogger.com/profile/15125809710317138603noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-15491748469388265962015-08-26T03:10:57.485+02:002015-08-26T03:10:57.485+02:00Thank you. Gathering pieces and 32 gig SD cards. ...Thank you. Gathering pieces and 32 gig SD cards. folded outputhttps://www.blogger.com/profile/08519698941803415994noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-14549576336442801112015-08-17T22:58:47.121+02:002015-08-17T22:58:47.121+02:00Hi, sounds like a good project. You can download t...Hi, sounds like a good project. You can download the source code if you follow the link in the 'Scripts' section of the blog (unfortunately they do not have comments). The dashcam.sh program includes a subroutine to delete the oldest video files when a threshold is reached. You can modify the Pi camera video file names by editing picam.py (or pivid.sh). I used picamera for the text overlay in the picam.py script, you'll need to install python3 for it to work. Let me know if I can help further. All the best, Alan.That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-14674371316981449872015-08-15T19:40:24.655+02:002015-08-15T19:40:24.655+02:00Haven't coded in 30 years, but just bought a r...Haven't coded in 30 years, but just bought a rpi and find this project interesting. Is your source code available anywhere, to help a newbie with details like the gps time date speed overlay? I'd like to try a simple project with GPS lat/lon alt speed time date overlayed with just the single RPI camera module, and a looping video rewrite on a 32 g SD (or larger), maybe with a small LCD to display status and current statistics. The thought on the looping write is to write 2 gig files with filename sequential based on date time, such as 20150815133000, when 2.5 gig space remains, the oldest file is deleted to make room for the next file to be written, perpetually. If a 64g is used, nothing needs to change, as the code would still periodically check when free space is 2.5g or less, and then delete the oldest 2gig video file.folded outputhttps://www.blogger.com/profile/08519698941803415994noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-8834233428247278092015-03-27T22:10:34.726+01:002015-03-27T22:10:34.726+01:00Hi Jay,
Thanks for the advice and glad you like t...Hi Jay,<br /><br />Thanks for the advice and glad you like the project. It's been pretty interesting and always good to hear if people find it useful too.<br /><br />Cheers,<br />Alan.That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-45294549596835846902015-03-26T03:12:44.422+01:002015-03-26T03:12:44.422+01:00Hey, if you're going to compile it yourself, d...Hey, if you're going to compile it yourself, don't forget that you will need to include the "-I/usr/local/include -L/usr/local/lib -lwiringPi" at the end so the full command should look like this:<br /><br />gcc -o pwr_butt pwr_butt.c -I/usr/local/include -L/usr/local/lib -lwiringPi<br /><br />Awesome, awesome project and instructions! Thank you very much for taking the time to journal it all down.<br /><br />Regards,<br />JayJudo Jayhttps://www.blogger.com/profile/14231531572715663142noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-38485443766705469822015-01-21T14:47:48.713+01:002015-01-21T14:47:48.713+01:00Hi there, the main C program started out as small ...Hi there, the main C program started out as small test for the GPS connection but then turned into a sprawling mess that controls everything. So often the way. To be honest it could really do with a rewrite. I also really like using C but I have not received recompense for any programs I have written. They are really for my own curiosity on how to do something or make life easier.<br /><br />But thanks, I'm really happy with how the dash cam turned out and the recording quality is pretty good for the cost.<br /><br />Arch is still lightweight and quick but I did try a recent Raspbian build and was quite impressed. My personal preference is still Arch but I guess it's really about how comfortable you are with the command line. Sadly Arch has disappeared from the Pi download page which is a shame.<br />All the best. A/That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-14375578648028297592015-01-16T12:28:03.043+01:002015-01-16T12:28:03.043+01:00Your "C" code has me jonesing,[withdrawa...Your "C" code has me jonesing,[withdrawal symptoms], as I've not written a line in a long time! <br /><br />I know about 20+ languages, but straight C was easily my favorite, and by FAR! I fell in love with its pointer notation and it's tightness on memory when deal with 3 and 4 dimensional arrays! I'd probably do it for free even though they used to pay me ~$80 / hour in the 'good ole days'! LOL! <br /><br />Can you imagine making 15-25 THOUSAND dollars a month to do what you LOVE? (Then they torched the balloon with cheap Indian and Chinese programmers, along with our entire economy, but that's another story!)<br /><br />Anyway, thanks for the stuff on the Pi a very cool little box, indeed!<br /><br />Back to YOUR business: Is arch linux still far and away better or has rasbian, the debian version, finally caught up?<br /><br />ie: Would you still choose arch? Perhaps they have some cool talent the others don't have?<br />Thanks for any input!<br />Regards from cali,<br />TSwordofCreationhttps://www.blogger.com/profile/05536192932314332975noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-38235158807525943932014-03-24T14:26:26.019+01:002014-03-24T14:26:26.019+01:00Thanks Alan,
Regards
Leon SmitThanks Alan,<br /><br />Regards<br />Leon SmitAnonymoushttps://www.blogger.com/profile/16398882194520489541noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-64249285822224725822014-03-20T22:44:35.690+01:002014-03-20T22:44:35.690+01:00Hey Leon,
Below is the old basic C code for the p...Hey Leon,<br /><br />Below is the old basic C code for the pwr_butt program, I haven't tested it recently but it should work. It's very easy using the wiringPi libraries for GPIO control. If you do compile it don't forget to add the library: gcc pwr_butt.c -lwiringPi<br /><br />(replace the quotes with < and > on the includes)<br />// pwr_butt.c<br />#include "stdio.h"<br />#include "stdlib.h"<br />#include "unistd.h"<br />#include "signal.h"<br />#include "wiringPi.h"<br />#include "sys/types.h"<br />#include "sys/reboot.h"<br />#include "linux/reboot.h"<br /><br />// Defaults<br />int button_gpio = 2;<br /><br />void setup (void)<br />{<br />if (geteuid () != 0)<br />{<br />fprintf (stderr, "Need to be root to run.\n");<br />exit (0);<br />}<br />if (wiringPiSetup () == -1) exit (1);<br /><br />pinMode (button_gpio, INPUT) ;<br />pullUpDnControl (button_gpio, PUD_UP) ;<br />printf("[pwr_butt]: Started.\n");<br />}<br /><br />void waitButton (void)<br />{<br />int count;<br /><br />printf("[pwr_butt]: Button GPIO %d is active.\n", button_gpio);<br /><br />// Loop with small millisecond delay until button state changes<br />while (digitalRead (button_gpio) == HIGH) delay (100);<br /><br />printf("[pwr_butt]: Button GPIO %d has been pressed.\n", button_gpio);<br /><br />// Another small loop. If the button is released then halt else reboot<br />for(count=0;count<=4;++count) {<br />if(digitalRead (button_gpio) == HIGH) {<br />printf("[pwr_butt]: Halt.\n");<br />reboot(RB_POWER_OFF);<br />// reboot(RB_HALT_SYSTEM); / reboot(LINUX_REBOOT_CMD_HALT); / reboot(LINUX_REBOOT_CMD_POWER_OFF);<br />exit(0);<br />}<br />delay(500);<br />}<br />printf("[pwr_butt]: Reboot.\n");<br />reboot(RB_AUTOBOOT);<br />// reboot(LINUX_REBOOT_CMD_RESTART);<br />exit(0);<br />}<br /><br />int main (void)<br />{<br />setup ();<br />for (;;) waitButton();<br />}That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-28852019634498035812014-03-20T08:35:55.106+01:002014-03-20T08:35:55.106+01:00Hi Alan,
I am just interested in how the power bu...Hi Alan,<br /><br />I am just interested in how the power button program is working in C because all the power button examples I've seen so far is done in python.<br />I'm waiting for my pi camera and then I'm going to use your guide and start playing.<br /><br />Thanks again,<br />RegardsAnonymoushttps://www.blogger.com/profile/16398882194520489541noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-65493243921678688602014-03-19T23:10:38.684+01:002014-03-19T23:10:38.684+01:00Hi Leon,
Glad you liked the guide. The pwr_butt p...Hi Leon,<br /><br />Glad you liked the guide. The pwr_butt program was written in C so I could use milliseconds as the delay time in-between checking the button state and so you will not be able to view or edit it. Most of the settings it uses can be changed in the global.rc file though. Are you looking for something specific or just interested in how it works?<br /><br />Regards,<br />Alan.That's trickyhttps://www.blogger.com/profile/11701523282236812970noreply@blogger.comtag:blogger.com,1999:blog-3895896102723512919.post-79503108508702276552014-03-19T21:09:14.869+01:002014-03-19T21:09:14.869+01:00Hi,
Thanks for this tutorial!!
I cannot open the p...Hi,<br />Thanks for this tutorial!!<br />I cannot open the pwr_butt file in nano. It displays gibberish and nano gives this message:[read 75 lines (Converted from MAC format)] and vi give this message [Incomplete last line][Converted]Anonymoushttps://www.blogger.com/profile/16398882194520489541noreply@blogger.com