Adafruit_Learning_System_Guides icon indicating copy to clipboard operation
Adafruit_Learning_System_Guides copied to clipboard

Adafruit Matrix Portal - Moon Clock error

Open lemonkey opened this issue 4 weeks ago • 9 comments

Using the latest version of CircuitPython (10.0.3) and the latest version of the code.py from the main branch, I'm seeing an error "AttributeError: 'MoonData' object has no attribute 'end_utc_seconds' attributed to this line of code:

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Matrix_Portal/Matrix_Portal_Moon_Clock/code.py#L335

Fetching from the weatherapi via a browser (https://api.met.no/weatherapi/sunrise/3.0/moon...) shows a successful response. Perhaps the structure of the data has changed recently?

This error started happening this morning for me.

lemonkey avatar Nov 11 '25 04:11 lemonkey

Also noted in https://forums.adafruit.com/viewtopic.php?t=221085.

We have two different moon phase clocks: https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/Matrix_Portal/Matrix_Portal_Moon_Clock https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/QT_Py/NeoPixel_Moon_Phase_Clock

They are using different API's for the moon phase. #3143 proposed a computational approach that does not use an external API: it only needs a time. Perhaps we should switch to that, since we frequently are chasing API's.

FYI @BlitzCityDIY

dhalbert avatar Nov 11 '25 17:11 dhalbert

I did come across this stackoverflow discussion a while back https://stackoverflow.com/questions/2526815/moon-lunar-phase-algorithm.

https://rhodesmill.org/skyfield/ seems to be well recommended.

lemonkey avatar Nov 12 '25 00:11 lemonkey

I have two different versions of the moon phase clock. Both failed to retrieve the json files. I was seeing URL 509 errors. I think this a SSL certificate issue with the MatrixPortal Network library. Using old Certs. If you have a ESP32-S3 board instead of M4 you can get the wifi library working to a point.

Sent from Mars


From: Ari Braginsky @.> Sent: Tuesday, November 11, 2025 5:31:24 PM To: adafruit/Adafruit_Learning_System_Guides @.> Cc: Subscribed @.***> Subject: Re: [adafruit/Adafruit_Learning_System_Guides] Adafruit Matrix Portal - Moon Clock error (Issue #3160)

[https://avatars.githubusercontent.com/u/53710?s=20&v=4]lemonkey left a comment (adafruit/Adafruit_Learning_System_Guides#3160)https://github.com/adafruit/Adafruit_Learning_System_Guides/issues/3160#issuecomment-3519319821

I did come across this stackoverflow discussion a while back https://stackoverflow.com/questions/2526815/moon-lunar-phase-algorithm

— Reply to this email directly, view it on GitHubhttps://github.com/adafruit/Adafruit_Learning_System_Guides/issues/3160#issuecomment-3519319821, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJTJEZDFYDYMH2FRSTZCIYT34J5VZAVCNFSM6AAAAACLXLK64SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMJZGMYTSOBSGE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

dwetchells avatar Nov 12 '25 14:11 dwetchells

If this is a cert error then you can use a more recent list of root certs by updating the firmware on the AirLift processor on the Matirx Portal M4: https://learn.adafruit.com/adafruit-matrixportal-m4/updating-esp32-firmware. On the Matrix Portal S3 the root cert list is in CircuitPython. 10.x.x has a full and recent root cert list.

dhalbert avatar Nov 12 '25 15:11 dhalbert

HTTP 509 errors are "Bandwith Limit Exceeded".

dhalbert avatar Nov 12 '25 16:11 dhalbert

If this is a cert error then you can use a more recent list of root certs by updating the firmware on the AirLift processor on the Matirx Portal M4: https://learn.adafruit.com/adafruit-matrixportal-m4/updating-esp32-firmware. On the Matrix Portal S3 the root cert list is in CircuitPython. 10.x.x has a full and recent root cert list.

I am using CircuitPython v10.0.3 btw.

lemonkey avatar Nov 12 '25 17:11 lemonkey

I am using CircuitPython v10.0.3 btw.

Which board are you using?

dhalbert avatar Nov 12 '25 17:11 dhalbert

I am using CircuitPython v10.0.3 btw.

Which board are you using?

The Matrix Portal https://www.adafruit.com/product/4745

lemonkey avatar Nov 12 '25 17:11 lemonkey

Hi all i am using the Esp32-s3. The moment the matrixportal moon phase program reaches the fetch command it spits out a 509 error message from weather api. I am using cp 10.0.3 . Are you say everything is working with the learn guide code sample?

Sent from Mars


From: Ari Braginsky @.> Sent: Wednesday, November 12, 2025 10:54:40 AM To: adafruit/Adafruit_Learning_System_Guides @.> Cc: ThinMan @.>; Comment @.> Subject: Re: [adafruit/Adafruit_Learning_System_Guides] Adafruit Matrix Portal - Moon Clock error (Issue #3160)

[https://avatars.githubusercontent.com/u/53710?s=20&v=4]lemonkey left a comment (adafruit/Adafruit_Learning_System_Guides#3160)https://github.com/adafruit/Adafruit_Learning_System_Guides/issues/3160#issuecomment-3523171439

I am using CircuitPython v10.0.3 btw.

Which board are you using?

The Matrix Portal https://www.adafruit.com/product/4745

— Reply to this email directly, view it on GitHubhttps://github.com/adafruit/Adafruit_Learning_System_Guides/issues/3160#issuecomment-3523171439, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJTJEZF3BLBPJAYED47RXWT34NX6BAVCNFSM6AAAAACLXLK64SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMRTGE3TCNBTHE. You are receiving this because you commented.Message ID: @.***>

dwetchells avatar Nov 13 '25 01:11 dwetchells