Skip to content

webrepl_cli.py: Add support for accessing REPL. #66

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

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

dpgeorge
Copy link
Member

@dpgeorge dpgeorge commented Sep 3, 2021

With this, the webrepl_cli.py script can be used to access the REPL, eg:

$ ./webrepl_cli.py -p x 192.168.4.1
op:repl, host:192.168.20.27, port:8266, passwd:x.
Remote WebREPL version: (1, 17, 0)
Use Ctrl-] to exit this shell
1/2
0.5
>>>

This is similar to #37 but simpler.

@rizzak
Copy link

rizzak commented Feb 23, 2022

Great!
I try it, this is works!
Can you add the instruction in README.md

@dov
Copy link

dov commented Oct 2, 2022

Why wasn't this merged into master yet? I'd like to merge my "command changes" (see #28) together with this pull request.

@dov
Copy link

dov commented Oct 10, 2022

@dpgeorge I thought you may be interested, that I enhanced your repl with a command mode for doing ls, get and put from the command line.

Here is a sample interaction:

./webrepl_cli.py -h 192.168.1.220
repl mode. Use Ctrl-] to exit this shell

>>>
cli [/]> ls
boot.py
main.py
webrepl_cfg.py
cli [/]> cat boot.py
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import uos, machine
#uos.dupterm(None, 1) # disable REPL on UART(0)
import gc
import webrepl
webrepl.start()
gc.collect()

cli [/]> help
Supported commands: exit, ls, repl, get, put, del

See: http://github.com/dov/webrepl/ , master branch.

@dpgeorge
Copy link
Member Author

Thanks @dov! I will take a look at your enhancements.

With this commit, the webrepl_cli.py script can be used to access the REPL,
for example:

    $ ./webrepl_cli.py -p x 192.168.4.1
    op:repl, host:192.168.20.27, port:8266, passwd:x.
    Remote WebREPL version: (1, 17, 0)
    Use Ctrl-] to exit this shell
    1/2
    0.5
    >>>

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge merged commit 1e09d9a into master Nov 8, 2022
@dpgeorge
Copy link
Member Author

dpgeorge commented Nov 8, 2022

This was merged.

I don't really want to support any more features for webrepl_cli.py. The next step would be to integrate the behaviour into mpremote, so mpremote would replace webrepl_cli.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants