简体   繁体   English

使用 websocket 将 Arduino 连接到 nodejs 服务器

[英]Connect Arduino to nodejs server using websocket

First, I have : - An autonomous arduino (battery + wifi shield) - A nodejs server + socket.io module首先,我有: - 一个自治的 arduino(电池 + wifi 屏蔽) - nodejs 服务器 + socket.io 模块

I want to connect my Arduino to the nodejs server and add real time possibilities.我想将我的 Arduino 连接到 nodejs 服务器并添加实时可能性。 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 :我不知道是否可以在 arduino 端(客户端)像在 chrome 这样的浏览器中使用 websocket 来允许服务器端调用客户端的方法,例如:

socket.on(myMethod,...)

I saw libraries like noduino of jhonny-five but always using serial port (with usb).我看到像 jhonny-5 的 noduino 这样的库,但总是使用串行端口(带 USB)。

Using Socket.IO Arduino Client, yes you can.使用 Socket.IO Arduino 客户端,是的,您可以。 https://github.com/billroy/socket.io-arduino-client https://github.com/billroy/socket.io-arduino-client

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM