Hi, Is it possible to interface the Arduino IDE to the Espduino-32 via WiFi, and eliminate the USB cable?
Does the lab explain anywhere how to connect to the ESP32 using UDP or TCP (over WiFi)?
What is the best way to physically connect an Arduino Mega to the ESP32? Serial? GPIO?
You can program your ESPduino-32 over the air (OTA).
But, for that, first, you need to upload a sketch via USB that allows the board to accept OTA updates. Later, you can upload new code to the board over-the-air without the need for the USB cable.
Search for “ESP32 OTA”.
We have tutorials about that:
About the second question, it depends on what kind of data you want to send from one board to the other. Serial communication is usually the way to go.
I hope this helps.
“Does the lab explain anywhere how to connect to the ESP32 using UDP or TCP (over WiFi)?”
How do you want to connect to the ESP32? Using a web server that you can access on your smartphone, for example?
Thanks Sara! – Regarding the second question – It would be the PC that connects to the ESP32. So some software on the PC would like to send raw data and receive raw data with the ESP32. I already have a reliable UDP data transfer protocol for Linux, which retransmits the packet if it is dropped. So I need to be able to send UDP packets from the ESP32, and receive UDP packets OTA without blocking. I want to avoid the overhead of a web server and http.
Regarding board-to-board communication, again it will be raw data. The rate will be low – not more than 100 bytes a second.
I would appreciate if you would point me to libraries or examples on Arduino, Github, etc.
We do not cover sending UDP packets in our courses.
I found this example for arduino: https://www.arduino.cc/en/Tutorial/WiFiSendReceiveUDPString
Usually, Wi-Fi examples for arduino are also compatible with the ESP32. So, I think that example will work with the ESP32.
There’s also this example: https://gist.github.com/santolucito/4016405f54850f7a216e9e453fe81803
I hope this helps.