Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Johnny Five: board not ready

I've previously had my Arduino kit working on the same hardware with Breakout, but would like to switch to Johnny Five. My hardware is wired with the simple single LED layout from http://weblog.bocoup.com/javascript-arduino-programming-with-nodejs/ but running the basic LED strobing demo isn't working as expected:

var five = require("johnny-five"),
    board, led;

board = new five.Board();

board.on("ready", function() {
  console.log('ready');
  led = new five.Led(13);
  led.strobe(100);
});

Returns:

1341154189666 Board Connecting... 
1341154189697 Serial Found possible serial port cu.usbmodem621
1341154189699 Board -> Serialport connected cu.usbmodem621
1341154191570 Repl Successfully Connected 

I end up straight in the Firmata REPL with no LED strobing, and board.ready is false.

Any suggestions for why the board.ready callback wouldn't be firing?

like image 907
mikemaccana Avatar asked Dec 08 '22 23:12

mikemaccana


2 Answers

On Windows, sometimes you have to specify which COM port. I received the following error when flashing firmata:

avrdude: stk500_getsync(): not in sync: resp=0x00
  1. Change the Arduino UI to point to the other COM port (COM4 in my case)

    Tools -> Serial Port -> COM4

  2. Add this to your johnny-five startup code:

    var five = require("johnny-five"); board = new five.Board({ port: "COM4" }); board.on("ready", ...);

like image 77
Max Reeder Avatar answered Jan 10 '23 05:01

Max Reeder


I was running into this same problem on my Arduino Uno R3 with johnny-five. To fix it, I had to update the StandardFirmata.

  1. Download the latest Arduino software (at time of writing 1.0.2)
  2. Install and open the Arduino application
  3. Connect the Arduino to the computer (through USB)
  4. In the menu, select File > Examples > Firmata > StandardFirmata
  5. Press the upload button

After that completed, I could connect to the board using firmata and the ready event fired as expected. I had to do the same process with all my Arduinos to get them to work.

like image 38
derekgaw Avatar answered Jan 10 '23 06:01

derekgaw