Arduino的连接使用的WebSocket到服务器的NodeJS [英] Connect Arduino to nodejs server using websocket

查看:472
本文介绍了Arduino的连接使用的WebSocket到服务器的NodeJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我有:
- 一个自治的Arduino(电池+ WIFI盾)
- 一个服务器的NodeJS + socket.io模块

First, I have : - An autonomous arduino (battery + wifi shield) - A nodejs server + socket.io module

我想我的Arduino连接到服务器的NodeJS并添加实时的可能性。
我不知道是否有可能在例如Chrome浏览器上使用的Arduino的侧(客户端)的WebSocket喜欢让服务器端来调用客户端的方法的东西,如:

I want to connect my Arduino to the nodejs server and add real time possibilities. I don't know if is possible to use websocket on arduino's side (client side) like in a browser like chrome to allow the server side to call a method on client side with something like :

socket.on(myMethod,...)

我看到像noduino的Jhonny五库但总是用串行端口(带USB)。

I saw libraries like noduino of jhonny-five but always using serial port (with usb).

推荐答案

使用Socket.IO Arduino的客户端,当然可以。 https://github.com/billroy/socket.io-arduino-client

Using Socket.IO Arduino Client, yes you can. https://github.com/billroy/socket.io-arduino-client

这篇关于Arduino的连接使用的WebSocket到服务器的NodeJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