[Announce] node-red-node-Arduino (Firmata) remastered `v1.3.3`

... after 1+ month (200+ hours of time investment), I proudly present:

The first stable version of Arduino / Firmata module.

Currently it can be downloaded from: here v1.3.3. I'm planning to create a pull request too.

The 1.1 version currently available for download at npm + Github is:

  • not working in many ways,

so I had to rewrite it (almost) completely. (ca. 70 lines left untouched from 770.) The whole process of it is: here...

What changed:

  1. "max pin" problem solved. Now works again with Raspberry Pi - Pico (+ESP32) boards too!

  2. analogue pin checking! (NR crashed before)

  3. more help added to html = setup panels

    • number inputs for pin instead of text,
    • min-max,
    • added more tips & warning,
    • etc...

  1. msg.payload = "reset" >> resets board (more later...)

  2. added many else and constants to speed up execution

  3. renamed variables to be unique. Like: node -> brdNode, nodeIn, nodeOut

  4. added error handling for unhandled errors

  5. changed var to let everywhere

  6. added emit -> to immediate auto-update all in/out nodes
    if master-board state changed !

  7. created clear status definitions. + according visual colour + text status for each

  8. added "sampling interval" (more later ... )

  9. added: log2consol checkbox (setup)

  10. Deploy works !

  11. Partial deploy works also!! :1st_place_medal:
    Even changing 1-1 pin during run without stopping or restart.

  12. msg.payload null warning for Out-node input

  13. added new Out-node types: [RESET, INTERVAL]

  14. Event / emit exceed limit problems of v1.1 solved!

  15. Added: Name config for better naming / label showing

  16. can handle "no board" / "no com set" / "no pin set"

  17. endless "board-search" animation probably solved. (need testing!)

  18. Auto-timed connect retry (100ms - 10sec increasing)

  • so if board gets only later plugged in (after start) >> it works too!
  1. auto-pin-conflict search and show system
  2. version is shown at in+out config panel

+ all kinds of bug fixes ...

About Sampling-interval:

A value of millisecond between 10-65500 can be set ! :+1:

  • Both at startup on the Arduino setup panel,
  • and at runtime via msg.payload = 500 if node-out Type is set for this.

This will reduce or increase the speed, how (analogue) data will flow (if changed).
This is a global value. So individual pins can not be set differently at Firmata firmware.
Default value is now changed from 19ms to: 200ms, because even my high speed laptop could not handle the amount of debugs showing even for 1 pin.

  • 200ms => max 5 message will be sent pro second, if value changes
    (for each analogue pin you subscribed for).

About board-reset:

This function has 2 purpose:

  1. it will stop sending analogue values + will set all output pins to default LOW
  2. helps after restart, because the board can be re-attached to NR.

Note: it happens very fast. So if there is only a "LED blink", you will hardly notice anything, because "output" will work again after a few milliseconds.
Analogue read (and maybe digital in too!) will stop completely until flow restart.

Two ways to do it:

  1. Set Arduino-out node to: reset + send a: msg.payoload = true or 1
  2. Send msg.payload = reset to any "Out" node.

Try it yourself, and leave a comment!

3 Likes
  1. Fixed some sentences at HTML + Readme.md + Help
    (could not figure out, how to embed active URL links into help)
  2. Deleted half of the tips visible up here, as @dceejay requested at his PMs
  3. Log to console default is: OFF (unchecked)
  4. changed version number to: 1.3.3-20250330 (from ..0329)
  5. added help to "Arduino out" node too !
  6. uploaded and requested a Pull at github.

Very bad news:

Just tested:

  • if sampling interval is set to a high value (eg. 2000ms)
  • short pressing digital input will not work!

I wrote to all the help files explanations sentences which suggests: it only affects the analogue ports.

I will open an issue at Configurable-Firmata firmware page, maybe there is a workaround?

Auto-port-search finally fixed!

  1. had to rewrite both (html+JS) functions to async !
  2. added try-catch for error handling
  3. response naming changed to path ! (had to debug for hours...)
  4. added logs to both browser's console & node-red-log (console)
Available Ports: [
  {
    path: 'COM3',
    manufacturer: 'Microsoft',
    serialNumber: '6&35CA52AB&0&0000',
    pnpId: 'USB\\VID_2E8A&PID_00C0&MI_00\\6&35CA52AB&0&0000',
    locationId: '0000.0014.0000.001.000.000.000.000.000',
    friendlyName: 'Soros USB-eszköz (COM3)',
    vendorId: '2E8A',
    productId: '00C0'
  }
]