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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.