Controlling pyboard with other pyboard

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Adixylian
Posts: 13
Joined: Thu Jan 21, 2016 7:21 pm

Controlling pyboard with other pyboard

Post by Adixylian » Sat May 27, 2017 1:26 pm

Greetings

Is it possible?
I have succesfully made UART, I2C and SPI comm with other objects, and between pyb themselves.
Now, as I am using 4 different pyboards that communicate between themselves, I have tu plug-in 4 different USBs and opet 4 repls at the same time... Is it possible to simply control pyboard with other pyboard via, for ex, UART communication?
Probably it is possible, so I need to know which protocol would be used? How does the pyb communicate via usb? So I can make the same thing via simple UART

I am talking about "virtual repl", not something like "If I raise X2 to "1", you do that. If I put "Y2" to "0", you do something else..."

Please, help me :D If I make it possible, I'll upload the class on the github
Thank you!

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

Re: Controlling pyboard with other pyboard

Post by dhylands » Sat May 27, 2017 6:25 pm

With rshell, you still need to plug in all 4 boards, but you can manipulate them all from the same rshell session. rshell has the notion of a board name, and if you create a board.py file on each board and they contain a line:

Code: Select all

name = 'name1'
then you will be able to use /name1/flash to refer to the filesystem on the name1 board.
You can still only get to one repl at a time. The repl command accepts an optional board name argument, so you can use:

Code: Select all

repl name1
to enter the repl on the name1 board.

Eventually, I'd like to revamp the underlying protool rshell uses to be more packet based, and at that time it would make sense to allow packet forwarding or something so that you could connect to a single pyboard and communicate with others.

Adixylian
Posts: 13
Joined: Thu Jan 21, 2016 7:21 pm

Re: Controlling pyboard with other pyboard

Post by Adixylian » Mon Jun 05, 2017 8:52 am

I'll give it a try, thanks!

User avatar
TravisT
Posts: 72
Joined: Sun Feb 23, 2014 2:31 pm
Location: Portland, OR
Contact:

Re: Controlling pyboard with other pyboard

Post by TravisT » Mon Jun 05, 2017 9:11 am

If you were not looking for REPL support, RS485 or CAN would be good multi-drop communication methods.
_______________
Travis Travelstead

Post Reply