mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 00:04:28 +01:00
[GH-ISSUE #512] The Template Google Calendar has stopped working #3087
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@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.
@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?
@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!
@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.
@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.