如何在两个Arduino之间发送互联网数据包? [英] How to send internet packets between two Arduinos?

查看:293
本文介绍了如何在两个Arduino之间发送互联网数据包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我正在从事的项目,我想知道是否存在一种在两个Arduino之间发送互联网数据包的方法.

For a project I am working on, I am wondering if there is a way to send internet packets between two Arduinos.

设置将使两个Arduino都具有以太网屏蔽.一个屏蔽层连接到计算机,另一个屏蔽层连接到路由器或其他Internet连接. Arduino需要相互通信以中继信息包.目标是能够通过这两个Arduino从我的计算机ping路由器.

The setup would be to have both Arduinos have ethernet shields. One shield is connected to a computer and the other to a router or other internet connection. The Arduinos need to communicate to each other relaying the packets of information. The goal is to be able to ping the router from my computer through these two Arduinos.

任何帮助将不胜感激.谢谢.

Any help would be greatly appreciated. Thank you.

推荐答案

互联网上存在多种交流方式.

there a mutliple ways of communication over the internet.

  • UDP库 非常简单易用,但是不验证软件包是否收到...(Arduino库具有UDP类)
  • 使用客户端类 Arduino一个是服务器,而Arduino 2是一个客户端. 例如:一个arduino使用server.print(data)发送一个字符串/数据包,另一个使用client.read()接收它.
  • UDP library Very easy and simple to use, but there is no validation if the packages received or not... (The Arduino library has a UDP class)
  • Using the client class Arduino one is a server and Arduino 2 a client. For example: one arduino sends a string/packet using server.print(data) the other receives it using client.read().

这篇关于如何在两个Arduino之间发送互联网数据包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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