Go to advanced search

by pixelpop
Thu Dec 26, 2019 6:59 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

Your original code worked fine for me. Here is what I ended up with: #!/bin/bash for ((i=0; i<20; i++));do sleep 15 [ -f /media/wpa_supplicant.conf ] && { cp /media/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf break echo "Process completed" } done This runs the for loop 20 times befor...
by pixelpop
Thu Dec 26, 2019 12:58 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

Thanks, but I have rapidly transitioned into the "if-it-ain't-broke-don't-fix-it" zone. But I am definitely bookmarking this thread and I'm sure I'll need help again with something. So don't go anywhere! 😉
by pixelpop
Wed Dec 25, 2019 4:57 pm
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

That worked perfectly! I didn't realize how similar bash is to C. Thanks so much to everyone that contributed to this. You guys are a terrific community!
by pixelpop
Wed Dec 25, 2019 10:23 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

According to ShellCheck, I need to learn more about variable declarations and assignments. :-) I have some work to on this because I also need to add an accumulator that tracks how many times it goes thru the loop and exits after a certain number (probably 20 because that would be 5 minutes at 15s)....
by pixelpop
Wed Dec 25, 2019 9:02 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

I really appreciate the time you guys are giving me on this. Patching some things together, would this work? #!/bin/bash DIR="/media/pi/WIFI_CONFIG" until $USB_Ready = "ready" do sleep 15; done if [ -d "$DIR" ]; then USB_Ready=ready fi done cp /media/pi/WIFI_CONFIG/config-test.txt /home/pi/config-te...
by pixelpop
Wed Dec 25, 2019 7:22 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

Using a sleep 5m did work and I can live with it, but it seems kind of kludgy. Is there a way to detect when boot is complete? I've researched it and everything I've seen looks pretty kludgy too. I did see this but not sure what that's all about: On a debian system, you can specify the order somethi...
by pixelpop
Wed Dec 25, 2019 6:57 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

Well, at least it didn't crash...but it didn't work either. Both the .log and .err files are empty, so I assume the script is running correctly. Which probably means the USB device has not been mounted yet when the script is run. I think my options are preceding the USB check in the script with a 'm...
by pixelpop
Wed Dec 25, 2019 6:12 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

Fantastic!! Thank you and Merry Christmas to all!! 🎄🎁
by pixelpop
Wed Dec 25, 2019 4:37 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

OK, I have the script running when manually tested and I'm ready (I think) to put it into the crontab. Here is what I have so far: #!/bin/bash if [[ -d /media/pi/WIFI_CONFIG ]]; then cp /media/pi/WIFI_CONFIG/config-test.txt /home/pi/config-test.txt fi then: $ sudo crontab -e ------------------------...
by pixelpop
Mon Dec 23, 2019 11:24 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

Maybe you can use something like this script: #!/bin/bash if [[ -d /media/pi/target ]]; then cp /some/where/some/file /media/pi/target fi Where target is the volume label of the USB thumb stick and it mounts in /media/pi In combination with @reboot in crontab. Have a look at bash commands here: htt...
by pixelpop
Mon Dec 23, 2019 12:16 am
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

Re: USB Find and File Copy on Boot

The USB device will already be inserted in the Pi when it is turned on, so mounting does not seem to be a problem. But that could change if the Cron (or .sh or whatever it turns out to be) runs at the start of boot-up. But the more I read about how it might be done, the more lost I get.
by pixelpop
Sun Dec 22, 2019 8:14 pm
Forum: General discussion
Topic: USB Find and File Copy on Boot
Replies: 27
Views: 980

USB Find and File Copy on Boot

I am a very noobish Linux guy, so please bear with me. I have a situation where I need to check for the presence of a specific USB device (by volume label) and, if found, copy a specific file from the USB device to a specific location on the SD card. And it needs to do this as part of the boot seque...
by pixelpop
Mon Nov 18, 2019 7:54 am
Forum: General discussion
Topic: Data Persistence Between Flashes
Replies: 10
Views: 754

Re: Data Persistence Between Flashes

LOL...I've had the multi-terminal "doh" moment way too many times.
homer-computer-doh.jpg
homer-computer-doh.jpg (10.91 KiB) Viewed 567 times
by pixelpop
Mon Nov 18, 2019 1:13 am
Forum: General discussion
Topic: Data Persistence Between Flashes
Replies: 10
Views: 754

Re: Data Persistence Between Flashes

Well, I forgot about one other constant that was involved in these issues besides Windows...the operator! :shock: To make a long story short and to limit my humiliation, I had checked my router for connected devices and forgot about my media server being on a Pi. So the whole time I was trying to ch...
by pixelpop
Sun Nov 17, 2019 10:13 pm
Forum: General discussion
Topic: Data Persistence Between Flashes
Replies: 10
Views: 754

Re: Data Persistence Between Flashes

