SOLVED: Node-Red serial I/O
Looks simple doesn’t it – tie RX and TX together on your Raspberry Pi and press the button – text comes out of the other end – except that it doesn’t. More likely the Pi will CRASH (not something you see every day).
Serial out seems fine – no error messages, you can change baud rate and according to my scope, all is fine on pin 8 of the RPi2. Input on the other hand, can cause interrupt issues, messages on the console and crashing – and almost never actually produces any output.
So what is the problem?Well, one of the guys at the Node-Red forum set me onto this link. http://jeelabs.org/2012/09/20/serial-hookup-jeenode-to-raspberry-pi/
And therein lies the problem – by default – the RPI uses the serial port for communications. Trying to add another hook to the serial in interrupt – kills the Pi.
The solution is simple – extracted from the above link.
- edit the file /etc/inittab as root (I used “sudo vi /etc/inittab”)
- change this line:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100to
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100. I.e. comment it out, and save these changes.
- run the command “sudo kill -1 1” to pick up these inittab changes
And that – was that – I now have comms in and out – the idea being to put a serial display such as the NEXTION onto the Pi with simple touch input commands – and an output display showing status, temperature etc. DODDLE in Node-Red once you have serial up and running.