Teensy Radio Mesh - Best way to flash multiple boards?

Status
Not open for further replies.

paulynomial

New member
Hey y'all!

I'm starting work on building a mesh network of Teensy 4.0 controllers, coordinating over HC-12 RF transceivers. Each controller will be driving around 1000 LEDs with a few different pattern expressions and will have to sync up to coordinate patterns. The network will be decentralized by design (nodes leaving and entering the mesh is a first-class priority) so I'm thinking this could be an interesting place to apply the Raft Consensus Algorithm for facilitating leader elections and replicating lighting state-machine logic for synchronizing lighting patterns.

Anyway, getting started on prototyping the first couple of nodes but have been having a bit of a hard time writing code to multiple Teensys connected to my computer at once. I'd like to be able to deterministically target programming one controller as well as program all controllers at once. The board device path remains consistent across flashes/reboots (e.g.- /dev/ttyACM0) and was thinking about modifying the teensy_loader_cli to accept arguments like this. Is this overkill? Am I approaching this the wrong way? Is there an easier way?

Let me know if any of y'all have had success with something like this in the past or have thoughts about possible paths forward. I'm also happy to hear any comments or advice around the project in general!

Happy hacking,
paulynomial
 
Perhaps tycommander could offer some of the functionality your looking for.

Oh this looks perfect! Thank you so much!

You can manage multiple devices connected simultaneously, tycmd (and the other TyTools) uniquely identifies each device by its position in the host USB topology. Meaning if it stays on the same USB port, it is handled as the same device. That's necessary because across reboots and resets, Teensies look completely different to the host.

To target a specific device, use tycmd <command> --board "[<serial>][-<family>][@<location>]". serial is the USB serial number, family is the board family name and location can be the virtual path computed by tycmd (see tycmd list) or an OS device path (e.g. /dev/hidraw1 or COM1). Any of them can be omitted. See the examples in the table below.

https://koromix.dev/tytools
 
Status
Not open for further replies.
Back
Top