Writing here to discuss a project idea. Wondering:
- does it already exist?
- is it feasible?
- would it be useful (and/or what would make it more useful)
The idea
A device with microcontroller (maybe mega2560) connected to a support circuit which allows some kind of switching between a large number of heterogous arduino dev boards (each serving heterogenous purposes).
Use case example
Example project 1: a fancy robot having many microcontroller subsystems
This project might have separate microcontrollers for each leg and for each arm, separate controllers for various sensor banks, and other controllers for coordination
Example 2: a boat automation system
This project might have separate microcontrollers associated with engines, anchor, plumbing, lighting, situational awareness sensors, etc
In both of these examples, I can imagine wishing to have a reliable and simple way to do things like: identify or update the firmware running on a particular subsystem, view recent Serial output (serving as an inexpensive and simple troubleshooting log), possibly even arbitrarily connect a debugger to an individual controller
Design principle
The device would act as a proxy for development operations, as a logger, and would help with the organizing and identification of subsystem names/roles and allow reliable connection to each. The device would keep track of each connected subsystem microcontroller and call that a "node". The 'supersystem' consisting of "the device" plus all of its connected nodes would be relatively static, but it should not be terribly difficult to add a new node (e.g. if you've just decided to add a new subsystem into your robot).
-
nodes are associated with specific microcontrollers via some reliable mechanism, either mechanical (each node is consistently plugged into 'device' using the same port) or via auto-detection of some unique property (???) or possibly using some kind of manual association procedure (e.g. when a a new node is connected, you immediately configure that node's params, such as name, role, etc.). The association mechanism must be able to survive power resets on subsystems (obviously)
-
"the device" can keep track of a library of firmware images (stored on external mass storage) and automatically orchestrate these being accurately flashed onto nodes as appropriate. Firmwares can be addressed individually to nodes or perhaps to node type (role). Multiple versions can exist at once and it should be easy to instruct the device to rollback to previous versions (e.g. "leg software rev 54 isn't working, switch back to rev 53")
-
Serial output from each node is continuously and reliably recorded to mass storage. Each output item is (obviously) associated correctly with its node/role and as a bonus, gets a timestamp prepended to each line. Live access can be gained at any time, allowing the user to easily peek at the current output from any particular node (e.g. "right now, the left leg controller is reporting joint angles: 53, 39, and 62")
Design details
The software
Depending on the feature set (do we try to allow remote access? provide some kind of FTP or web server interface?) I am confident that the high level software should not prove too great a task. It will consist of the orchestration of a few things: mass storage, a few buttons, a simple display and communication 'mux' system.
The hardware
I've brainstormed a few different approaches to take here:
-
nodes will connect via USB. My device will be a USB host connected to a large USB hub which will in turn connect individually to each node device. Total price: one strong microcontroller + one good hub + one USB cable per node
-
nodes connected via "a couple of wires". Wires are "ICSP"? Is this some kind of rs232 connector maybe? In this version, (fairly complicated) support circuitry is built which provides for: UART, rx and tx buffering, appropriate signaling for invoking dev board reset (ie RTS) and this circuitry is repeated and 'mux'd together somehow as many times as needed (eg 8 times, 30 times, etc). Via an external SRAM or something and some kind of DMA-type process, the external circuitry pushes RX data into large buffers and possibly even straight to mass storage. This takes burden off of "the device" controller, allowing it to keep up with a large number of nodes. I've done some research into ICs and chips on digikey - this approach looks fun but crazy, but probably doable....
Total cost: one fast microcontroller, one rs232 cable per node, support circuitry UART,etc (maybe $2-10) per node -
use mega2560, which provides 4 uarts. Chain multiple devices together to get desired total number of nodes. e.g. to support 30 nodes, I'd implement "the device" through the coordinated efforts of 30 / 4 = 8 mega2560s.. Total cost: number of nodes / 4 * $25
EDIT, adding #4.:
- give each 'node' board some kind of inexpensive bus-oriented adapter other than USB such as CAN bus or RS485. Then, put my "magic device" on that bus too and handle messages from there. Similar to approach #1 but favoring a less-complicated and less-expensive bus protocol instead of USB.
If you've read this far, thank you for your time and interest!
I'm new to the forum (and pretty new to Arduino in general). I apologize in advance for any ideas that might be naive or stupid.