Foros del Web » Programando para Internet » Node.js »

Cómo leer el puerto serial COM1 en W7 ?

Estas en el tema de Cómo leer el puerto serial COM1 en W7 ? en el foro de Node.js en Foros del Web. Hola. Por + que busco, solo aparece la opción " instalar serialport con: npm install serialport " Pero eso solo funciona en MAC y *nix. ...
  #1 (permalink)  
Antiguo 19/05/2013, 15:29
 
Fecha de Ingreso: febrero-2004
Mensajes: 1.987
Antigüedad: 20 años, 2 meses
Puntos: 22
Cómo leer el puerto serial COM1 en W7 ?

Hola.

Por + que busco, solo aparece la opción "instalar serialport con:

npm install serialport
"

Pero eso solo funciona en MAC y *nix.

Utilizando [node.js + socket.io + W7] ¿cómo puedo leer el puerto serial COM1?

Gracias
  #2 (permalink)  
Antiguo 19/05/2013, 16:16
 
Fecha de Ingreso: febrero-2004
Mensajes: 1.987
Antigüedad: 20 años, 2 meses
Puntos: 22
Respuesta: Cómo leer el puerto serial COM1 en W7 ?

Cita:
Iniciado por Anarko Ver Mensaje
eso solo funciona en MAC y *nix.
También he probado con serialpor2 pése a que ellos dicen que funciona en W7, siémpre obtengo errores y no instala.

Pese a que ellos dicen
Cita:
https://npmjs.org/package/serialport2#readme

SerialPort2

Node.js serial port driver. Works on Windows, OSX, and linux.
Vale, vale, trabaja en W7, pero cómo se instala?

(ya tengo instalado gyp)

Incluso descargo el package.json y siempre obtengo lo mismo:
Código HTML:
E:\HTTP\NJS>npm install serialport2
npm WARN package.json [email protected] No readme data.
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/serialport2
npm http 304 https://registry.npmjs.org/serialport2
npm http GET https://registry.npmjs.org/bindings/0.3.0
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/sf/0.1.3
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/sf/0.1.3
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/bindings/0.3.0
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap

> [email protected] install E:\HTTP\NJS\node_modules\serialport2
> node-gyp rebuild


E:\HTTP\NJS\node_modules\serialport2>node "E:\HTTP\NJS\node_modules\npm\bin\node
-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (E:\HTTP\NJS\node_modules\npm\node_modules\no
de-gyp\lib\configure.js:113:14)
gyp ERR! stack     at E:\HTTP\NJS\node_modules\npm\node_modules\node-gyp\lib\con
figure.js:81:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "E:\\HTTP\\NJS\\node_modules\\npm\\node_modules\\node-gy
p\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\HTTP\NJS\node_modules\serialport2
gyp ERR! node -v v0.10.7
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

E:\HTTP\NJS>
  #3 (permalink)  
Antiguo 20/05/2013, 04:58
 
Fecha de Ingreso: febrero-2004
Mensajes: 1.987
Antigüedad: 20 años, 2 meses
Puntos: 22
Respuesta: Cómo leer el puerto serial COM1 en W7 ?

Cita:
Iniciado por Anarko Ver Mensaje
requerimientos para gyp
Para serialport se requiere si o si:
  • PyThon 2.x
  • Microsoft Visual 2010 Express
  • .NET 4
  • WIN SDK
En mi caso, me devuelve este error:


Código:
  serialport.cpp
  serialport_unix.cpp
  serialport_win.cpp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\YO\AppData\Roaming\npm\node_modules\serialport\build\se
rialport.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\YO\AppData\Roaming\npm\node_modules\serialport\build\se
rialport.vcxproj]
c:\users\yo\appdata\roaming\npm\node_modules\serialport\src\win/stdafx.h(3): fa
tal error C1083: Cannot open include file: 'atlstr.h': No such file or director
y [C:\Users\YO\AppData\Roaming\npm\node_modules\serialport\build\serialport.vcx
proj]
  enumser.cpp
C:\Users\YO\.node-gyp\0.8.21\deps\v8\include\v8.h(183): warning C4506: no defin
ition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<
T>)' [C:\Users\YO\AppData\Roaming\npm\node_modules\serialport\build\serialport.
vcxproj]
          with
          [
              T=v8::Object
          ]
c:\users\yo\appdata\roaming\npm\node_modules\serialport\src\win\stdafx.h(3): fa
tal error C1083: Cannot open include file: 'atlstr.h': No such file or director
y [C:\Users\YO\AppData\Roaming\npm\node_modules\serialport\build\serialport.vcx
proj]
gyp ERR! build error
Ahora me enfrento al error C++ exception handler used, but unwind semantics are not enabled alguna idea para corregirlo por favor?

Estoy en W7 con PyThon 2.x

Gracias

Última edición por Anarko; 20/05/2013 a las 09:02
  #4 (permalink)  
Antiguo 27/05/2013, 11:30
 
Fecha de Ingreso: febrero-2004
Mensajes: 1.987
Antigüedad: 20 años, 2 meses
Puntos: 22
Respuesta: Cómo leer el puerto serial COM1 en W7 ?

Para instalar serialport es obligatorio que tengas Visual Studio 2010 Professional; en su web dicen que es suficiente con Visual Studio 2010 Express pero a mi nunca me funcionó.

Afortunadamente accedí a un CD con la versión Profesional y enhorabuena!...

Ya leo y escribo al puerto serial desde FireFox...



PD: de necio lo intenté con la version 2012 ( también profesional ), y NO FUNCIONA!

Etiquetas: puerto, serial
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:14.