I can't execute my js file for my arduino-uno on windows 7. (I encounter a Port issue)

121 Views Asked by At

When running the program (node Alarm_system.js) , the following output occurs:

λ node Alarm_system.js
1514314162653 Available COM4,COM7,COM1,COM5,COM3
1514314162670 Connected COM4
1514314162673 Error Opening COM4: Unknown error code 1167
(node:4804) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Uncaught, unspecified "error" event. ([object Object])
1514314172672 Device or Firmware Error A timeout occurred while connecting to the Board.

Please check that you've properly flashed the board with the correct firmware.
See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting

If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again.
events.js:165
      throw err;
1

There are 1 best solutions below

0
On

You just have to configure for a correct port like the following:

board = new five.Board({
  port: "COM7"
});

The code before :

board = new five.Board();

In all I needed is to be specify a correct port and to get a correct port you can use the Arduino IDE. Here's a good site: ardunino setup project