I migrated my flows from node-red 0.17.x to 1.0.2 and my serial node is now behaving strangely.
When I boot up the raspberry pi (Linux version 4.19.75-v7+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1270 SMP Tue Sep 24 18:45:11 BST 2019), the serial node can't communicate with the device. It waits and then times out.
However, when I move a node and deploy, it starts working normally.
When I reboot again, same problem. Has anyone seen this?
Start node red in a terminal, then re-deploy. Post the terminal log here (copy/paste not screenshot if possible please). That is the log with the Welcome to node-RED message.
Tried to get a log showing the issue, but I can't reproduce the problem when I start from a command line. I have node-red configured to start at boot time, using this command:
sudo systemctl enable nodered.service
When I did a hard restart (power off and on), the serial port was hanging, as expected. I started a terminal session and ran "node-red-stop", then "node-red-start". The serial port problem went away.
So, I ran sudo systemctl disable nodered.service and did a hard restart. I started a terminal session, ran node-red-start, and...the serial port was working.
It seems that the only time it doesn't work is when I auto-start node-red at boot time. It's as if something isn't getting setup in time.
Yes, I looked. That error is unrelated. It happens when I run it on older versions of node-red, as well. But the serial port works on the older versions.
I'm using nodejs v10.17.0. I did a clean install of buster and then (after sudo apt update/upgrade) I ran update-nodejs-and-nodered. Is there a step that I missed?
You don't appear to have posted the relevant bit of the log. Look for the Welcome to node red message, it is from just before there, through it not working and then working after a deploy that we want.
The shutdown at 11:15 looks a bit odd, did you just power off?
I'm trying to debug this problem. I'm now using a Raspberry Pi 4 with Raspbian GNU/Linux 10 (buster) Release: 10 and node-red 1.0.2. The symptom is still that the serial node waits and times out until I move a node and deploy, and then it magically works.
I ran a couple of commands to look at the serial ports, starting with:
I'm using /dev/ttyS0 in my serial node, configured to 19200-8N1. Then I ran
setserial -g /dev/ttyS[0123]
which returned:
/dev/ttyS0, UART: 16550, Port: 0x0000, IRQ: 36
Not sure if any of that is helpful. I'm trying to get logs but I haven't found the one that contains the text that you see when you run node-red-start.