Page 2 of 2

Re: Control a pyboard by another pyboard over UART

Posted: Tue Jan 25, 2022 2:21 pm
by zaord
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 ?

Re: Control a pyboard by another pyboard over UART

Posted: Wed Jan 26, 2022 7:04 pm
by pythoncoder
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)

Re: Control a pyboard by another pyboard over UART

Posted: Wed Jan 26, 2022 9:09 pm
by zaord
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 ...