[GH-ISSUE #512] The Template Google Calendar has stopped working #1428

Closed
opened 2026-03-20 19:08:18 +01:00 by sascha_hemi · 5 comments
Owner

Originally created by @haselchen on GitHub (Oct 8, 2025).
Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/512

I'm using a Tag M2 2.9 with firmware 0x29.
The script from here (Wiki guide for Google Calendar) hasn't worked since the AP was updated to firmware 2.07b.
A new script has been created in various forums.

function getEventsForNextDay(days) { var start = new Date(); var end = new Date(); var time_offset = 0; end.setDate(end.getDate() + 8); var calendars = CalendarApp.getAllCalendars(); var events = []; for (var i = 0; i < calendars.length; i++) { var calendar = calendars[i]; var eventsInCalendar = calendar.getEvents(start, end); for (var j = 0; j < eventsInCalendar.length; j++) { var event = eventsInCalendar[j]; events.push({ title: event.getTitle(), start: Math.floor((event.getStartTime().getTime() / 1000)+(time_offset*3600)), end: Math.floor((event.getEndTime().getTime() / 1000)+(time_offset*3600)), location: event.getLocation(), description: event.getDescription() }); } } // Sort events by start date/time events.sort(function(a, b) { return a.start - b.start; }); return JSON.stringify(events); } function doGet() { var content = getEventsForNextDay(); var output = ContentService.createTextOutput(content); output.setMimeType(ContentService.MimeType.JSON); return output; }

The day hasn't updated since October 5th.
The batteries are new.
I ran the instructions for the Google script again.
To no avail; the log shows "invalidinput."
I can run the URL in Firefox, and the appointments are displayed.

Image Image Image
Originally created by @haselchen on GitHub (Oct 8, 2025). Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/512 I'm using a Tag M2 2.9 with firmware 0x29. The script from here (Wiki guide for Google Calendar) hasn't worked since the AP was updated to firmware 2.07b. A new script has been created in various forums. `function getEventsForNextDay(days) { var start = new Date(); var end = new Date(); var time_offset = 0; end.setDate(end.getDate() + 8); var calendars = CalendarApp.getAllCalendars(); var events = []; for (var i = 0; i < calendars.length; i++) { var calendar = calendars[i]; var eventsInCalendar = calendar.getEvents(start, end); for (var j = 0; j < eventsInCalendar.length; j++) { var event = eventsInCalendar[j]; events.push({ title: event.getTitle(), start: Math.floor((event.getStartTime().getTime() / 1000)+(time_offset*3600)), end: Math.floor((event.getEndTime().getTime() / 1000)+(time_offset*3600)), location: event.getLocation(), description: event.getDescription() }); } } // Sort events by start date/time events.sort(function(a, b) { return a.start - b.start; }); return JSON.stringify(events); } function doGet() { var content = getEventsForNextDay(); var output = ContentService.createTextOutput(content); output.setMimeType(ContentService.MimeType.JSON); return output; }` The day hasn't updated since October 5th. The batteries are new. I ran the instructions for the Google script again. To no avail; the log shows "invalidinput." I can run the URL in Firefox, and the appointments are displayed. <img width="424" height="344" alt="Image" src="https://github.com/user-attachments/assets/fd36ceae-2cf6-42a4-b24c-7da635b22ef5" /> <img width="278" height="73" alt="Image" src="https://github.com/user-attachments/assets/a1247360-482e-4bdd-a9ab-e0c6f200c95f" /> <img width="340" height="355" alt="Image" src="https://github.com/user-attachments/assets/31711c10-4278-4c62-a544-08ef22eb0208" />
sascha_hemi added the bug label 2026-03-20 19:08:18 +01:00
Author
Owner

@nlimper commented on GitHub (Oct 8, 2025):

You can check the output of the serial console of the AP to see more log info.
If the apps script url you entered as a parameter gives out a valid json when you open it in your browser, then check if your AP has proper internet access, including DNS. In case you entered a static IP in the wifi setup screen, don't forget to also enter a dns server address.

<!-- gh-comment-id:3381086145 --> @nlimper commented on GitHub (Oct 8, 2025): You can check the output of the serial console of the AP to see more log info. If the apps script url you entered as a parameter gives out a valid json when you open it in your browser, then check if your AP has proper internet access, including DNS. In case you entered a static IP in the wifi setup screen, don't forget to also enter a dns server address.
Author
Owner

@haselchen commented on GitHub (Oct 8, 2025):

@nlimper

I haven't changed anything at all. The template, like all the others, has been running for almost two years.
I have no idea about programming.
Has Google perhaps changed something in the code?

Have you read the script?
Is everything still in order?

<!-- gh-comment-id:3381102664 --> @haselchen commented on GitHub (Oct 8, 2025): @nlimper I haven't changed anything at all. The template, like all the others, has been running for almost two years. I have no idea about programming. Has Google perhaps changed something in the code? Have you read the script? Is everything still in order?
Author
Owner

@nlimper commented on GitHub (Oct 8, 2025):

The script you pasted is unreadable as it doens't contain line endings...
The correct latest version of the script is on https://github.com/OpenEPaperLink/OpenEPaperLink/tree/master/miscellaneous/calendar%20content%20type
This is working, as many people use it.
You can check the validity of your json output on https://jsonlint.com/ .
Good luck!

<!-- gh-comment-id:3381113722 --> @nlimper commented on GitHub (Oct 8, 2025): The script you pasted is unreadable as it doens't contain line endings... The correct latest version of the script is on https://github.com/OpenEPaperLink/OpenEPaperLink/tree/master/miscellaneous/calendar%20content%20type This is working, as many people use it. You can check the validity of your json output on https://jsonlint.com/ . Good luck!
Author
Owner

@haselchen commented on GitHub (Oct 8, 2025):

@nlimper

You're a total genius.
This guide worked.
Maybe the URL with the guide should be made a bit more public.
It took 30 seconds, and then all the appointments were there. Thank you so much for your super-fast support.

<!-- gh-comment-id:3381131063 --> @haselchen commented on GitHub (Oct 8, 2025): @nlimper You're a total genius. This guide worked. Maybe the URL with the guide should be made a bit more public. It took 30 seconds, and then all the appointments were there. Thank you so much for your super-fast support.
Author
Owner

@nlimper commented on GitHub (Oct 8, 2025):

I'm glad it works now. I removed the code from the wiki and added a link the the correct github code.

<!-- gh-comment-id:3381348900 --> @nlimper commented on GitHub (Oct 8, 2025): I'm glad it works now. I removed the code from the wiki and added a link the the correct github code.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#1428