-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identify each Firmata-flashed board with a unique name #471
Comments
The protocol supports several MCU architectures by default. The reason each board is not uniquely identified is this does not scale well and would be a huge maintenance issue. See boards.h for all of the currently supported architectures. Each board reports its features using the capability query. Also, Firmata is not engineered for use in "industrial environments", as an open source project, it's "use at your own risk". |
There is also a simple solution to what I believe you are trying to accomplish, that is to name the .ino file something unique for each board. So rather than StandardFirmata.ino, name the sketches: "boardA.ino", "boardB.ino", etc. There is no way to name the serial port from the code running on an Arduino that I'm aware of so, you'd have to attempt to make a connection on each serial port, and if a board running Firmata is found, then you can get the exact board based on what you named the .ino file. |
I think you have misunderstood me a bit. My suggestion has nothing to with the fact, how many kinds of board Firmata supports. (Which is extremly cool by the way 🥇 )
This solution sounds interesting! :) |
Use the query firmware command as described here. |
@PizzaProgram Jeff's suggestion works well. I had a project that used multiple boards of the same type (Uno's). Renaming the sketch allowed me to sniff out which board I had connected to at each address. |
@soundanalogous You are right, it's already done! I was "knocking on opened doors". Something like: Now I have to find a way to turn this into a REAL example, how to do it from Node-Red. |
@dtex Many thanks for the feedback! |
I can't help with node-red, but with firmata.js you just check the |
After 2 years I still couldn't find any standard solution for naming the boards before flashing and searching for unique names to identify which board is at which usb/ip.
At sample .INO files there should be something like this at the beginning:
#define FIRMATA_UNIQE_BOARD_NAME "nano_b126_living_room_temp"; // <<-- RENAME this before flashing !!
...
And the identification could be something like:
string USBport = firmata.SearchSerialPortbyName("Mega36_basement");
So it would be nice to have a "built-in" simple search algorithm to help implement this basic feature to each programming language adapting Firmata.
Already a simple "readout", like:
if (firmata.ReadBoardName() != "b123_garage_door_relay") return;
would help a lot to prevent any accidents.
Why is this great protocol supports only 1 board by default?
Mixing up a board with others, if the USB port or IP number changes makes this protocol dangerous to use at real life or industrial enviroments.
The text was updated successfully, but these errors were encountered: