Dear Node-Red-Community,
I am trying to make a simple flow with one inject and one serial-out node. But there is no data output on the GPIO14 (TXD0).
I know that my UART port works. I tested it with python. The only difference is that the port name used in python is “/dev/serial0”, while in Node-Red it is “/dev/tty1”.
First I tried to use also in Node-Red “/dev/serial0”, but the debug-info told me that:
“Error: Serialport /dev/serial0 not open.” Every time a message was send by the inject-node.
So I tried “/dev/tty1”. Because in my cmdline.txt stands this:
dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
By using the port name “/dev/tty1” I get:
[info] serial port /dev/tty1 opened at 115200 baud 8N1
But no message at the output…
I also tried to install node-red-node-serialport 0.3.0 explained here http://flows.nodered.org/node/node-red-node-serialport
But still no output…
My System Information’s are
[info] Node-RED version: v0.14.3
[info] Node.js version: v0.10.29
[info] Linux 4.4.13-v7+ arm LE
Raspberry Pi 3
So does anybody know:
Why is there no output data?
And
Why does Node-Red can open /tty1 but not /serial1?
Many thanky in advance!
Nikola
BTW:
inject node: [{"id":"df2058f3.62dca8","type":"inject","z":"54775c9b.92d704","name":"","topic":"","payload":"test","payloadType":"str","repeat":"0.1","crontab":"","once":false,"x":670,"y":180,"wires":[["8458c8f0.838f88"]]}]
serial node:
[{"id":"8458c8f0.838f88","type":"serial out","z":"54775c9b.92d704","name":"","serial":"2ecdb484.25cea4","x":960,"y":180,"wires":[]},{"id":"2ecdb484.25cea4","type":"serial-port","z":"54775c9b.92d704","serialport":"/dev/tty1","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"4","bin":"false","out":"count","addchar":true}]
To Disable Serial Port Login
You need to edit two files in order to use the serial port with your own programs.
When the Raspberry Pi boots, the bootup information is sent to the serial port. You can disable this by editing the/boot/cmdline.txt file
The contents of the file look like this
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Remove all references to ttyAMA0 so the file looks like this:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Save the file to save your changes.
The second file to edit is /etc/inittab
Edit using: sudo nano /etc/inittab
The /etc/ inittab file has the command which enables the login prompt which needs to be disabled.
Near the end of the file will be a line similar to this:
respawn:/sbin/getty -L ttyAMA0 115200 vt100
Disable this line by adding a # character to the beginning.
#respawn:/sbin/getty -L ttyAMA0 115200 vt100
Save the file.
You should then reboot your raspberry pi with the following command
sudo shutdown -r now
You can now use your serial port with other applications on your Raspberry Pi.
See explanation here, https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=123081
Under Raspbian Jessie, you can use:
- CODE: SELECT ALL
sudo raspbian-configThen choose "Advanced Options", then "Serial" and answer "No" to the question "Would you like a login shell to be accessible over serial?" However, this also removes the /dev/ttyAMA0 device.