Page 1 of 1

pyboard tool error

Posted: Tue Nov 10, 2020 9:24 pm
by manos
Hey,

it seems like I can't access the files stored in flash of my xbee 3, using the pyboard tool.
Although, I can use a command like this:
pyboard --device /dev/ttyUSB0 -b 9600 -c 'print(1+1)'
(which means that the pyboard tool is communicating with micropython's repl in my xbee), the following doesn't work:
pyboard --device /dev/ttyUSB0 -b 9600 -f ls
with the following error:
pyboard: error: unrecognized arguments: -f
which I am pretty sure that f flag is the correct one for filesystem operations...

Any help is welcomed!

Re: pyboard tool error

Posted: Wed Nov 11, 2020 7:07 am
by Roberthh
It looks like you are using an old version of pyboard.py. I am using the new mpr.py tool, based on pyboard.py with the XBEE 3 and it is working very well. For mpr.py you have to update pyboard.py too.
mpr.py: https://github.com/micropython/micropyt ... 6375/files
pyboard.py: https://github.com/micropython/micropyt ... pyboard.py

Re: pyboard tool error

Posted: Wed Nov 11, 2020 8:54 am
by manos
Hi,

I am having some trouble in installing mpr.
My attempt is:
python3 -m pip install mpr
(in xubuntu)
and I get:
Collecting mpr
Could not find a version that satisfies the requirement mpr (from versions: )
No matching distribution found for mpr

Do you have any thoughts?
Thanks for your patience and help!

Re: pyboard tool error

Posted: Wed Nov 11, 2020 9:33 am
by jimmo
manos wrote:
Wed Nov 11, 2020 8:54 am
python3 -m pip install mpr
mpr isn't a pypi package, so you won't be able to install it with pip.

It's still in development, and the PR hasn't been merged yet. As roberthh said, it's available at the in-progress PR here: https://github.com/micropython/micropyt ... 6375/files

Re: pyboard tool error

Posted: Wed Nov 11, 2020 12:42 pm
by Roberthh
You can just download or paste the files from the links I gave. It is just the two files which you need.

Re: pyboard tool error

Posted: Wed Nov 11, 2020 2:09 pm
by manos
Thank you both for your replies!

Just because I am a noob.
Do I download them somewhere specific?
Then, do I import it or call it somehow through pyboard?

Thanks in advance

Re: pyboard tool error

Posted: Wed Nov 11, 2020 3:17 pm
by Roberthh
You can paste/copy the files from the mentioned links into a text editor and store them as pyboard.py and mpr.py in the same directory. Then you can alwas start them with

python3 mpr.py argument(s)
or
python3 pyboard.py argument(s)

On Windows, it may be just python. On Linux/Mac, if you have set the executable flag, you can also start it with:

./mpr.py argument(s)
or
./pyboard.py argumet(s)

Re: pyboard tool error

Posted: Thu Nov 12, 2020 8:41 am
by manos
Thanks for the clarification!

Pyboard seems to work fine!
Mpr gives me some trouble time (i.e when I try to connect to the REPL, it just returns:
Connected to MicroPython at /dev/ttyUSB0
Use Ctrl-] to exit this shell
but gives no prompt and it seems that no matter what I type, I cannot make it show me a prompt or what I type or execute a command.

Anyway, I guess I will have to experiment a little bit (maybe try specify the baud rate).
Thank you for your help

Re: pyboard tool error

Posted: Thu Nov 12, 2020 9:20 am
by Roberthh
If you look into the PR at https://github.com/micropython/micropython/pull/6375, there are some examples of using it.