Close

07/23/19 - Scan for slave only once

A project log for My attempt at an ESP-NOW Mesh

Designing a custom mesh for sensors, home automation and remote controlling using Espressif's ESP-NOW

david-mDavid M. 07/31/2019 at 20:380 Comments

Beginning with the ESP-NOW example sketches, I became confused as to why the time between transmissions was so large, even if I removed the 3 second delay from the loop of the master sketch. To troubleshoot this problem, I toggled a pin before and after the ScanForSlave, manageSlave and sendData functions and used Five Wire logic analyzer to monitor that pin. The tool made quick work of this debugging process as I was able to see exact timings between operations. 

Fig. 8 - The amount of time each function takes. Captured with Five Wire.

The scan for slave pin is high most of the time, meaning that the function is very time consuming. I made ScanForSlave function run only once later on. 

Fig. 9 - The example sketch modified to toggle pins 4, 16 and 19 to monitor function timing.

To begin transmitting useful data, I need to choose a sensor for my master node. The first sensor I chose to use is the DHT11 Temperature and Humidity sensor. I was able to make the the Arduino example sketch function and I’m porting it to PlatformIO.

Fig. 10 - Porting DHT11 example sketch to PlatfromIO

Discussions