This has happened with different cards, different Pi's and different img files. Beats the heck out of me what's going on. I'm still overwriting this current card (man, it takes forever!) and I'll report back what the results are. At this point I'm wondering if it's something with Windows 10, the onl...
by pixelpop
Sun Nov 17, 2019 9:46 pm
Forum: General discussion
Topic: Data Persistence Between Flashes
Replies: 10
Views: 754

Re: Data Persistence Between Flashes

Yeah, it has me stumped too. I know the original img file is being written because any changes I made previously to config.txt have to be made again after reflashing. I always use SD Card Formatter to format the card before reflashing, but this time I am going to use the overwrite option to see what...
by pixelpop
Sun Nov 17, 2019 9:29 pm
Forum: General discussion
Topic: Data Persistence Between Flashes
Replies: 10
Views: 754

Re: Data Persistence Between Flashes

Nope. I wrote a text file to the /home/pi directory and unplugged the Pi. The booted it back up. The file is still there. BTW, I have also seen this on other Pi's that I have. For instance, I'll change the log-in from pi/raspberry to pi/somethingelse. At some point I need to re-flash the original im...
by pixelpop
Sun Nov 17, 2019 9:02 pm
Forum: General discussion
Topic: Data Persistence Between Flashes
Replies: 10
Views: 754

Data Persistence Between Flashes

I'm not even sure if my topic is clear, but I am totally confused. This has happened more than once and today I figure it's time to ask for help. So I needed to install OctoPi from scratch, new img file, format the SD card, write the image using Etcher and boot using the freshly written image. But I...
by pixelpop
Sun Nov 17, 2019 10:31 am
Forum: General discussion
Topic: LCD GPIO Interface
Replies: 12
Views: 983

Re: LCD GPIO Interface

That $34.99 price is probably about right. I just grabbed the full setup on eBay for $37.39. That hat, cable and cable I/F board can't cost more than a couple of dollars. I'd still be curious (and will try to drill down) about who the first-level manufacturer is. If Waveshare is selling the screen f...
by pixelpop
Sat Nov 16, 2019 10:06 am
Forum: General discussion
Topic: LCD GPIO Interface
Replies: 12
Views: 983

Re: LCD GPIO Interface

I got a 7" LCD from Wavefront ... Maybe you mean Waveshare? Yes, sorry...I did mean Waveshare. The screen in your pic is the one I have. But I am caught between two scenarios. My design is dependent upon using the RGB LCD HAT interface, but I can find a lot of these screens for less than Waveshare ...
by pixelpop
Fri Nov 15, 2019 10:56 pm
Forum: General discussion
Topic: LCD GPIO Interface
Replies: 12
Views: 983

Re: LCD GPIO Interface

mikronauts wrote:
Fri Nov 15, 2019 10:48 pm
dpi24 is the driver

hdmi_cvt is similar to an x configuration mode line

basically you need electrically matching lcd's that can be configured via the dtoverlay dpi24 dpi_* and hdmi_cvt variables.
Thanks! I learned something today about the Pi. Now I know what to keep my eyes out for! 👀
by pixelpop
Fri Nov 15, 2019 6:06 pm
Forum: General discussion
Topic: LCD GPIO Interface
Replies: 12
Views: 983

Re: LCD GPIO Interface

When you say "driver" I guess I'm thinking of drivers in the traditional sense. And the RGB LCD HAT scenario doesn't have a "driver," per se. The instructions indicate modding the config.txt file to add: dtoverlay=dpi24 enable_dpi_lcd=1 display_default_lcd=1 dpi_group=2 dpi_mode=87 dpi_output_format...
by pixelpop
Fri Nov 15, 2019 5:46 pm
Forum: General discussion
Topic: LCD GPIO Interface
Replies: 12
Views: 983

Re: LCD GPIO Interface

Thanks for the good info. Looks like I have some work to do. :cry:

Just FYI, I have attached the schematic for the RGB LCD HAT, but I think your suggestion is probably the best one--settle on a display and then find an adapter based on the display model number.
by pixelpop
Fri Nov 15, 2019 4:39 pm
Forum: General discussion
Topic: LCD GPIO Interface
Replies: 12
Views: 983

Re: LCD GPIO Interface

The Gert doesn't really look much like the RGB LCD HAT image that I posted. My HAT uses a 40-pin GPIO ribbon cable for connecting to the LCD, not a VGA connector. About the only thing the Gert and the HAT have in common is the GPIO connector. I've attached another picture showing the opposite side (...
by pixelpop
Fri Nov 15, 2019 8:42 am
Forum: General discussion
Topic: LCD GPIO Interface
Replies: 12
Views: 983

LCD GPIO Interface

I got a 7" LCD from Wavefront that comes with an small junction board, an FPC cable and a "RGB LCD HAT" card (pic attached). I know the 50-pin cable is something called a "reverse" or "flipped" FPC cable (meaning that the ends of the cable are flipped...not blue/blue-bare/bare but blue/bare-bare-blu...

Go to advanced search