How To: Using PFC200 Onboard Serial Port with Node-RED

How to use the onboard serial port of a PFC200 with Node-RED running on Docker.

HowTo PFC200 Serial on Node-RED.pdf (2.8 MB)

4 Likes

To change the serial port mode you can use the command line tool found in /etc/config-tools directory called set_serial_mode.
cd /etc/config-tools/
To use RS485 (default):
./set_serial_mode rs485
To use RS232:
./set_serial_mode rs232

image

2 Likes

hi kurt, rs232 didnt work to me, im trying to use serial port node, but when i deploy the flow, node-red closes and then its impossible to restart node red container

Same thing I explained here? I tried to restart, reboot, created new containers, reset everything to factory settings, tried 3-4 different ways to run the docker container. No matter what I’ve tried node-red still crash when using serial nodes.

https://www.wago.community/t/using-rs485-port-on-cc100-with-nodered/202/7?u=stefsoma

Here is a possible fix:

  • I you don’t have Portainer:
    Login in the CC100 with SSH then go to elevated user by using the command su -
    Then use the command docker exec -ti --user root <containername> /bin/bash to open the container console as root.
  • If you have Portainer, use it to log in the container console in root.
  • In the container console, go to the node-red data folder cd /data/
  • Execute the command npm rebuild --build-from-source

This will rebuild the serial node from source to the specific of the CC100 system.

1 Like

@WagoIcard Thank you so much! I can confirm it helped in terms of stopping node-red from crashing. Tried so install serialport pallet and use a serial in node, crashed again. Guess I just have to rebuild again. Not able to read anything from the modbus node, but I assume that’s another issue :slight_smile:

This bug of the serialport library is known and should be fixed in the latest version (according to the Github notes).
I just hope this will work and be also updated in the different nodes using serialport.
unfortunately this bug is present in the all ARM architecture 32Bit (PFC, CC100, rPI, etc …).
What was the last crash log file ?

i solve it in a pfc200 i uninstalled the serialport node, and installed an old version (0.15.0)

Is it possible to use serial port in Node-RED while keeping PLC Runtime in use? In all tutorials it is mentioned that runtime must be set to “none”…

There is a need to use PLC Runtime in parallel with Docker+Node-RED. Serial port would be used only in Node-RED.

Yes you can, just make sure there’s no concurrent access to the same ressource (the serial interface or the k-bus)