Page 1 of 1

pyboard issue from jetson nano to LEGO 51515

Posted: Fri Apr 09, 2021 5:34 am
by hmikelee
Dear all,

Seeking help on using pyboard class from jetson nano to LEGO 51515 through Bluetooth

I can use terminal emulator picocom to connect to LEGO 51515 from jetson nano through bluetooth, enter raw REPL mode and execute a simple test python script without problem.

When I use pyboard class in pyboard.py to execute the same script in a jupyter notebook environment, not every command in the script can be executed properly. I noticed that only the beeps works properly, all the motor related command were executed and reported OK, but the motor did not move. For color sensor, I always got back the error message 'No Color sensor on port C'

Any direction on debugging this issue will be highly appreciated.

hmikelee

Re: pyboard issue from jetson nano to LEGO 51515

Posted: Fri Apr 09, 2021 11:54 am
by aivarannamaa
I don't have this device myself, but a Thonny user also reported problems with it and the error message was somewhat similar (https://github.com/thonny/thonny/issues/1702). Perhaps LEGO's MicroPython has some quirks.

I'd be happy if you tried connecting to your hub via Thonny (https://thonny.org):

* Run => Select interpreter => MicroPython (generic)
* Select your port => OK
* Try entering commands into shell, showing variables (View => Variables) and files (View => Files) and editing a file (double click on a file in the lower part of the file browser).

Re: pyboard issue from jetson nano to LEGO 51515

Posted: Fri Apr 09, 2021 2:54 pm
by jackyjoy123
thanks my issue has been fixed.

Re: pyboard issue from jetson nano to LEGO 51515

Posted: Sat Apr 10, 2021 6:31 am
by hmikelee
Dear Jackyjoy123,

Will you be kind to share the solution for your issue.

Thank you

Re: pyboard issue from jetson nano to LEGO 51515

Posted: Sun Apr 11, 2021 8:45 am
by hmikelee
Dear all,

I think I solved this problem :) :) :)

2 code modifications for the standard pyboard class
(1). use 1 ctrl-C instead of 2 to interrupt the default running program
(2). soft reset ctrl-D in enter_raw_repl() causes some problems. I change it to ctrl-B and then ctrl-A again to go into raw REPL mode

Recent tests look ok

Will post the modified pyboard class in github later

Thank you all for your responses. Highly appreciate you take the time to look at this problem

hmikelee