Networking and Communications

This week our task was to send a message between two projects. Our goal was to establish communication between two boards, each with an ESP32C3, and then turn on both of the LED's by pressing one button. Normally this process is done through a WIFI network. But since we had two boards with ESP32, we could use the ESP-NOW protocol. ESP-NOW is a wireless communication protocol created by Espressif which lets ESP32 boards talk directly to each other without Wi-Fi or an access point (modem/router). The MAC adress of the two boards is used for this process. You can access the code we used. We first plugged the first board. We changed the following part of the code twice. Once for board 1's LED & Button pins and giving the MAC adress of board 2. And once for writing board 2's LED & Button pins and giving the MAC adress of the board 1. We got the MAC Adress of the first board once we connected the board and uploaded the code.

We modified these depending on the board' pins:

#define LED_PIN D1
#define BTN_PIN D0

We put the MAC adress of the other board inside the brackets with 0x in front. The MAC adress is written when the code is uploaded.