# Arduino Node Sketch Compatibility

**URL:** https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935
**Category:** General
**Created:** [16 March 2022 16:35 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935 "2022-03-16T16:35:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![rayank97](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@rayank97](https://discourse.nodered.org/u/rayank97)
#### Post date: [16 March 2022 16:35 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/1 "2022-03-16T16:35:19Z")

</div>

Hello everyone. I've been successfully using the Arduino node until now. I have a query regarding its compatibility.

Does the Arduino node only work with the StandardFirmata/StandardFirmataPlus sketches loaded onto the Arduino board, or does it work with the other Firmata sketches (AnalogFirmata) as well?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [16 March 2022 21:34 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/2 "2022-03-16T21:34:05Z")

</div>

yes is only supports the standard firmata. Most often people find it almost as easy to write their own application specific Arduino code and then send direct via generic serial or ethernet, etc.

---

<div class="post-metadata">

### Author: ![rayank97](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@rayank97](https://discourse.nodered.org/u/rayank97)
#### Post date: [17 March 2022 16:16 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/3 "2022-03-17T16:16:35Z")

</div>

Thank you. I guess I'm going to try Serial then. Is serial communication as effective as Firmata in terms of speed of sending data?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [17 March 2022 18:37 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/4 "2022-03-17T18:37:35Z")

</div>

Yes. Firmata is just using the same serial connection after all.

---

<div class="post-metadata">

### Author: ![PizzaProgram](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pizzaprogram/32/19431_2.png) [@PizzaProgram](https://discourse.nodered.org/u/PizzaProgram)
#### Post date: [17 March 2022 19:08 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/5 "2022-03-17T19:08:16Z")

</div>

> Is serial communication as effective as Firmata in terms of speed of sending data?

Firmata is limited to ca. 56000 bit/sec. And it has lot's of overhead, because it's using a [MIDI standard](https://en.wikipedia.org/wiki/MIDI) to communicate.

Serial speed can be set as you wish.

- You can start with "standard" 115000 baud,
- or higher = 1Mbit
- or even reduce it for long distance cable (30-1200m) to 9600 baud.

What many people forget to set:

- parity &
- flow control

Personally I like "xOn/xOff" flow control + "Even" parity bit set, because it worked best in "electrical noisy" environment (pizza kitchens) while I was using Serial-POS-printers 10-20 years ago.

I also recommend (and really, I'm shocked, why nobody does) to start the communication with a specific identification string. Like a **"board name"** or "serial-number".

Why?

- Because whenever you plug your Arduino into a different USB \> it will change the path to that device.
- So if you are using other things too, or more of the same board, they can accidentally mixed up!

If this is only a "hobby project", than it does not matter. But in real life scenarios:

- Imagine you are trying to switch a light bulb at Pin7 \>\>
- but an other board is responding and may cause and accident. _(Like cutting off a head of a baby under a roller shutter or exploding the heating system...)_

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [17 March 2022 20:21 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/6 "2022-03-17T20:21:09Z")

</div>

> [@PizzaProgram](#):
>
> whenever you plug your Arduino into a different USB \> it will change the path to that device.

A good way to avoid that is to access it via `/dev/serial/by-id`. If you run  
`ls /dev/serial/by-id`  
you should be able to see the device. For example a usb serial device might appear as:

```auto
ls /dev/serial/by-id
usb-1a86_USB2.0-Ser_-if00-port0

```

Then in the serial node you can use  
`/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0`  
Usually that is a unique name that does not change if the device is unplugged and plugged back in again, wheres in that situation it might well move from `/dev/ttyUSB0` to `/dev/ttyUSB1`

---

<div class="post-metadata">

### Author: ![PizzaProgram](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pizzaprogram/32/19431_2.png) [@PizzaProgram](https://discourse.nodered.org/u/PizzaProgram)
#### Post date: [20 March 2022 11:53 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/8 "2022-03-20T11:53:20Z")

</div>

> [@Colin](#):
>
> A good way to avoid that is to access it via `/dev/serial/by-id`

Yes, that is true (and I know about it) but:

- What about Windows + iOS ?
- How can you prevent such accidents, if the programmer does not take responsibility to put +2 lines in the code?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 March 2022 12:33 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/9 "2022-03-20T12:33:09Z")

</div>

> [@PizzaProgram](#):
>
> What about Windows + iOS ?

No idea, sorry. Don't use them.

> [@PizzaProgram](#):
>
> How can you prevent such accidents, if the programmer does not take responsibility

Any system that, if it goes wrong, can cause injury or significant damage _must_ have multiple independent safety controls, so that no one fault can cause the problem. In fact in the case of serious injury then probably there should be more than two independent systems. In the case of the boiler exploding then there should be (and certainly will be in any correctly installed system) safety valves that open in the case of overpressure. Mine has at least three such safety valves I think.  
Another example with less serious consequences is my home heating control system. I have left in all the standard systems (room stats and so on) and added mine in such a way that that any fault in my part of the system should do no worse than leave the heating off, or fall back to using the room stats, which are set a little higher than the normal room temperature that my system controls.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [3 April 2022 12:33 UTC](https://discourse.nodered.org/t/arduino-node-sketch-compatibility/59935/10 "2022-04-03T12:33:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
