-
Notifications
You must be signed in to change notification settings - Fork 19
pyportal.get_local_time() failure, NoneType #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyportal.get_local_time() failure, NoneType #24
Comments
So I just encountered that on the help channel on discord, and the quick solution with that demo was to remove: print("Connecting to AP...")
while not esp.is_connected:
try:
esp.connect_AP(secrets["ssid"], secrets["password"])
except RuntimeError as e:
print("could not connect to AP, retrying: ", e)
continue
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi) and replace with this (a few lines lower) pyportal.network.connect() For me it's a problem with duplicating features when using a large device-name library. You can't do that with pins for example because they will be "already in use", and it shouldn't be done with the wifi connection either in these libraries. I would also advise to use A workaround to still allow connecting outside of the library would be to add something like this to while not self._wifi.is_connected:
[...]
# add:
if not self.requests:
self._wifi.setup_after_connection()
self.requests = self._wifi.requests After the while loop:
That's because that connection code that sets up |
I'm still seeing this error output on the latest version of the library. |
Calls to
pyportal.get_local_time(secrets["timezone"])
fail with error:Printing on L198 (https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/blob/main/adafruit_portalbase/network.py#L198):
Yields a
None
type forself._wifi.requests
.Example code for where this occurs: https://learn.adafruit.com/pyportal-google-calendar-event-display/code-usage
The text was updated successfully, but these errors were encountered: