Evening all,
I've been struggling to read data from a serial port using the node-red serial input node.
If I open the serial port in another program, I can receive the data. However, if I close that connection and open the same port in Node-RED (using the same settings) I receive nothing. No errors, nothing written to the file, no debug output.
I am running Node-RED in Windows 11 Professional. I get confirmation in the terminal that the serial port has been opened (see example). I am running Node-RED with admin privileges.
I'm a bit at a loss? Maybe someone could suggest a means of testing the underlying Node.js install without having to write lots of JavaScript? Or maybe experience from having similar issues?
Flow:
[
{
"id": "11673c9bf329ceb5",
"type": "tab",
"label": "Fish Logger",
"disabled": false,
"info": "Listens on RS232 port for serial output from Counter whenever fish passage is detected.\r\nWrites the output to a log file.\r\nLog files are generated for each month and labeled 'log-[YEAR]-[MONTH].txt'\r\n\r\nWritten by J Hobbs, 16/11/2025",
"env": []
},
{
"id": "401d2da1b8ce37ae",
"type": "function",
"z": "11673c9bf329ceb5",
"name": "Construct & Add msg.path",
"func": "// @ts-ignore\nlet year = moment(msg.payload).year();\nlet month = moment(msg.payload).month() + 1;\nlet path = 'C:\\\\Users\\\\Admin\\\\Documents\\\\Fish Logger\\\\log-'+year+'-'+month+'.txt';\nvar newMsg = { payload: msg.payload, path: path };\n\nreturn newMsg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [
{
"var": "moment",
"module": "moment"
}
],
"x": 330,
"y": 40,
"wires": [
[
"a15b1c43a28fe09f"
]
]
},
{
"id": "a15b1c43a28fe09f",
"type": "file",
"z": "11673c9bf329ceb5",
"name": "Write Log File",
"filename": "path",
"filenameType": "msg",
"appendNewline": false,
"createDir": false,
"overwriteFile": "false",
"encoding": "none",
"x": 600,
"y": 40,
"wires": [
[]
]
},
{
"id": "b81be536e162b742",
"type": "debug",
"z": "11673c9bf329ceb5",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 280,
"y": 120,
"wires": []
},
{
"id": "a69c924a7dc9d838",
"type": "serial in",
"z": "11673c9bf329ceb5",
"name": "COM5",
"serial": "2bb465bb3840e480",
"x": 90,
"y": 40,
"wires": [
[
"401d2da1b8ce37ae",
"b81be536e162b742"
]
]
},
{
"id": "55c93b32d6eeb77e",
"type": "catch",
"z": "11673c9bf329ceb5",
"name": "",
"scope": null,
"uncaught": false,
"x": 100,
"y": 120,
"wires": [
[
"b81be536e162b742"
]
]
},
{
"id": "2bb465bb3840e480",
"type": "serial-port",
"name": "",
"serialport": "COM5",
"serialbaud": "9600",
"databits": "7",
"parity": "even",
"stopbits": 1,
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "10000",
"bin": "false",
"out": "time",
"addchar": "",
"responsetimeout": 10000
},
{
"id": "3185db8020375a45",
"type": "global-config",
"env": [],
"modules": {
"node-red-node-serialport": "2.0.3"
}
}
]
Terminal Output:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Windows\system32> node-red
21 Nov 19:41:19 - [info]
Welcome to Node-RED
===================
21 Nov 19:41:19 - [info] Node-RED version: v4.1.1
21 Nov 19:41:19 - [info] Node.js version: v24.11.1
21 Nov 19:41:19 - [info] Windows_NT 10.0.26200 x64 LE
21 Nov 19:41:19 - [info] Loading palette nodes
21 Nov 19:41:21 - [info] Settings file : C:\Users\Admin\.node-red\settings.js
21 Nov 19:41:21 - [info] Context store : 'default' [module=memory]
21 Nov 19:41:21 - [info] User directory : \Users\Admin\.node-red
21 Nov 19:41:21 - [warn] Projects disabled : editorTheme.projects.enabled=false
21 Nov 19:41:21 - [info] Flows file : \Users\Admin\.node-red\flows.json
21 Nov 19:41:21 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
21 Nov 19:41:21 - [warn] Encrypted credentials not found
21 Nov 19:41:21 - [info] Server now running at http://127.0.0.1:1880/
21 Nov 19:41:21 - [info] Starting flows
21 Nov 19:41:21 - [info] Started flows
21 Nov 19:41:21 - [info] [serialconfig:2bb465bb3840e480] serial port COM5 opened at 9600 baud 7E1
21 Nov 19:43:03 - [info] Stopping flows
21 Nov 19:44:21 - [info] serial port COM5 closed
21 Nov 19:44:21 - [info] Stopped flows
Environment
Node-RED v4.1.1
Node.js v24.11.1
Windows_NT 10.0.26200 x64 LE
Thanks in advance!
Joe
