wendlers / mpfshell

A simple shell based file explorer for ESP8266 Micropython based devices ⛺
MIT License
396 stars 84 forks source link

version 0.9.2 not work #103

Closed kenjican closed 2 years ago

kenjican commented 3 years ago

execute mpfshell, open ttyUSB0 , it shows connected and then exit mpfshell. I used to upload files with version 0.9.1 ,it works well.

OS: LinuxMint 20.2 Python 3.8 Pyseiral 3.5

ianrepsch commented 3 years ago

Have the same problem, works fine in popOs 20.04 (Pyserial 3.4, Python 3.8) with 0.9.1. But didn't work on Arch Linux machine (Pyserial 3.5, Python 3.9.6). pip3 list shows 0.9.2, uninstalled that then 'sudo pip3 install mpfshell==0.9.1' Now works fine on Arch (I didn't try 0.9.2 on popOS to see if it breaks).

formatc1702 commented 2 years ago

I have the same issue with 0.9.2. Falling back to 0.9.1 works.

MacOS 11.6 Python 3.9

hyx0329 commented 2 years ago

I found the reason. cmd.Cmd.cmdloop uses return value from do_* as a flag for stop(source code here), which cause the loop to exit if True.

Before https://github.com/wendlers/mpfshell/commit/190bc7557d7c8bf72947c1fff212301962fe031d, the return value was None and after that, successfully opening a connection returns True which causes the cmdloop to exit. I'd suggest to use a better approach to expose the connection status.

skorokithakis commented 2 years ago

Thank you, @hyx0329! Would you be interested in submitting a PR?