首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Johnny Five Over Bluetooth连接问题

Johnny Five Over Bluetooth连接问题
EN

Stack Overflow用户
提问于 2016-12-02 10:47:34
回答 1查看 736关注 0票数 3

我想使用JS/Johnny-Five无线地从我的计算机向Arduino运行命令。我有一架Uno和一架HC-05我按照in this URL的说明设置了HC-05。我可以把我的电脑和它配对,我已经把StandardFirmata上传到Uno上了。但当我尝试与它交流时,它似乎超时了。

当我键入时,通过NodeJS命令行

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

我得到了:

代码语言:javascript
复制
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会列出配对时的特定设备,我猜这就是它显示“已连接”的原因。

当我再次尝试相同的命令时,我得到

代码语言:javascript
复制
> 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没问题。

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2020-01-08 18:41:32

我认为这个位是错误的,因为您的地址是本地连接的设备,而不是wifi连接的设备。

代码语言:javascript
复制
var board = new five.Board({port:'/dev/cu.ailaGduino-DevB'})

This tut建议你需要以一种不同的方式连接到董事会。

代码语言:javascript
复制
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
});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40923908

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档