Node-Red Serial Node + Pi Gateway Sketch = Awesome!

Started by noch, August 05, 2020, 08:41:52 PM

noch

Not sure if this has been covered before so wanted to share.  I have been running a python script for years that reads a Moteino with the pi-gateway sketch and publishes events over MQTT.  I was sending these to HomeAssistant and using the Node-Red plug within HA.  This worked fine but there were a lot of moving parts and I have ended up starting over many times throughout the years.

I wanted to find something more simplistic so I started with installing Node-Red directly on a new Pi4.  Turns out its really simple to read the Moteino data directly.  There is a "Serial" node that intuitively reads and writes to a serial port.  No more sending data all over the place with many points of failure.  I personally like the visual of the automatons as well.  It make troubleshooting much easier for me.

I attached a screenshot of some of the logic.


hickse

Hi, Can you share your flow?  I can't get the serial in node to the 'connected' state. I get the following error:
"[serialconfig:8a4e8a68.af71b8] serial port /dev/ttyAMA0 error: Error: Error Resource temporarily unavailable Cannot lock port"