mpfshell: remote shell for esp8266
Re: mpfshell: remote shell for esp8266
Unfortunately I won't be of any help to you, because I've never even read rshell code. And I guess we should leave it to the maintainer to port it to esp8266 if it is planned at all :)
Re: mpfshell: remote shell for esp8266
I am also not the maintainer, but rshell is designed to usually be executed with CPython and talks to an MicroPython interpreter via a serial interface. It is not intended to be run on a microcontroller directly. Maybe a port to the MicroPython Unix port is possible or done.skylin008 wrote:Hi, platforma .I had ported the rshell to esp8266 scripts directory,but some error shows:Traceback (most recent call last):Code: Select all
>>>[code] import cmd
File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 5112 bytes[/code]
You seem to try to port it onto an ESP8266 by launching it from within your firmware like a frozen module!?
rshell uses the serial interface to access the MicroPython REPL on a microcontroller in its different modes to transfer files and execute commands. This is implemented as an interactive Unix shell-like command line interface.
Re: mpfshell: remote shell for esp8266
rshell runs purely on the host and downloads required snippets to the board using pyboard.py
I've also written shell which runs purely on the device:
https://github.com/dhylands/upy-shell
I'd like for both of these to work with esp8266 but I've been swamped at work and haven't had any time to play with the 8266.
I've also written shell which runs purely on the device:
https://github.com/dhylands/upy-shell
I'd like for both of these to work with esp8266 but I've been swamped at work and haven't had any time to play with the 8266.
Re: mpfshell: remote shell for esp8266
I updated the mpfshell I initially wrote for basic file access on the ESP in a way to allow mounting the FS on the ESP via FUSE (Linux/mac only, sorry). So now the following is possible:
E.g. Mount the device on port "/dev/ttyUSB0" to "$HOME/mp":
From there on, you could work under "$HOME/mp" as with a usual file system (list, create, delete, edit etc.), with the main difference, that the chances made are not written back to the board unless one commits them by executing the special file ".commit":
To access the REPL one could execute an other special file:
For those interested, the code could be found here (very very ALPAH :
https://github.com/wendlers/mpfshell
E.g. Mount the device on port "/dev/ttyUSB0" to "$HOME/mp":
Code: Select all
test -d $HOME/mp || mkdir $HOME/mp
./mpmount.sh -p /dev/ttyUSB0 -m $HOME/mp
cd $HOME/mp
Code: Select all
echo 'print("Hello World!")' > test.py
./.commit
Code: Select all
./.terminal
>> import test.py
https://github.com/wendlers/mpfshell
Re: mpfshell: remote shell for esp8266
I made an update of the shell. It now allows to create/remove/navigate directories on the ESP flash file-system. Also it allows to enter the REPL from within the shell and supports very basic scripting through a file or command-line arguments.
For more details see https://github.com/wendlers/mpfshell.
For more details see https://github.com/wendlers/mpfshell.
mpfshell now supports connections via websockets
Hi,
I finished basic support for connecting with the "shell" to the ESP8266 via websockets (WebREPL needs to be active). Thus, all the shell operations (like put, get, full REPL, ...) are usable via a WiFi connection. Using a websocket connection is done by the following command in the shell:
The shell will promt for the password, then try to connect to the ESP.
I also added support for the WiPi. The shell now has more or less this features:
Regards,
Stefan
I finished basic support for connecting with the "shell" to the ESP8266 via websockets (WebREPL needs to be active). Thus, all the shell operations (like put, get, full REPL, ...) are usable via a WiFi connection. Using a websocket connection is done by the following command in the shell:
The shell will promt for the password, then try to connect to the ESP.
I also added support for the WiPi. The shell now has more or less this features:
- - Support for serial connections (ESP8266 and WiPi)
- Support for websockets (via WebREPL) connections (ESP8266 only)
- Support for telnet connections (WiPy only)
- Full directory handling (enter, create, remove)
- Transfer (upload/download) of multiple files matching a reg.-exp.
- All files are transferred in binary mode, and thus it should be possible to also upload pre-compiled code (.mpy) too.
- Integrated REPL (supporting a workflow like: upload changed files, enter REPL, test, exit REPL, upload ...)
- Tab-completion
- Command history
- Fully scriptable
Regards,
Stefan
Re: mpfshell: remote shell for esp8266
Hi,
It seems wrong to write a new tool which runs on Python 2; Micropython is itself based on Python3 and all new projects should surely use P3.
And you really want to fix that echoing bug.
Mark
It seems wrong to write a new tool which runs on Python 2; Micropython is itself based on Python3 and all new projects should surely use P3.
And you really want to fix that echoing bug.
Mark
Re: mpfshell: remote shell for esp8266
@wendlers Thanks, thanks... mpfshell is handy tool... working on the first run.... some small bugs in editing cmd line but it doesn't matter.
Re: mpfshell: remote shell for esp8266
Hi,
Regards,
Stefan
Support for Python3 is clearly on the list. I just had no time yet to test on Python3.markxr wrote: It seems wrong to write a new tool which runs on Python 2; Micropython is itself based on Python3 and all new projects should surely use P3.
I think the mentioned issue is caused by using PySerial 2.x (and not 3.x which is the intended version). However, I think I got around this (https://github.com/wendlers/mpfshell/issues/2), so please "git pull" and give it a try.markxr wrote: And you really want to fix that echoing bug.
Regards,
Stefan
Re: mpfshell: remote shell for esp8266
Thanks! For bugs, your are very welcome to file an issue on github.profra wrote:@wendlers Thanks, thanks... mpfshell is handy tool... working on the first run.... some small bugs in editing cmd line but it doesn't matter.