STJRush / rpi

Lessons on getting your Raspberry Pi to do cool stuff
9 stars 3 forks source link

Minor issue with rpi/Startup_IP_Mailer/How to set this up.txt #8

Closed John-Mc closed 6 years ago

John-Mc commented 7 years ago

The startup emailer was just not working on my Raspberry Pi 3 running OctoPi (3D printer control software).

I found two reasons:

(1) OctoPi is installed on Raspian-Jessie-Lite, a stripped down version of the sofware. This OS lacks some of the files needed to do your "UPDATED METHOD FOR PIXEL NEW PI: 12 03 17" method of running at startup.

(2) So I had to go with the older "rc.local" method. I followed those instructions, but my R-Pi3 would not find and log onto the network. It turns out that the Pi was trying to send out the email before the Pi had finished logging on the the network. I fixed this by inserting sleep 15 into rc.local just before the sudo python /home/pi/startup_maily.py & command. It's been working without a problem since that change.

I'm sure there are more elegant solutions to adding sleep15 in item #2 above, but it got me up and running.

Thanks again for making this available! It has certainly simplified using the 3D printer attached to a Raspberry Pi3 in the classroom where I volunteer.

dobrienSTJ commented 7 years ago

Very intresting.....

John-Mc commented 7 years ago

Not sure why the 2 Pis I've used it on both require the delay, but in an earlier conversation, DMurray said none of the ones he runs need it. Would selecting "wait for network on startup" in raspi-config have an effect? I'm just set at whatever the default is (which I THINK is "don't wait").

It could be that something in the OctoPi setup causes a delay in connecting to the WiFi network? (OctoPi installations are the only place I've tried it so far. One was on an old Pi model B+ the other was on a Pi 3.)

I have not done much experimenting with the amount of delay. Sleep 15 works reliably. Cutting that to sleep 10 caused a failure to connect (though I only tried it once), so I went back to 15.

John-Mc commented 6 years ago

The script has been updated to include a "sleep 15" delay. This has resolved the issue for me.

I still suspect there is a more elegant way to deal with this than a fixed delay, but this does work.

Closing this issue.