-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_webrepl: Remove the _webrepl module. #13786
base: master
Are you sure you want to change the base?
Conversation
All functionality form that module is now in the python part. The special filesystem protocol is not needed anymore as the web client implements filetransfer exactly as `mpremote` does. Signed-off-by: Felix Dörre <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #13786 +/- ##
=======================================
Coverage 98.36% 98.36%
=======================================
Files 161 161
Lines 21091 21091
=======================================
Hits 20746 20746
Misses 345 345 ☔ View full report in Codecov by Sentry. |
Code size report:
|
The original idea for WebREPL (conceived when esp8266 was new and it needed a minimal way to get a remote REPL) was to combine both Telnet and FTP into one protocol (so only one port needed to be listening), and also support accessing the device from a browser (hence websocket instead of normal sockets). Removing filesystem support is quite a big breaking change. But I agree that it's a good thing to do! I think it makes more sense to have filesystem access done using the standard mpremote mechanism (even if that means filesystem acces can no longer be done in the background).
Is that really true? WebREPL callbacks are done at thread level and so filesystem operations are atomic. One benefit of this PR is that it removes the large C-stack-allocated |
I am not sure that filesystem operations are atomic. See, for example, this stacktrace: #9297 (comment), showing a micropython/extmod/os_dupterm.c Line 109 in bc424dd
But this does not address possible races of the interrupt with main code (I've not tried to reproduce such a race, but I am pretty sure this is possible). This might be resolvable, but I am actually not sure which guarantee exactly we would need to verify, in order to ensure that file-system operations in a foreground job and an "unsolicited" file-transfer from If background operations are actually needed/required, isn't a more stable way to use the async-repl package, and then use the regular transfer logic? (I haven't tested that one yet, but this seems plausible to me). |
Yes. Essentially your application is creating its own "background FTP" task (really an |
While working on I'm now trying to get WebREPL working as a WebSocket client, and bumped into these: |
From what I see in your code, you don't use the "exact" fragments from |
@felixdoerre wow! could you describe briefly the mechanism behind this optimization?
|
When micropython/micropython-lib#814 is merged, all functionality form the
_webrepl
module that is still needed, is part of the python module. The special filesystem protocol is not needed anymore as the web client implements filetransfer exactly asmpremote
does. Also the filesystem protocol was not safe to use while the repl is busy with other file I/O anyways.While making way for more features in the webrepl, this change makes the micropython firmware smaller (see the numbers in #13540), the benefit only shows in builds with networking enabled.