Arduino以太网通讯 [英] Arduino ethernet communication

查看:65
本文介绍了Arduino以太网通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过以太网连接从 Arduino 获取传感器输出并通过以太网将数据发送到 Arduino?

Is it possible to get sensor output from Arduino via Ethernet connection and to send data to Arduino via Ethernet?

那么基本上可以用以太网口代替"串口吗?

So basically can "replace" serial port with Ethernet port?

推荐答案

执行此操作的典型方法是使用 Arduino 以太网扩展板,这是一个插入 Arduino 板的小型硬件模块:

The typical way to do this is with an Arduino Ethernet shield, a small hardware module that plugs into your Arduino board:

更新:

客户端到服务器通信的一种非常常见的方法是通过 TCP/IP 使用 HTTP.请在 Ardunio 站点上查看此示例,该示例是连接服务器(在本例中为 google)的 Ardunio 上的简单客户端:

One very common approach for client to server communication would be to use HTTP over TCP/IP. See this example on the Ardunio site of a simple client on an Ardunio connecting with a server (in this case google):

对于您的用例,您可以简单地创建自己的服务器并修改示例以向其发送数据.

For your use case you can simply create your own server and modify the example to send data to it.

或者,您可以跳过 HTTP 部分而只使用套接字 - 这里有一个开源示例:

Alternatively you can skip the HTTP part and just use sockets - there is an open source example here:

这篇关于Arduino以太网通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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