我想使用JS/Johnny-Five无线地从我的计算机向Arduino运行命令。我有一架Uno和一架HC-05我按照in this URL的说明设置了HC-05。我可以把我的电脑和它配对,我已经把StandardFirmata上传到Uno上了。但当我尝试与它交流时,它似乎超时了。
当我键入时,通过NodeJS命令行
> var five = require("johnny-five");
> var board = new five.Board({repl: false, port:'/dev/cu.ailaGduino-DevB'})我得到了:
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它后来提到Timer.listOnTimeout是错误调用堆栈的一部分。
Arduino IDE会列出配对时的特定设备,我猜这就是它显示“已连接”的原因。
当我再次尝试相同的命令时,我得到
> 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 通过USB没问题。
有什么想法吗?
发布于 2020-01-08 18:41:32
我认为这个位是错误的,因为您的地址是本地连接的设备,而不是wifi连接的设备。
var board = new five.Board({port:'/dev/cu.ailaGduino-DevB'})This tut建议你需要以一种不同的方式连接到董事会。
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
});https://stackoverflow.com/questions/40923908
复制相似问题