adafruit / Adafruit_CircuitPython_PortalBase

Base Library for the Portal-style libraries.
MIT License
18 stars 17 forks source link

Despite code to support settings.toml it fail for me #99

Closed dglaude closed 10 months ago

dglaude commented 11 months ago

I encountered a few MagTag and MatrixPortal projects that failed on me except if I create the proper secrets.py. And this even if I create a file settings.toml.

Initially I believed those library were not updated, but I found code here to support both the old and the new way is define in the code, but despite that I fail to make it work and I always get secrets.py related message.

Could someone have a look?

I know my settings.toml is OK because using the todbot trick below, I have the expected result: my IP addr: 192.168.192.153

https://github.com/todbot/circuitpython-tricks#what-the-heck-is-settingstoml

import os, wifi
print("connecting...")
wifi.radio.connect(ssid=os.getenv('CIRCUITPY_WIFI_SSID'),
                   password=os.getenv('CIRCUITPY_WIFI_PASSWORD'))
print("my IP addr:", wifi.radio.ipv4_address)
dglaude commented 11 months ago

Update... with 9.0.0-a-5 it works with only the file settings.toml without any secrets.py. (it also works with only secrets.py.

So the problem would only be with the 8.x family. Still os.getenv("") seems to work in 8.x, so I do not really understand what is going on.

makermelissa commented 10 months ago

I think the frozen libraries in the 8.2.x branch have not been updated in a long time. You could always put the library folder in the root folder to override the frozen lib, but this would likely cause the MatrixPortal M4 to run out of memory.