3

I want to run commands from my computer to an Arduino using JS/Johnny-Five, wirelessly. I have an Uno and an HC-05. I set the HC-05 up per the instructions in this URL. I can pair my computer to it and I have uploaded StandardFirmata to the Uno. But it seems to time out when I try to communicate with it.

When I type, through NodeJS command line

> var five = require("johnny-five");
> var board = new five.Board({repl: false, port:'/dev/cu.ailaGduino-DevB'})

I get:

1480635008609 Connected /dev/cu.ailaGduino-DevB  
undefined
> 1480635018633 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

It later mentions Timer.listOnTimeout as part of the error call stack.

The Arduino IDE lists that specific device when paired, I guess that's why it says "Connected".

When I try the same command again, I get

> var board = new five.Board({port:'/dev/cu.ailaGduino-DevB'})
1480635041136 Connected /dev/cu.ailaGduino-DevB  
undefined
> 1480635041138 Error Error Resource temporarily unavailable Cannot lock port  

It was fine through USB.

Any ideas?

ailaG
  • 41
  • 1
  • 6

1 Answers1

0

I think this bit is wrong as your addressing a locally connected device rather than a wifi connected device.

var board = new five.Board({port:'/dev/cu.ailaGduino-DevB'})

This tut suggests you need to connect to the board in a different fasion.

var EtherPortClient = require("etherport-client").EtherPortClient;
var board = new five.Board({
port: new EtherPortClient({
   host: "xxx.xxx.xxx.xxx",  // IP ESP8266
   port: 3030                
}),
timeout: 10000,
repl: false
});
Emile
  • 11,451
  • 5
  • 50
  • 63
  • the tutorial you linked talks about connecting via Ethernet, however, I am looking for connecting to johnny-five for the bluetooth pairing. Do you have suggestions on how we can have johnny-five interact over Bluetooth? – anurag Jan 09 '20 at 17:49
  • ah my bad, i assumed wirelessly as in wifi. – Emile Jan 09 '20 at 18:17
  • the only thing i can think of would be to check bluetooth speed see it mentioned here. https://pofay.github.io/2018/11/08/setup-wireless-tethering-for-johnny-five-in-arduino-using-hc05-BT.html " Cannot lock port" i think that would likely be related to attempting multiple connections at the same time. Sorry, don't know much more than that. – Emile Jan 09 '20 at 18:22
  • you might try this chat channel as well. https://gitter.im/rwaldron/johnny-five – Emile Jan 09 '20 at 18:24