Node-red-node-serialport 1.0.3

I have been using this node for a couple of years using Node Red 2.2, and Version 0.11.0 for this node. It runs on a RPI3 / Buster and in a docker container on IOTStack.

Upgrading to Node Red 3.02, and the latest Serialport version of 1.0.3, and it no longer connects - I get a greyed out "not connected".
If I downgrade the Serialport to 0.15.0, it works again provided I add the serial port mapping in the Docker-compose file. It continues to work on Bullseye too.
I believe this is an issue with this version - 1.03.

For your reference.
In my ubuntu16.04.7LTS, nodered 3.0.2, and node-red-node-serialport 1.0.3. They work fine.

node-red-serialport 1.0.3 uses the popular serialport package ^10.5.0.

The serialport package has a long history of shipping incompatible binaries for Alpine (docker) since v10.

node-red-serialport 0.15.0 uses serialport ^9.2.5 - where they did not ship broken binaries for Alpine.

That 's why, if you are not using virtualisation layers like Alpine (docker) you have no problem.

But there is a fix:

install the latest serial port node

THEN

Within the dockers terminal - what I mean but that, is a terminal that lives INSIDE the docker image (I don't use docker so not sure what the correct term is)

run the following from what would be the users Node RED home directory (normally .node-red)

npm rebuild --build-from-source

this will re-compile serialport ^10.5.0 for the environment this command is run from.

Working with the serialport package my self in my projects - I still have nightmares about the issues raised when my users were using Docker

I tried your suggestion by adding npm rebuild --build-from-source to the Docker file with user Node_red but there was a long list of missing items with nodered_list_installed_nodes and there was the same segmentation fault.
I have rolled back to Serialport 0.15.0 and it's working again.
I am thinking 'Not to mend what's not broke', I might try to move the serial device onto an ESP8266 and then just use MQTT to harvest the data, if the serialport is so fussy.

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