Configuration Management for Hardware

This class implements the configuration API for real hardware, allowing communication via MicroPython to access hardware Wi-Fi endpoints and more.

class firmware.config_pico.ConfigPico

Bases: ConfigBase

This class implements the configuration management API, specifically for actual hardware usage. This class is expected to operate on the hardware, executed via MicroPython. During provisioning, an actual Wi-Fi access point and HTTP server is established to provide user functionality.

PIN_FACTORY_RESET = 6

The board Pin connected to a switch (and to GND) used to detect factory reset mode

establish_config(screen: ScreenBase = None) None

If a valid configuration is already available on the device, this function returns without any action. To create a new configuration, this function will establish a Wi-Fi access point and an HTTP server. This device will also present the user with information including a QR code on the screen to ease the provisioning process. Once the user has submitted the information, the data is saved, and the board is reset.

Parameters:

screen – An optional display to present information the user. It will be in the terminal, also.

Returns:

Nothing

github_token() str

Returns the user-provided GitHub token

Returns:

A string token

wifi_networks() dict

Returns a merge of the default known Wi-Fi networks, along with the optional user-provided extra network.

Returns:

A dict of network information, with keys as SSID and values as PW.