Slave board REPL on UART?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
lofer
Posts: 13
Joined: Tue Mar 31, 2020 5:17 am

Slave board REPL on UART?

Post by lofer » Fri May 07, 2021 11:40 am

I want to control second pyboard from another pyboard. Is it possible to access REPL of the second one on REPL of the first one, second connected via one of UARTs I suppose? If yes, how to get it? :D

To make things more clear. When I am on the first board I want to do something like this:

Code: Select all

>>> import pyb
>>>  [here i want to type: import pyb on board 2]

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Slave board REPL on UART?

Post by dhylands » Fri May 07, 2021 5:09 pm

You could setup the second pyboard to put its REPL on a serial port (using uos.dupterm) and connect that serial port to a serial port on the first pyboard, and then run a little terminal program on the first pyboard.

The terminal program would basically read from stdin and write to the serial port (and probably also stdout so that you have some echo) and read from the serial port and write to stdout.

I think you could do this with uasyncio, but I haven't tried.

lofer
Posts: 13
Joined: Tue Mar 31, 2020 5:17 am

Re: Slave board REPL on UART?

Post by lofer » Sat May 08, 2021 2:49 am

First part is easy, thanks :)

Has anyone using such a program from the second step by any chance and can share? :?: :roll:

Jackli
Posts: 80
Joined: Thu Apr 29, 2021 9:11 am

Re: Slave board REPL on UART?

Post by Jackli » Fri May 14, 2021 2:36 am

It would be a great help if there could be programs to share.

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

Re: Slave board REPL on UART?

Post by pythoncoder » Sat May 15, 2021 4:26 pm

This is only likely if someone else saw the same need and has written and tested a solution. Otherwise it's time to roll up your sleeves and get coding I'm afraid ;)
Peter Hinch
Index to my micropython libraries.

Post Reply