Repository navigation
Conversation
Joining a network from a picker left the one the board was on first, and when the new join failed (a wrong password, a network that never answered) the board stayed off every network. A board reached over Wi-Fi, through WebREPL or a browser display, was cut off with the error shown on a page nobody could reach. wifinet now rejoins the network it was on with its saved password, and the error says so: "Wrong password for Cafe. Back on Home", or that the way back failed too. The checks' stand-in station now leaves its network when it joins another, as the real one does; with it, the old wifinet fails four new checks.
On a chip with an IEEE 802.15.4 radio (ESP32-C5, C6, H2, S31), machine.unique_id() is an EUI-64 cut to six bytes: the vendor's three, ff:fe and one byte of the MAC. Every default name ended in fffe and that byte, so two ESP32-S31 boards on one network both answered to omnipython-fffed0.local. The default name now takes the station MAC's last three bytes, which equal unique_id()'s on every ESP32 without 802.15.4, so no other board's name changes. A build without Wi-Fi still uses unique_id(). RemoteDisplay also prints the address by host name beside the IP address, and keeps it as RemoteServer.name_url.
vtterm read USB and BLE keyboards only, so the REPL on a desktop window or in the browser showing a RemoteDisplay ignored the keyboard in front of it. display_driver.take_keys() hands the display's own keys to a callback instead of LVGL's focused widget, and vtterm.keyboards.DisplayKeyboard uses it: start_all() starts it wherever the display has a keyboard of its own.
On esp32 the station still reads as connected, with the old address, for a moment after disconnect(). A join from one network to another took that for the new link and returned at once: a wrong password passed, was saved over the right one, and the board was left off the network.
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.
Four fixes for a board shown in a browser through RemoteDisplay, found on an ESP32-S31 running Home.
Changing Wi-Fi from the picker could leave the board off every network. On esp32 the station still reads as connected, with the old address, for a moment after
disconnect(), sowifi_manager's join took the old link for the new one and returned at once: a wrong password passed, was saved over the right one, and the station kept retrying it. A join now waits for the station to leave first. And when a join from the picker fails,wifinetgoes back to the network the board was on and says so ("Couldn't join none: timed out after 20s. Back on nothing"), because a board reached over Wi-Fi is otherwise cut off with the error on a page nobody can see.Two S31 boards answered to the same host name.
machine.unique_id()on chips with an 802.15.4 radio (C5, C6, H2, S31) is a truncated EUI-64 (1c2904fffed0), the same on every board of a batch, soboarddev's default name now comes from the Wi-Fi MAC on an ESP32. RemoteDisplay also prints itshttp://<name>.local/address beside the numeric one. The firmware side of the unique ID is a separate patch in omnipython-builds.The REPL app read only USB and BLE keyboards, so keys typed in the browser went nowhere.
display_driver.take_keys()lets a terminal take the display's own keys, and vtterm's newDisplayKeyboarduses it.Tested with the scoped suites (
test_wifi_manager,test_endpoint_providers,test_board_name,test_lvgl_display_driver,test_remotedisplay, vtterm'stests/run.py); each new test fails without its fix. On a Waveshare ESP32-S31-Zero with these files copied over the frozen ones: the page opened athttp://omnipython-d0a23a.local/from Windows;print(6*7)typed in the browser ran in the REPL app; a picker move from one network to the other and back came back at the same address in about 15 s; and a pair with a wrong password failed after 20 s, went back to the first network and left the saved passwords as they were. Not verified on a board: thename_urlprint (displaydev is frozen there). The first time the REPL app opened after a boot, twice out of three tries it showed no prompt or lost the first keys; later opens worked every time. That looks separate from this change and isn't fixed here.