I require assistance to debug a problem I've encountered when using the serial port nodes.
My ultimate goal is to create a UPB to MQTT converter (Universal Powerline Bus; a lighting-control protocol). However, it's early days and at the moment I just want to establish serial communications between Node-RED and the UPB PIM (Powerline Interface Module a.k.a. CIM=Computer Interface Module; RS232 to UPB interface device).
Full details about the hardware and software versions being employed will follow my description of the problem. In a nutshell, the flow can either receive serial data or transmit it but it can't alternate between the two without first resetting the serial-in node.
Testing procedure
After confirming the flow receives UPB messages from the PIM (via the serial-in node), sending a UPB message (via the serial-out node) will cause the serial-in node to cease receiving all additional messages. In addition, the transmitted message is not received by the PIM.
To clear it up, I need to reset the serial-in node. The procedure I use is (discovered empirically):
- switching its configuration to use a spare, unused serial port (
/dev/ttyUSB0
) - deploying the flow
- switching its configuration back to the desired serial port (
/dev/ttyUSB3
) - re-deploying the flow
If, after resetting the serial-in node, I immediately proceed to send a UPB message via the serial-out node, it is successfully transmitted to, and received by, the PIM (and all subsequent transmitted messages). However, this will cause the serial-in node to "go deaf" and fail to receive incoming UPB messages.
To summarize, after resetting the serial-in node, you can either:
- Receive UPB messages (as long as you don't transmit one).
- Transmit UPB messages (but now you won't be able to receive any).
Any insight into the likely cause of this behavior would be greatly appreciated.
Screenshot of the flow
Screenshot of the serial port settings
Software
- Raspbian Stretch (with latest updates)
- Node-RED 1.0.3
- node-red-node-serialport 0.10.0
- nodejs 12.13.1
- npm 6.12.1
Hardware
- Raspberry Pi 3B+
- Digi Edgeport/4 (4-port USB to Serial converter)
- Simply Automated UPB-PIM (RS232 to UPB interface module)
EDIT
In case someone may thinking "Maybe this PIM gadget can't 'walk and talk' at the same time!", rest assured it can definitely handle bi-directional communications. There are several UPB software interfaces implemented in python, nodejs, Java, c++, etc and all are able to alternate between sending and receiving data with the UPB-PIM.