How to send internet packets between two Arduinos?

本小妞迷上赌 提交于 2019-12-13 07:49:02

问题


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

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.


回答1:


there a mutliple ways of communication over the internet.

  • 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().


来源:https://stackoverflow.com/questions/43386864/how-to-send-internet-packets-between-two-arduinos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!