randomBrainstormer / MMM-GoogleCalendar

Google Calendar for MagicMirror²
MIT License
68 stars 45 forks source link

Calendar only showing loading #70

Open KoboseHome opened 3 weeks ago

KoboseHome commented 3 weeks ago

I installed MMM-GoogleCalendar a couple of days ago, and have slowly been working through setup issues using my pi zero w. So far I have been able to see that the google account was authorized (I got 10 upcoming events when authorizing). I also resolved issues seen in the pm logs relating to not having the right calendar ID (I would recommend adding more details in the read me regarding adding the full calendar domain when putting the ID). After resolving these issues I am not seeing any more errors in the pm logs, but the module still shows loading regardless of how long I wait or reboot the device. I have manually looked through the pm2 logs (MagicMirror-error.log MagicMirror-out.log) and did not see any errors pop up when starting. I did try the pm2 restart mm followed by pm2 logs mm and was not getting new logs (likely since the pm2 restart mm failed with this error [PM2][ERROR] Process or Namespace mm not found).

Do you have any other recommendations for where to look for issues? I am slowly picking up linux/raspberry pi/MM programing but am still very green as it has been a while since the last time I was coding in linux consistently.

mtitus83 commented 3 weeks ago

Same here, stuck at "Loading ...". There are a few things I noticed that are worth reporting as well; mostly just repeat of @KoboseHome .

The first thing I noticed is that node authorize.js was unhappy and threw and error; I'm unable to reproduce this to show it but I can tell you that it basically said that token.js was missing. But after authenticating it spit out this.

MMM-GoogleCalendar: Upcoming 10 events:
2024-09-28T19:00:00-04:00 - Meeting

So, I'm using "calendar-week" and whats odd is that ^ event is about 2 weeks away. I have events on my calendar for this week in that specific calendar that I would expect to see. I'm not sure if that output should show all 10 events or not but as you can see there's several upcoming events on my calendar. I think this is enough evidence to show that I'm authenticating and pulling calendar entries.

I attached a clip of my mm error log log-sanitized.txt which I believe to be the error. I can confirm that the Google Calendar ID is correct (as above) for obvious reasons I have masked that and the Bearer Token with '_REDACTED_' in the log.

I'll spend a little bit longer investigating just for kicks, I only know enough to be dangerous though. log-sanitized.txt

mtitus83 commented 3 weeks ago

I"m dumb - it works. I misunderstood the directions and excluded @group.calendar.google.com from my calendar ID. I'll leave this for posterity so anyone else failing to follow directions can find it :)

KoboseHome commented 3 weeks ago

I do have an update on this. The display will show everything in the calendar after 1 reset a day. Every other reset of the raspberry pi, or of MagicMirror, the calendar only shows loading. I was thinking it could be related to API settings limiting the responses to once a day, so I made a change on the google account, however that did not seem to resolve the issue immediately. I also was able to get the pm2 logs (I replaced mm with MagicMirror), but they do not show any errors. I also continue to get meeting info when I run node authorize.js, regardless of if they are showing on the dashboard or not.

randomBrainstormer commented 3 weeks ago

Hi @KoboseHome, thanks for the detailed update! When you mention 'reset,' could you clarify whether you're referring to rebooting the Raspberry Pi, restarting MagicMirror, or something else? If you're restarting the Pi, it's possible that the Google API might be failing to authenticate again, which could cause the module to get stuck on 'loading.'

To troubleshoot further, I’d recommend checking the browser console for any errors when the calendar is stuck on loading. You can do this by connecting a monitor to your Pi and opening the browser console (usually with F12). This might provide more insight into what’s going wrong.

Additionally, if the issue persists, try looking deeper into the logs right after a fresh start to see if there’s any unusual activity or failed API requests. Since you've made changes to the API settings, make sure the credentials and tokens are still valid after each reboot.

Let me know if you find anything new, or if you need more help!

randomBrainstormer commented 3 weeks ago

I’ve pushed an update based on the error log attached by @mtitus83 to make the initial error log even more explicit. Thanks for bringing this to my attention!