Post by Powderjockey on Dec 23, 2019 15:34:26 GMT -8
Thanks, it might be while. I have a fear that one or more of the boards may be fried due the recent 2" of snow and then 2 days of nothing but rain. Tried to re-power it but I did not hear the couple of light clicks after the re-boot. Nothing, and I can not get to it using either ssh or vnc. Christmas is upon us and I'll try to get at it over the next few days.
Actually, you need to understand how systemd works with rc.local. In fact, if an error occurs in the script (here rc.local), it will exit and not continue.
That is the curse of rc.local and no builtin error handler! In your case, you made a "cd /" then a "cd SDL_Pi_SkyWeather". problem here is that the "SDL_Pi_SkyWeather" didn't exist under "/" thus the "cd" program returned an error-code different from 0 (0 = good, anyting higher is bad).
You would have probably spotted it using: sudo systemctl status rc-local
It would have shown you what failed.
What we can do, is add error-handler code to rc.local. It would look like this.
cd ~ errlvl=$? if [ $errlvl -gt 0 ] then echo "Unable to change to directory ~. Emergency exit!" exit 1 fi
cd SDL_Pi_SkyWeather errlvl=$? if [ $errlvl -gt 0 ] then echo "Unable to change to directory SDL_Pi_SkyWeather. Emergency exit!" exit 1 fi
sudo pigpiod errlvl=$? if [ $errlvl -gt 0 ] then echo "pigpiod did not start correctly. Emergency exit!" exit 1 fi
sudo python SkyWeather.py if [ $errlvl -gt 0 ] then echo "SkyWeather.py did not start correctly. Emergency exit!" exit 1 fi
With that code, the script would exit at each and every step the rc.local would exit too when started through systemd.
I'm experiencing a similar issue; every 3 days or so, the weather station quits broadcasting data to both WeatherStem and Blink, and I'm not able to connect via VNC. So I'm regularly unplugging it and plugging it back in.
I noticed that if the network is not working correctly, the python script behaves strangely (That is, before lightning struck it and disabled it. Still wa not able to get it down the roof). What you cna do is run a cron job that will restart the SkySoft once a night, or reboot the box once a night. But that will cause quite some SD-Card wearing !
SD Cards are a lot better than they used to be. Rebooting once a night wil still last a really long time. Project Curacao3 SkyWeather has been rebooting a couple times a day due to a solar power supply problem for 6 months. Still working like a champ.
Why is it doing that? I think there is a loose wire in the SolarMAX Lead Acid system that moves once in a while. I'd go down and fix it, but all Americans are banned from Curacao right now because of the virus. So I just watch the Caribbean.