4

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?

gnarf
  • 105,192
  • 25
  • 127
  • 161
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
  • I know its late but it may be helpful. Your setup seems right. My gut feeling is that you have the LED plugged incorrectly, .e.g., either in the wrong pin or anode/cathode are reversed. Have you made sure of that? – Aater Suleman Jul 25 '12 at 06:13

2 Answers2

8

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", ...);

Max Reeder
  • 159
  • 2
  • 6
6

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.

derekgaw
  • 61
  • 1
  • 3