net/webrepl: Support LAN interfaces and fix AttributeError on ports without WLAN#1116
Open
AsinoEsel wants to merge 1 commit into
Open
net/webrepl: Support LAN interfaces and fix AttributeError on ports without WLAN#1116AsinoEsel wants to merge 1 commit into
AsinoEsel wants to merge 1 commit into
Conversation
On ports without network.WLAN (such as the ESP32-P4 port), webrepl crashes on webrepl.start() because network.WLAN is accessed unconditionally in setup_conn(). Add LAN interface support, add try/except around LAN and WLAN access, and add fallback to 0.0.0.0:<port> if no active interface is found. Based on micropython#920 by @Romaric-RILLET. Signed-off-by: AsinoEsel <lerefff@gmail.com>
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.
WebREPL currently does not support LAN interfaces, and raises an AttributeError on webrepl.start() on boards without network.WLAN, such as the ESP32-P4 port. The exception is raised in setup_conn() in line 105:
Steps to reproduce:
import webrepl_setupThis PR adds
I have tested this on an ESP32-P4-ETH board, and a generic ESP32 board. Works as intended.
This issue was raised before in #920 by @Romaric-RILLET, but that attempted fix failed to cover the network.WLAN AttributeError (as it happens outside the try-except block), making it impossible for ethernet-only boards to use WebREPL.