Page 1 of 1

Is ampy unreliable

Posted: Fri Oct 08, 2021 1:23 am
by bitrat
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

Re: Is ampy unreliable

Posted: Fri Oct 08, 2021 1:50 pm
by dork3nergy
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.

Re: Is ampy unreliable

Posted: Fri Oct 08, 2021 5:04 pm
by bitrat
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...

Re: Is ampy unreliable

Posted: Sat Oct 09, 2021 9:14 am
by pythoncoder
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.

Re: Is ampy unreliable

Posted: Sat Oct 30, 2021 6:56 pm
by bitrat
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! :-)