... 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:
-
"max pin" problem solved. Now works again with Raspberry Pi - Pico (+ESP32) boards too!
-
analogue pin checking! (NR crashed before)
-
more help added to html = setup panels
- number inputs for pin instead of text,
- min-max,
- added more tips & warning,
- etc...
-
msg.payload = "reset"
>> resets board (more later...) -
added many
else
and constants to speed up execution -
renamed variables to be unique. Like: node ->
brdNode
,nodeIn
,nodeOut
-
added error handling for unhandled errors
-
changed
var
tolet
everywhere -
added emit -> to immediate auto-update all in/out nodes
if master-board state changed ! -
created clear status definitions. + according visual colour + text status for each
-
added "sampling interval" (more later ... )
-
added: log2consol checkbox (setup)
-
Deploy works !
-
Partial deploy works also!!
Even changing 1-1 pin during run without stopping or restart. -
msg.payload null warning for Out-node input
-
added new Out-node types:
[RESET, INTERVAL]
-
Event / emit exceed limit problems of v1.1 solved!
-
Added:
Name
config for better naming / label showing -
can handle "no board" / "no com set" / "no pin set"
-
endless "board-search" animation probably solved. (need testing!)
-
Auto-timed connect retry (100ms - 10sec increasing)
- so if board gets only later plugged in (after start) >> it works too!
- auto-pin-conflict search and show system
- 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 !
- 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:
- it will stop sending analogue values + will set all output pins to default LOW
- 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:
- Set Arduino-out node to: reset + send a:
msg.payoload = true or 1
- Send
msg.payload = reset
to any "Out" node.
Try it yourself, and leave a comment!