HTMAA 2024 - Week 12

Networking and Communications

Home

For this week of Networking and Communications, I wanted to take advantage of the ESP32's ESP-NOW capabilities. I could have gone with its Bluetooth, but I really was interested in seeing how the ESP-NOW protocol worked./p>
x

I followed this tutorial that taught me about what ESP-NOW was and how to use it.


x

To use the protocol, we would need to find the MAC address, which they graciously provided the code for.


x

I hooked up two of my ESP32C3's to my computer and labelled them with the port they were in to make sure I could troubleshoot them without confusion.


x

For some reason, the boards were not connecting. I realized I had to specify that they were XIAOs in my board manager.


x

Apparently each microcontroller is not just based off of its chip but also the manufacturer of the board, so even specifying an "ESP32C32" is not enough for the Arduino IDE to communicate with the Xiao.


x

Anyway I ran the code and it gave me the MAC address for both of my ESP32s!


x

I put stickers on both of them with their MAC addresses labelled for later use.


x x

One ESP32 had to have sender code, which I got from the same tutorial. It had to know what MAC address the receiver had.


x

The other ESP32 had to have receiver code, which I got from the tutorial as well. It was basically listening for a message.


x

If you turned on the sender without turning on the receiver, it would show that though packet sending was successful, delivery was not, because nothing confirmed receiving it.


x

Here's what it looked like when both receiver and sender were on and communicating.


x

I got them to communicate and send a number between 1 and 20 between them, which was the tutorial code was coded to do.


x

That's it for the week on networking and communications! For a really long time I've wanted to get my Arduino MKRZeros to communicate with each other, and I could never figure it out until finally I relented and used an ESP32C3 and now I see why ESP32s are so much better than Arduino boards. It turns out that networking with ESP32s are so easy due to the ESPNOW protocol and I look forward to integrating this into my future projects.


Home

Previous Week | Next Week