bk1285 / rpi_wordclock

Software to create a Raspberry Pi based wordclock
GNU General Public License v3.0
214 stars 107 forks source link

Time no longer updating #245

Closed R0lleston closed 1 year ago

R0lleston commented 1 year ago

Silly me decided to update the buster os on my pi this morning, but now the clock will not update the time.

initially running the word clock.py loads the clock, sets the correct time etc, But after this the time no longer refreshes.

Before the buster package update it was working perfectly

any ideas.

oxivanisher commented 1 year ago

I just noticed the same and did a little digging. For me, it seems that:

I was able to get it up and running, by running the following command as root: git config --global --add safe.directory /home/pi/rpi_wordclock

This will add the folder where the wordclock application is installed to the git config and mark it as secure. This ends up in /root/.gitconfig with

[safe]
        directory = /home/pi/rpi_wordclock

This will probably impact every user which installs on a new OS or does package upgrades. I can not say what the best solution is, but some that come into my mind are:

These are my quick findings and ideas. I hope the command above helps to solve it for other people until a definitive fix is found.

R0lleston commented 1 year ago

For us non technical sorts, why would this occur with a working system (not a clean os install) ? Is it the way the word clock has been written or the external programs that interface with it ?

oxivanisher commented 1 year ago

If my analysis is correct, it is because a newer version of git was installed and this version is now more picky concerning file permissions. But this was on my system after I updated the packages, so it makes sense on my systesm. Did my solution fix it for you?

FrankX0 commented 1 year ago

@R0lleston can you supply what is being printed in the terminal?

R0lleston commented 1 year ago

@FrankX0 i think I might have powered down the pi a few too many times without a proper shutdown, I think I’ll need to do a full reinstall of the OS. I’ll let you know when I’ve done that

R0lleston commented 1 year ago

@FrankX0 have reinstalled buster and loaded the word clock. Can confirm it work’s initially, but soon drops off, no longer updates time and essentially freezes up.

The connection to the app fails, and it longer updates logs when viewed from putty. The pi is still accessible via putty however

you can restart by the sudo python3 word clock.py commmand

R0lleston commented 1 year ago

@oxivanisher tried your fix (not as root, but as user pi) worked for a bit but ultimately looked up again

oxivanisher commented 1 year ago

@R0lleston if you have the same problem as me, you have to do the "fix" (more workaround) as root or it will not help.

R0lleston commented 1 year ago

@oxivanisher ok, I’ll work out how to do that and give it a crack

oxivanisher commented 1 year ago

@R0lleston I can help you with that. Connect to the wordclock and run sudo -i. After that, you should be working as root. You can exit the root shell again by running exit.

FrankX0 commented 1 year ago

@R0lleston I expect the clock application somewhere stops due to an error. Can you supply what is being printed to the terminal?

R0lleston commented 1 year ago

1309B3C8-6776-46F6-90CA-CCB0B19B9663

R0lleston commented 1 year ago

@FrankX0 see previous post. As mentioned previously the clock was working fine prior to an update of the Buster OS

FrankX0 commented 1 year ago

This looks fine. There is no information after "Running plugin time_default"? Also not after a few minutes?

R0lleston commented 1 year ago

Can’t tell the exact time it dies, but it didn’t change any of the data after 3 or 4 mins. Interestingly enough it seems to keep going (more than 5 mins) if the app to change settings is open @FrankX0

R0lleston commented 1 year ago

Ok confirmed that if I have a connection to the clock via its app it operates fine. I tested it for 1.5hrs with the app open on a chrome tab on my phone, time was constantly correct. Take away that connection and after about 5 mins the clock stops updating and the SSH drops out

FrankX0 commented 1 year ago

It seems to me the raspberry pi loses its WiFi connection. Can you try the following from a terminal: sudo iw dev wlan0 set power_save off

R0lleston commented 1 year ago

@FrankX0 did the above and can confirm the issue remains

FrankX0 commented 1 year ago

I don't see why this issue would be related to the word clock application. Can you test the network connection without running the word clock application? Can you try Bullseye instead?

R0lleston commented 1 year ago

@FrankX0 @oxivanisher looks like I might have found the issue. Seems that the problem occurs when an ssh connection or the app is no longer connected to the pi. A little googling indicates that python programs stop working after ssh disconnects (buggered if I can work out why this has suddenly become an issue with workclock). If you install SCREEN and then run screen python3 rpi_wordclock.py it works as it used to. Screen appears to keep programs running in the background.

FrankX0 commented 1 year ago

This is expected behaviour and not typical for the wordclock. You might want to start the clock automatically after power on:

bk1285 commented 1 year ago

Thanks for looking into this, @FrankX0 @oxivanisher.

@R0lleston, I close this for now.

Best, Bernd

HeerNMeester commented 1 year ago

I had the same problem after a fresh installation. I had to start the clock myself because the cronjob did not work following the ReadtheDocs 'installation' manual. After @oxivanisher trick, the clock runs without any issues.