Is ampy unreliable

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
bitrat
Posts: 41
Joined: Fri Jul 26, 2019 4:13 am

Is ampy unreliable

Post by bitrat » Fri Oct 08, 2021 1:23 am

Hi,

Last time I used ampy it was very robust, to the point that I could call it from makefiles and trigger hardware tests, etc. A lot of that was running the tool from Windows 10 using WSL.

I'm now using it to talk to the same boards, from my Ubuntu system. It often fails and (to be fair) I think pico fails as well. It looks as if the board isn't responding but actually I think the board is fine and the USB or USB/serial is failing. There are no exceptions or errors reported by the software (but see below), just no communication either way.

I'm just looking for ideas on how to investigate...

Code: Select all

ampy --delay 1 --baud 115200 --port /dev/ttyUSB0  put ../src/reactor.py

Code: Select all

picocom /dev/ttyUSB0 --baud 115200
Maybe a clue in dmesg?

Code: Select all

$ dmesg | grep USB0
[   33.340820] usb 3-1: cp210x converter now attached to ttyUSB0
[ 3496.539293] cp210x ttyUSB0: failed set request 0x7 status: -19
[ 3496.539301] cp210x ttyUSB0: failed set request 0x12 status: -19
[ 3496.539306] cp210x ttyUSB0: failed set request 0x0 status: -19
[ 3496.539466] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[ 3502.683471] usb 3-1: cp210x converter now attached to ttyUSB0
[ 3628.420236] cp210x ttyUSB0: failed set request 0x7 status: -19
[ 3628.420240] cp210x ttyUSB0: failed set request 0x12 status: -19
[ 3628.420242] cp210x ttyUSB0: failed set request 0x0 status: -19
[ 3628.420349] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[ 3631.655553] usb 3-1: cp210x converter now attached to ttyUSB0
[ 5411.708971] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[ 5414.512317] usb 3-1: cp210x converter now attached to ttyUSB0

dork3nergy
Posts: 8
Joined: Thu Apr 09, 2020 7:19 pm

Re: Is ampy unreliable

Post by dork3nergy » Fri Oct 08, 2021 1:50 pm

For reliability, I've found that rshell works quite well. It's easily installed with:

Code: Select all

sudo pip3 install rshell
It gives you an easy way to transfer file as well as a REPL prompt for testing your code.

bitrat
Posts: 41
Joined: Fri Jul 26, 2019 4:13 am

Re: Is ampy unreliable

Post by bitrat » Fri Oct 08, 2021 5:04 pm

Thanks, looks good! It'll be good to have one tool for files and REPL

Something tells me the problem I'm having is system related tho. Just don't have time right now to spelunk it...

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Is ampy unreliable

Post by pythoncoder » Sat Oct 09, 2021 9:14 am

I use and recommend rshell. It's also worth getting to know mpremote. This is an official tool. A powerful feature is that you can mount a PC directory on the target hardware's filesystem. This lets you run complex applications without altering the target's file storage.
Peter Hinch
Index to my micropython libraries.

bitrat
Posts: 41
Joined: Fri Jul 26, 2019 4:13 am

Re: Is ampy unreliable

Post by bitrat » Sat Oct 30, 2021 6:56 pm

pythoncoder wrote:
Sat Oct 09, 2021 9:14 am
I use and recommend rshell. It's also worth getting to know mpremote. This is an official tool. A powerful feature is that you can mount a PC directory on the target hardware's filesystem. This lets you run complex applications without altering the target's file storage.
Thanks, still getting around to this! :-)

Post Reply