ESP32 between three devices

With the left hand setup working so well, it was finally time to integrate the ESP-NOW code into that of the right hand setup. So far, the ESP-NOW code only involves communication between two ESP32s. However, in the end the ESP32-CU should receive data from both devices, the ESP32-LH and the ESP32-RH. This means that ESP-NOW communication between three devices must be established. However, only one-way communication capabilities are necessary since the ESP32-LH/RH are the only ones to send data to the ESP32-CU with the latter sending no information back. Surprisingly, this made the code necessary a lot easier than it was before. Following a tutorial, the ESP32-CU was set up as the receiver (slave) and the other two ESP32s for left and right hand were set up as senders (masters). Then ESP-NOW communication was tested by sending dummy values from ESP32-LH and RH to the ESP32-CU. By sending a sender ID together with the dummy values, the ESP32-CU was not only capable of receiving the values but could also distinguish between the values sent by ESP32-LH and those sent by ESP32-RH. This was great news for the project!

With the basic code working, it was then time to add this new ESP-NOW code to the current codes of the left and right hand setups. As always, the ESP-NOW code was first added to the left hand setup code and it worked as expected. Next, the code was added to the right hand setup and communication between all three devices was tested simultaneously with the right hand and the left hand setup sending values to the ESP32-CU. This worked as well.

To top things off, the left hand setup was again fully tested in conjuncture with the digipot following the test setup explained in the previous blog post together with the new ESP-NOW code. This test worked as well making the Christmas holidays a very successful time for the project with much progress being made!

Sources:

ESP-NOW: Receive Data from Multiple ESP32 Boards (many-to-one) | Random Nerd Tutorials

Leave a Reply

Your email address will not be published. Required fields are marked *