• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP NOW Seems to Be Timing Out

Q&A Forum › Category: ESP32 › ESP NOW Seems to Be Timing Out
0 Vote Up Vote Down
Dennis Cloutier asked 4 years ago

I am sending sensor data from one esp32 to another using the RNT code.  I have two sending boards and one receiving board.  One board keeps reporting an error sending the data.  If I send a message every 10 seconds it does 5 messages and then reports an error sending the data.  If I reset the sending esp32 the cycle repeats.  I changed the interval to 1 minute and it now will send one message before starting to spit out errors. So it almost seems like this board is timing out or something???
The error message result is 12396.  
Does anyone have any suggestions?
Thanks,
Dennis

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Dennis.
Do you have more information about the error?
Regards,
Sara

0 Vote Up Vote Down
Dennis Cloutier answered 4 years ago

Sara:
The code I’m using is from the RNT website:

// Send message via ESP-NOW
  esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData));
   
  if (result == ESP_OK) {
    Serial.println("Sent with success");
  }
  else {
    Serial.println("Error sending the data");
  }

 

It sends ok at first and then I get the message “Error sending the data”. I added a line to print the variable called result and it is 12396.

Thanks,
Dennis

0 Vote Up Vote Down
Steve Mercer answered 4 years ago

That error number is not useful as it relies on ESP_ERR_WIFI_BASE of your particular ESP32. You have to use the constants provided by espnow.h.
 
According to the ESP-NOW documentation and the espnow.h file on GitHub you will need to figure out the actual error. You can use a switch statement or an if block to print the actual error. For example (You should be able to add the rest of the error messages here):
 

if(result == ESP_ERR_ESPNOW_NOT_INIT) {
Serial.println("ESPNOW is not initialized");
}
else if(result == ESP_ERR_ESPNOW_ARG) {
Serial.println("invalid argument");
}
else if(blah, blah, blah
0 Vote Up Vote Down
Dennis Cloutier answered 4 years ago

Ok, well it’s now started working.  I moved the unit out to it’s permanent home, and it’s now on a different power supply, so maybe it was a power supply issue.  Anyways, thanks for your help.

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Dennis.
That’s great that the issue is solved.
I’ll close this issue. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.