Control a pyboard by another pyboard over 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.
zaord
Posts: 96
Joined: Fri Jan 31, 2020 3:56 pm

Re: Control a pyboard by another pyboard over UART

Post by zaord » Tue Jan 25, 2022 2:21 pm

I don't really understand the pyb.repl_uart() function.

I would like to execute the basic summ opération (2+1) on a pyboard 2 through uart from a pyboard 1 script.

I tried this :

On the pyboard1 :

Code: Select all

import pyb
repl_uart = pyb.UART(4, 115200)
repl_uart.write("1+2") # the to execute
On the pyboard2 :

Code: Select all

import pyb
repl_uart = pyb.UART(4, 115200)
pyb.repl_uart(repl_uart)
But nothing happends :)
What is the problem ?

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

Re: Control a pyboard by another pyboard over UART

Post by pythoncoder » Wed Jan 26, 2022 7:04 pm

The following will cause the REPL to become available on UART 4.

Code: Select all

import pyb
uart4 = pyb.UART(4, 115200)
pyb.repl_uart(uart4)
Peter Hinch
Index to my micropython libraries.

zaord
Posts: 96
Joined: Fri Jan 31, 2020 3:56 pm

Re: Control a pyboard by another pyboard over UART

Post by zaord » Wed Jan 26, 2022 9:09 pm

Ok, this i understood, but if I do that on the two pyboard, then they reset both.
I tryied to do a simple opération from one pyboard to onother but nothing works from what I tryied...
I don't know how to send request to the pyboard with uart on the 4 uart port after activate it ...

Post Reply