mrworf / photoframe

Software to pull random photos from Google Photos and show them, like a photo frame
GNU General Public License v3.0
221 stars 38 forks source link

Black screen every few weeks with Authorization required #201

Open key5000 opened 2 years ago

key5000 commented 2 years ago

Hi MrWorf and everyone, I had my frame up and running for about a year now, every now and the frame display black screen with the message saying Google Photos: Authorization Required.

image

I can say that every 2-3 week, the black screen came up and I have to access the photoframe web interface and re-upload the jsaon file.

Is there a way to fix this issue? Thank you in advance.

mrworf commented 2 years ago

Can you grab logs next time this happens and share? Will hopefully provide me with some insights into this issue.

key5000 commented 2 years ago

Can you grab logs next time this happens and share? Will hopefully provide me with some insights into this issue.

Hi MrWorf,

Please see attached file for the logs, hopefully you can see the problems.

I just reload the JSON file about 2 hours ago.

Logs.txt

key5000 commented 2 years ago

Hi MrWorf, It happened again today, the screen showed the same error for GooglePhoto Authorization Required. Could you please help me to fix this error.

dgaz9 commented 2 years ago

I experience the same exact issues as well. I am unable to determine the cause of the issue.

On Tue, Jan 25, 2022, 10:49 PM key5000 @.***> wrote:

Hi MrWorf, It happened again today, the screen showed the same error for GooglePhoto Authorization Required. Could you please help me to fix this error.

— Reply to this email directly, view it on GitHub https://github.com/mrworf/photoframe/issues/201#issuecomment-1021835613, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATCO4PKSP32TSV7GWR25QALUX5VNTANCNFSM5MIZZ7XA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mrworf commented 2 years ago

I'm seeing

SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)

In the logs, which causes all comms with Google's servers to fail. This means it cannot get the token and then the authentication fails.

Now, why would this happen? Looking further at the log, it turns out that at the time of the first error, the date of the raspberry pi is August 12, which is quite wrong. You can see that it actually manages to get the correct time a bit later but then the authentication has been invalidated.

For some reason, getting network time is taking so long that the frame has time to fail ssl.

But, I assume you're not rebooting on a regular schedule :) so it means that your RPi randomly lost the correct time and date and this will cause it to fail SSL. The only thing I can think of is that the RPi isn't getting enough power which causes it to lose the date&time.

The only workaround I can imagine for this is to add a protective layer around all SSL calls so it will hold off if it detects a leap back in-time from last request.

mrworf commented 2 years ago

The web UI should show a warning if you're running with too low power, and you'll also see a lightning symbol on the display from time to time indicating lack of power.

key5000 commented 2 years ago

Hi MrWorf,

Thank you for your response.
The RPi never get reboot, it only scheduled to turn on/off the display. How do I schedule to reboot the RPi so it can keep up the time?

My RPi 3 was powered by iPad adapter 5.2V 2.4A (12W), do you think it has enough power?

No, I don’t see the lightning symbol on the display

mrworf commented 2 years ago

That should be enough and the fact that you don't see any indicators is a good thing. I just cant understand why your RPi would randomly get the wrong time and date if it's not being rebooted. I'd advise against scheduling a reboot since it will only worsen the issue.

I think the only long-term solution would be to implement safeguards around all network access which essentially makes the frame think network is lost if the time jumps back to the past (since that's the reason SSL fails)

key5000 commented 2 years ago

Hi MrWorf, Any suggestions on How to implement safeguards to keep the time up to date on RPi?

or I have to live with it by re-authorize the frame every few weeks?

mrworf commented 2 years ago

I need to find a few hours to develop it, I think it wouldn't be too difficult since points for http requests are centralized but it still needs to be done.

So yes, it will most likely take me a few weeks to get it done, between my day job and family. Sorry, I'll do my best.

/Henric On Jan 26, 2022, 6:54 PM -0800, key5000 @.***>, wrote:

Hi MrWorf, Any suggestions on How to implement safeguards to keep the time up to date on RPi? or I have to live with it by re-authorize the frame every few weeks? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

key5000 commented 2 years ago

Hi MrWorf, Thank you for your hard works on this photo frame project. I am looking forward to the fix and will check back in a month or so.

Best regards, Key

key5000 commented 2 years ago

Hi MrWorf,

I just want to check back to see if you get a chance to look into this issue?

Best regards, Key

mrworf commented 1 year ago

Is this still happening?

key5000 commented 1 year ago

Is this still happening?

Yes, it’s still happening. I lost the connection every few weeks. In order for the photoframe to display again, I have to re-authentication again.
The date and time on the photoframe/Raspberry Pi is up to date with correct one.

key5000 commented 1 year ago

Yes, it still happened.  I just responded back to the forum, hopefully Mr. Wolf have time to look into this again. Thanks

On Sunday, December 18, 2022, 9:08 AM, Henric Andersson @.***> wrote:

Is this still happening?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

mnkypshngbttns commented 1 year ago

same issue here