Hi,
I'm having an issue with xbee_motion_sensor project.
In the app.js file, as I'm using windows laptop, I changed :
rest.addDevice('xbee','/dev/tty.usbserial-A702LF8B');
to
rest.addDevice('xbee','COM9');
But when I launch "node app.js" I get this in the terminal:
////
C:\Users\flori\Desktop\xbee_motion_sensors\interface>node app.js
C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\xbee-arest\index.js:133
self.serial = new serialport.SerialPort(self.options.port, {
^
TypeError: serialport.SerialPort is not a constructor
at XBee.init (C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\xbee-arest\index.js:133:17)
at initXBee (C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\arest\index.js:45:6)
at Object.addDevice (C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\arest\index.js:491:9)
at Object. (C:\Users\flori\Desktop\xbee_motion_sensors\interface\app.js:16:6)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
///
May someone help me please ?! Thanks in advance
Florian
Hi, I'm having an issue with xbee_motion_sensor project. In the app.js file, as I'm using windows laptop, I changed : rest.addDevice('xbee','/dev/tty.usbserial-A702LF8B'); to rest.addDevice('xbee','COM9'); But when I launch "node app.js" I get this in the terminal: //// C:\Users\flori\Desktop\xbee_motion_sensors\interface>node app.js C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\xbee-arest\index.js:133 self.serial = new serialport.SerialPort(self.options.port, { ^
TypeError: serialport.SerialPort is not a constructor at XBee.init (C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\xbee-arest\index.js:133:17) at initXBee (C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\arest\index.js:45:6) at Object.addDevice (C:\Users\flori\Desktop\xbee_motion_sensors\interface\node_modules\arest\index.js:491:9) at Object. (C:\Users\flori\Desktop\xbee_motion_sensors\interface\app.js:16:6)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
///
May someone help me please ?! Thanks in advance Florian