Skip to content

Fruit_Jam_Product_Overlay TypeError without Wifi Configuration #3120

@relic-se

Description

@relic-se

If wifi credentials have not been configured within your device's environment variables, fruitjam.fetch() can also through a TypeError exception with the following details:

Traceback (most recent call last):
  File "<stdin>", line 158, in <module>
  File "adafruit_fruitjam/__init__.py", line 302, in fetch
  File "adafruit_portalbase/network.py", line 552, in fetch
  File "adafruit_portalbase/network.py", line 406, in connect
  File "adafruit_portalbase/wifi_coprocessor.py", line 85, in connect
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 657, in connect
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 680, in connect_AP
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 548, in wifi_set_network
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 421, in _send_command_get_response
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 303, in _send_command
TypeError: object of type 'NoneType' has no len()

TypeError could be added to the tuple on this line:

except (RuntimeError, ConnectionError, OSError) as e:

Or something along the lines of the following exception handler could be added to inform the user:

except TypeError as e:
    print("WiFi has not be configured properly.")
    supervisor.reload()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions