From fed383218eee2ffcdb08cd4e9601d0bc5c1ea4b6 Mon Sep 17 00:00:00 2001 From: Dave Koberstein Date: Sun, 29 Mar 2026 18:20:57 -0700 Subject: [PATCH 1/3] Let the backend handle movies NASA took down the server and host that provided the movies HC could play. HC just opened a brower tab. We should remove the dependency of the movie server from HC and let the backend figure it out. This keeps the filenames essentially the same but sends the browser to the backend which can serve up movies, redirect, or whatever. --- ESPHamClock/sdo.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/ESPHamClock/sdo.cpp b/ESPHamClock/sdo.cpp index 48e1a6c..c2cb81f 100644 --- a/ESPHamClock/sdo.cpp +++ b/ESPHamClock/sdo.cpp @@ -27,14 +27,14 @@ static const char *sdo_menu[SDOT_N] = { "304A", }; -static const char *sdo_url[SDOT_N] = { - "https://sdo.gsfc.nasa.gov/assets/img/latest/mpeg/latest_1024_211193171.mp4", - "https://sdo.gsfc.nasa.gov/assets/img/latest/mpeg/latest_1024_HMIB.mp4", - "https://sdo.gsfc.nasa.gov/assets/img/latest/mpeg/latest_1024_HMIIC.mp4", - "https://sdo.gsfc.nasa.gov/assets/img/latest/mpeg/latest_1024_0131.mp4", - "https://sdo.gsfc.nasa.gov/assets/img/latest/mpeg/latest_1024_0193.mp4", - "https://sdo.gsfc.nasa.gov/assets/img/latest/mpeg/latest_1024_0211.mp4", - "https://sdo.gsfc.nasa.gov/assets/img/latest/mpeg/latest_1024_0304.mp4", +static const char *sdo_filenames[SDOT_N] = { + "1024_211193171.mp4", + "1024_HMIB.mp4", + "1024_HMIIC.mp4", + "1024_0131.mp4", + "1024_0193.mp4", + "1024_0211.mp4", + "1024_0304.mp4", }; static const char *sdo_file[SDOT_N] = { @@ -261,7 +261,13 @@ bool updateSDOPane (const SBox &box) */ static void showSDOmovie (void) { - openURL (sdo_url[sdo_choice]); + char full_url[256]; + + // Construct the URL dynamically using snprintf + snprintf(full_url, sizeof(full_url), "https://%s:%d/ham/HamClock/SDO/movies/%s", + backend_host, backend_port, sdo_filenames[sdo_choice]); + + openURL(full_url); } /* check for our touch in the given pane box. From 9395f147dd6161bbeb9e9a43fd02c34c8efe74ff Mon Sep 17 00:00:00 2001 From: Dave Koberstein Date: Mon, 6 Apr 2026 16:35:51 -0700 Subject: [PATCH 2/3] Like SDO, let backend handle movies We observed the NASA page was down for a while. HamClock shouldn't bake this URL into its code. It should direct its request to the backend. The movie is a YouTube video so that backend could fall back to the YouTube URL if the NASA page is down. --- ESPHamClock/moonpane.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ESPHamClock/moonpane.cpp b/ESPHamClock/moonpane.cpp index 543bb60..18e6a9b 100644 --- a/ESPHamClock/moonpane.cpp +++ b/ESPHamClock/moonpane.cpp @@ -111,8 +111,12 @@ bool checkMoonTouch (const SCoord &s, const SBox &box) updateMoonPane (box); drawEMETool(); } - if (mitems[1].set) - openURL ("https://apod.nasa.gov/apod/ap240602.html"); + if (mitems[1].set) { + char full_url[256]; + snprintf(full_url, sizeof(full_url), "https://%s:%d/ham/HamClock/moon/movies/ap240602.html", + backend_host, backend_port); + openURL(full_url); + } // refresh scheduleNewPlot (PLOT_CH_MOON); From 5afae365cab78e340abb02f5c5a11f0c6d84a6b5 Mon Sep 17 00:00:00 2001 From: Dave Koberstein Date: Mon, 6 Apr 2026 17:41:58 -0700 Subject: [PATCH 3/3] Need to use http on backend_port Keeping in the spirit of using the configured port, these URLs need to point to the backend without https. The backend probably supports https for f/w upgrades but we'll follow the standard of all the other endpoints --- ESPHamClock/moonpane.cpp | 2 +- ESPHamClock/sdo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ESPHamClock/moonpane.cpp b/ESPHamClock/moonpane.cpp index 18e6a9b..e1dd931 100644 --- a/ESPHamClock/moonpane.cpp +++ b/ESPHamClock/moonpane.cpp @@ -113,7 +113,7 @@ bool checkMoonTouch (const SCoord &s, const SBox &box) } if (mitems[1].set) { char full_url[256]; - snprintf(full_url, sizeof(full_url), "https://%s:%d/ham/HamClock/moon/movies/ap240602.html", + snprintf(full_url, sizeof(full_url), "http://%s:%d/ham/HamClock/moon/movies/ap240602.html", backend_host, backend_port); openURL(full_url); } diff --git a/ESPHamClock/sdo.cpp b/ESPHamClock/sdo.cpp index c2cb81f..ea3306f 100644 --- a/ESPHamClock/sdo.cpp +++ b/ESPHamClock/sdo.cpp @@ -264,7 +264,7 @@ static void showSDOmovie (void) char full_url[256]; // Construct the URL dynamically using snprintf - snprintf(full_url, sizeof(full_url), "https://%s:%d/ham/HamClock/SDO/movies/%s", + snprintf(full_url, sizeof(full_url), "http://%s:%d/ham/HamClock/SDO/movies/%s", backend_host, backend_port, sdo_filenames[sdo_choice]); openURL(full_url);