serial port node for Windows

1,455 views
Skip to first unread message

Charles Palmer

unread,
Feb 24, 2014, 12:46:13 PM2/24/14
to node...@googlegroups.com
I hoped to connect a serial port node on my Windows 7 system. Should I do "npm install serialport" or is there an alternative? I began the npm install process but it stops mid-way with the error below. Can anyone suggest a way beyond this point, or an alternative way to get a serial port node?

C:\Users\my\Downloads\Software\Node-red\node-red-0.5.0\node-red-0.5.0\node_modul
es\serialport>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\.
.\..\node_modules\node-gyp\bin\node-gyp.js" rebuild

C:\Users\my\Downloads\Software\Node-red\node-red-0.5.0\node-red-0.5.0\node_modu
les\serialport\build\serialport.vcxproj(18,3): error MSB4019: The imported proj
ect "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in th
e <Import> declaration is correct, and that the file exists on disk.

Nicholas O'Leary

unread,
Feb 24, 2014, 12:58:28 PM2/24/14
to node...@googlegroups.com
Hi Charles,

The main serial node in node-red does indeed depend on the serialport npm module.

This module requires some C code to be complied, which on Windows requires a number of prerequisites. It looks like there is a problem with your environment for compiling this module. A google for the error message, found this - http://stackoverflow.com/questions/16092169/why-does-msbuild-look-in-c-for-microsoft-cpp-default-props-instead-of-c-progr

Don't know if this helps.

Alternatively, we do have the rawserial node, which is much cruder as it treats the serial device as just another file to read or write from - thus avoiding the need to install the serialport module. It is limited in capability - I believe it can only read or write, not both. Dave CJ put that together and I'm sure can give you some pointers.

Regards,
Nick


--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Dave C-J

unread,
Feb 24, 2014, 2:07:21 PM2/24/14
to node...@googlegroups.com
Charles

yes Windows is a real pain... the underlying serialport install requires the whole Visual Studio build environment - sort of documented here - https://github.com/voodootikigod/node-serialport

hence why I went for a very simple rawserial node - available in our node-red-nodes project - https://github.com/node-red/node-red-nodes or specifically

all it does is set up an input stream from a system COM port - so you have to set up the baud rate externally - eg  mode COM3 9600,n,8,1   and so on - before starting node-red.

As Nick pointed out - it also only handles input OR output (one per physical port) - so fine for things like GPS (read only) or controlling something write only - as it really was only meant as a stopgap.


--
regards

Dave Conway-Jones

Reply all
Reply to author
Forward
0 new messages