Repository navigation
board configs: one remote-display config for every board with no screen - #836
Merged
Merged
Conversation
nodisplay/remote-display is a board_config.py with no pins: a 480x320 RemoteDisplay in a web browser, asking for the WebREPL password, that binds whichever board_peripherals is installed beside it and builds the board's buttons into keypad when that module has a keypad(). A board with no display installs it next to its own package; fitting a real display later means installing that display's config, and the apps stay. The ESP32-Audio-Kit and the Adafruit ESP32 Feather V2 get board_peripherals packages of their own in nodisplay (the kit's moves out of its ILI9341 config, which now requires it, and gains its LED and KEY1-KEY6; the Feather's has the NeoPixel, LED, STEMMA QT, battery and SW38), so each works with the remote-display config or with its display's. Checked on MicroPython's unix port: Home and the Bluetooth Receiver started through this config and were drawn and clicked in Chromium after the password prompt; tests/test_remote_display_config.py covers the password, the environment settings and the keypad.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A board with no screen can now install one board config,
nodisplay/remote-display, beside its ownboard_peripheralspackage and get a 480x320 display in any browser on its network. The config names no pins: it makes aRemoteDisplaythat asks for the WebREPL password, binds whicheverboard_peripheralsis installed, and turns the board's buttons intokeypadwhen that module has akeypad(). Size, port and password come fromOMNIPYTHON_WIDTH,OMNIPYTHON_HEIGHT,OMNIPYTHON_REMOTE_PORTandOMNIPYTHON_REMOTE_PASSWORD. With no password at all the import raises rather than leave the display open to the network. Moving a board to a real display means installing that display's config, which replacesboard_config.pyand leaves the apps alone.Two boards get their own packages in
nodisplay. The ESP32-Audio-Kit'sboard_peripheralsmoves out ofili9341_esp32_audio_kitintoesp32_audio_kit, which the ILI9341 config now requires, and it gains the green LED and KEY1-KEY6. The newadafruit_feather_esp32_v2has the NeoPixel, red LED, STEMMA QT I2C, battery monitor, Wi-Fi and BLE, with SW38 as itskeypad(). Its pins come from Adafruit's pinout. The HX8357 FeatherWing config now requires it instead of carrying an I2C-only copy. The existing headless boards needed no code changes, because none of them reads anything fromboard_configthat it doesn't already look up as optional. Their docstrings now point at the new config.How it was checked: on MicroPython's unix port, Home (started as
apps/home/main.pystarts it, withoutnet.boot(), since unix has nonetwork) and the Bluetooth Receiver both ran through this config, with the password taken from awebrepl_cfg.py. I opened each in headless Chromium, entered the password and saw them drawn. A click on Home's Bluetooth Receiver tile opened the app.tests/test_remote_display_config.pycovers the defaults, the environment settings, the refusal without a password, the keypad and the rule that no headless package ships aboard_config.py. Each check was made to fail once by breaking the config on purpose.libbuild.py check,installers --check, the board, omip and remotedisplay tests and the Sphinx build pass. None of this has run on a board yet: the Feather's roles, the kit's LED and keys, andkeypad()on real pins are still unchecked.