Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialport - crashes using more than three serial ports #366

Closed
soundmanuk opened this issue Oct 30, 2017 · 10 comments
Closed

Serialport - crashes using more than three serial ports #366

soundmanuk opened this issue Oct 30, 2017 · 10 comments

Comments

@soundmanuk
Copy link

I have two installations of node-red on windows machines, the serialport nodes work fine but only up to 3 com ports, 4 or more crashes node-red and loses all flows.
Have tried a usb to 4 com port cable and also virtual com ports.
Same issue on both.

@knolleary
Copy link
Member

Hi @soundmanuk

I assume there's an error message in the node-red log output that provides some details on what it is crashing with?

When you say it loses all flows ... what do you mean?

@soundmanuk
Copy link
Author

soundmanuk commented Oct 30, 2017

No error message, i add the node, configure for a fourth com port, deploy 1st time seems ok (no connected nodes), move it to re-deploy, press deploy and then the screen greys out as though its deploying the changes. at this point i have to crash out the browser and restart the service, at which point all the configs have been lost.
basically making it look like a fresh install.

@knolleary
Copy link
Member

I'm not asking about error messages in the browser. The node-red runtime will be logging its own output - where exactly will depend on how you've setup node-red to run.

@soundmanuk
Copy link
Author

30 Oct 13:49:21 - [info]

Welcome to Node-RED

30 Oct 13:49:21 - [info] Node-RED version: v0.17.5
30 Oct 13:49:21 - [info] Node.js version: v6.11.2
30 Oct 13:49:21 - [info] Windows_NT 10.0.14393 x64 LE
30 Oct 13:49:22 - [info] Loading palette nodes
30 Oct 13:49:22 - [warn] ------------------------------------------------------
30 Oct 13:49:22 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
30 Oct 13:49:22 - [warn] [tail] Not currently supported on Windows.
30 Oct 13:49:22 - [warn] ------------------------------------------------------
30 Oct 13:49:22 - [info] Settings file : c:\Users\NuffieldHealth_LBS.node-red\settings.js
30 Oct 13:49:22 - [info] User directory : c:\Users\NuffieldHealth_LBS.node-red
30 Oct 13:49:22 - [info] Flows file : c:\Users\NuffieldHealth_LBS.node-red\flows_Nuffield-LBS.json
30 Oct 13:49:22 - [info] Server now running at http://127.0.0.1:1880/
30 Oct 13:49:22 - [info] Starting flows
30 Oct 13:49:22 - [info] [udp out:36e7bbb7.87d614] udp ready: 192.168.0.20:10208
30 Oct 13:49:22 - [info] [tcp out:EDIO232 - Dry Contact DO-1] connecting to 192.168.0.100:102
30 Oct 13:49:23 - [info] [tcp out:EDI232 - RS232 Port 2] connecting to 192.168.0.100:101
30 Oct 13:49:23 - [info] Started flows
30 Oct 13:49:23 - [info] [udp in:6f648ec3.df3fd] udp listener at 0.0.0.0:10207
30 Oct 13:49:23 - [info] [tcp in:7d79e44a.2416bc] listening on port 10210
30 Oct 13:49:23 - [info] [qlab in:4cea5628.1526e8] Listener started.
30 Oct 13:49:23 - [info] [udp in:d12fbe8c.72842] udp listener at 0.0.0.0:10209
30 Oct 13:49:23 - [info] [tcp out:EDIO232 - Dry Contact DO-1] connected to 192.168.0.100:102
30 Oct 13:49:23 - [info] [tcp out:EDI232 - RS232 Port 2] connected to 192.168.0.100:101
30 Oct 13:49:23 - [info] serial port COM2 opened at 9600 baud 8N1
30 Oct 13:49:23 - [info] serial port COM1 opened at 9600 baud 8N1
30 Oct 13:49:23 - [info] serial port COM3 opened at 115200 baud 8N1
30 Oct 13:51:04 - [info] Stopping flows
30 Oct 13:51:04 - [info] [udp in:6f648ec3.df3fd] udp listener stopped
30 Oct 13:51:04 - [info] [udp out:36e7bbb7.87d614] udp output stopped
30 Oct 13:51:04 - [info] [tcp in:7d79e44a.2416bc] stopped listening on port
30 Oct 13:51:04 - [info] [qlab in:4cea5628.1526e8] Listener closed.
30 Oct 13:51:04 - [info] [udp in:d12fbe8c.72842] udp listener stopped
30 Oct 13:51:04 - [info] [qlab in:4cea5628.1526e8] Listener closed.
30 Oct 13:51:04 - [error] serial port COM2 disconnected
30 Oct 13:51:04 - [info] serial port COM2 closed
30 Oct 13:51:04 - [error] serial port COM1 disconnected
30 Oct 13:51:04 - [error] serial port COM3 disconnected
30 Oct 13:51:04 - [info] serial port COM1 closed
30 Oct 13:51:04 - [info] serial port COM3 closed
30 Oct 13:51:04 - [info] Stopped flows
30 Oct 13:51:04 - [info] Starting flows
30 Oct 13:51:04 - [info] [udp out:36e7bbb7.87d614] udp ready: 192.168.0.20:10208
30 Oct 13:51:04 - [info] [tcp out:EDIO232 - Dry Contact DO-1] connecting to 192.168.0.100:102
30 Oct 13:51:05 - [info] [tcp out:EDI232 - RS232 Port 2] connecting to 192.168.0.100:101
30 Oct 13:51:05 - [info] Started flows
30 Oct 13:51:05 - [info] [udp in:6f648ec3.df3fd] udp listener at 0.0.0.0:10207
30 Oct 13:51:05 - [info] [tcp in:7d79e44a.2416bc] listening on port 10210
30 Oct 13:51:05 - [info] [qlab in:4cea5628.1526e8] Listener started.
30 Oct 13:51:05 - [info] [udp in:d12fbe8c.72842] udp listener at 0.0.0.0:10209
30 Oct 13:51:05 - [info] [tcp out:EDIO232 - Dry Contact DO-1] connected to 192.168.0.100:102
30 Oct 13:51:05 - [info] [tcp out:EDI232 - RS232 Port 2] connected to 192.168.0.100:101
30 Oct 13:51:05 - [info] serial port COM2 opened at 9600 baud 8N1
30 Oct 13:51:05 - [info] serial port COM1 opened at 9600 baud 8N1
30 Oct 13:51:05 - [info] serial port COM3 opened at 115200 baud 8N1
30 Oct 13:51:05 - [info] serial port COM4 opened at 57600 baud 8N1

