• 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

CYD ESP NOW Sender code compilation error line 56. wifi_tx_info_t does not name a type

Q&A Forum › Category: ESP32 › CYD ESP NOW Sender code compilation error line 56. wifi_tx_info_t does not name a type
0 Vote Up Vote Down
Gary Leslie asked 3 days ago

Hi Sara,
I’m having a little problem with the recent ESP NOW CYD sketch. Have you any idea what I’m doing wrong?
I am using a couple of ESP32 dev kit v1 modules. 
Thanks
 
When attempting to compile the Sender code for the ESP32 CYD ESP NOW sketch, The error message: ”
exit status 1
Compilation error: ‘wifi_tx_info_t’ does not name a type; did you mean ‘wifi_sta_info_t’?
This is referring to line 56

// Callback when data is sent
void OnDataSent(const wifi_tx_info_t* mac_addr, esp_now_send_status_t status) {
  char macStr[18];
  Serial.print(“Packet to: “);
  // Copies the receiver mac address to a string
  snprintf(macStr, sizeof(macStr), “%02x:%02x:%02x:%02x:%02x:%02x”,
           mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
  Serial.print(macStr);
  Serial.print(” send status:\t”);
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? “Delivery Success” : “Delivery Fail”);
}
 
I tried changing the type to ‘wifi_sta_info_t but I just got another error message referring to line 78
‘invalid conversion from void()(const wifi_sta_info_t, esp_now_send_status_t) to ‘esp_now-send_cb_t'{aka ‘void()
const unsigned char,esp_now_send_status_t)}[-fpermissive]

 

 

Question Tags: ESP CYD ESP NOW
2 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 days ago

Hi.
Update your ESP32 boards to the latest version.
Go to Tools > Boards > Boards Manager > Search for ESP32 and install the latest version.
Regards,
Sara

0 Vote Up Vote Down
Gary Leslie answered 12 hours ago

The problem appears to be an error in your  code. It has been corrected in the how does it work section.
The correct line is:
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
instead of the code shown in the first sketch of the ESP32 ESP_NOW Sender Code
void OnDataSent(const wifi_tx_info_t *mac_addr, esp_now_send_status_t status) { 
 
HTH
Gary
 

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 LVGL: Build GUIs for ESP32 Projects – Version 1.5 July 7, 2025
  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 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.