AllskyTeam / allsky

A Raspberry Pi operated Wireless Allsky Camera
MIT License
1.15k stars 180 forks source link

RPI 4 does not restart after config changes #106

Closed kpjamro closed 5 years ago

kpjamro commented 5 years ago

restarting the allsky service usually results in this message

Jul 30 20:14:48 allsky systemd[1]: Started All Sky Camera. Jul 30 20:14:48 allsky allsky.sh[624]: can't get debug descriptor: Resource temporarily unavailable

But a restart following a change to the camera config (this restart is done when you select save changes) results in this:

Jul 30 20:29:14 allsky systemd[1]: Started All Sky Camera. Jul 30 20:29:14 allsky allsky.sh[1199]: can't get debug descriptor: Resource temporarily unavailable Jul 30 20:29:19 allsky allsky.sh[1199]: cannot read device status, Resource temporarily unavailable (11)

I believe the "device" refers to reading the USB port (USB3 in this case). This results in a subsequent 'camera not found' error and the program stopping. It seems a reboot is needed to get things going again.

It may be the RPI 4 is just too fast and some delay is needed, or there is something about the USB-C port that is not handled by the ASI library.

I found a program snippet that resets the port: https://raspberrypi.stackexchange.com/questions/9264/how-do-i-reset-a-usb-device-using-a-script

If I run usbreset I can start the program without having to re-boot. I am thinking of putting this into the script. But perhaps a time delay or a simple retry in just the right place is what is really needed?

kpjamro commented 5 years ago

OK - an update: I got a new RPI 4 (this one with 4 GB) and did a new install last night, with the latest O/S updates and, on this one, the daytime save/restart works OK. Go figure.