@soundmanuk
Copy link
Author

thats the log output. it just seems to hang completely.

@knolleary
Copy link
Member

In your settings.js file (c:\Users\NuffieldHealth_LBS.node-red\settings.js) can you edit the logging section and change the level to trace. That will show a bit more information around the deploy timeframe as to what its doing, and hopefully, were it has got hung.

That said, the log shows the runtime believes the deploy has completed (see the Started flows log statement), so that may not be as useful.

When its hung, can you check the process cpu usage? Is it suddenly maxed out?

@soundmanuk
Copy link
Author

Log stays pretty much the same
node-red.txt.
Processor ticks over nicely at 12%.
I did let the browser timeout and got a 'deploy failed, no contact with server' message.
tried deleting the 4th com port node and re-deploy. crashed the same and the logfile doesnt update.
have to restart the service to get it all to work again and reload the flows.

@soundmanuk
Copy link
Author

OK, I've done a fair bit more testing on this now. To clarify all com ports work fine outside of node-red/serialport node. I've had 8 ports open talking to various pieces of hardware with no issue whatsoever.

I have the following at my disposal. 1 x USB - 4 port rs232 adapters, 2 x USB to 2 port rs232 adapters, 1 x 1 port RS322 Adapter.

Test 1: 1 x 4 port cable, add ports 1 and 2 - all ok add port 3, deploys fine but doesn't send anything out of the port (debug messages do show in node red console). Add port 4, deploys first time but then crashes on any further deployment attempts.

Test 2: using 2 x 2 port adapters, same results as Test 1. this got me thinking it may be a driver issue, but remember i've had 8 ports working outside node-red.

Test 3: 1 x 1 Port, 1 x 2 Port. All 3 ports deploy and send ok.
Test 4: 1 x 4 port, 1 x 2 port, 1 x 1 port. 3 separate windows drivers across the three adapters. no matter what permutation i try it always crashes when adding a fourth com port, sometimes i get port 3 but more often than not it deploys but doesn't send out of the port.

Hope that helps. I don't have any more gear to throw at testing it unfortunately.
Cheers

@dceejay
Copy link
Member

dceejay commented Oct 31, 2017

Hi, most odd - just managed to scrape together 4 ftdi single usb adapters and so far on my Pi they are all connecting ok - not a lot of data flowing to be honest - but not hanging or slowing down rest of ui.

But... you are welcome to try the latest beta - which I'd like to release soon anyway... once it has been given a good testing... and this would help :-)

in your user directory

    npm i node-red-node-serialport@beta

@dceejay
Copy link
Member

dceejay commented Feb 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants