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?
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
Change the Arduino UI to point to the other COM port (COM4 in my case)
Tools -> Serial Port -> COM4
Add this to your johnny-five startup code:
var five = require("johnny-five");
board = new five.Board({
port: "COM4"
});
board.on("ready", ...);
I was running into this same problem on my Arduino Uno R3 with johnny-five. To fix it, I had to update the StandardFirmata.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With