• 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

ESP32 Sender Sketch (ESP-NOW)

Q&A Forum › Category: ESP32 › ESP32 Sender Sketch (ESP-NOW)
0 Vote Up Vote Down
Paul Brandt asked 5 years ago

the following line gives me the error: ‘esp’ was not declared in this scope:
esp err t result = esp now send(broadcastAddress, (uint8_t  *) &myData, sizeof(myData));
That is letter for letter space for space like it is in the ESP32 Sender Sketch(ESP-NOW)
except for the (uint8_t) is (uint8 t *) in the sketch.
does anyone know what is wrong?
Thanks

Question Tags: ESP32 Sender Sketch (ESP-NOW)
11 Answers
0 Vote Up Vote Down
Steve Mercer answered 5 years ago

You are missing the underscores. The error message is saying that you are trying to declare a variable of type “esp” but it could not find that variable type in the current scope. What you want to declare is a variable type of esp_err_t with a variable name of result.
 
The line of code should be:
 

esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData));
0 Vote Up Vote Down
Paul Brandt answered 5 years ago

Someone needs to correct the ESP32 Sender Sketch (ESP-NOW)

0 Vote Up Vote Down
Steve Mercer answered 5 years ago

I copied that line of code from ESP-NOW with ESP32: Receive Data from Multiple Boards (many-to-one) so where does it need to be corrected?

0 Vote Up Vote Down
Paul Brandt answered 5 years ago

In the ESP32 Sender Sketch (ESP-NOW) which is in the Learn_ESP32_with_Arduino_IDE_2nd_Edition_Rui_Santos_Sara_Santos.pdf which I paid a lot of money for.

0 Vote Up Vote Down
Steve Mercer answered 5 years ago

I will leave that for Rui/Sara to address.

0 Vote Up Vote Down
Steve Mercer answered 5 years ago

I will add to this discussion that everybody programming the Arduino first needs to understand the C/C++ programming language. If you knew this language you would have known what the error meant.
 
The book you purchased made the assumption that you already knew how to program in C/C++. I don’t know whether there is a disclaimer to that effect in the book but there probably should be. I know there is a link in the book to download all the sketch’s (There is in my book “ESP32-CAM Projects”). Did you use that or did you copy/paste from your book?

0 Vote Up Vote Down
Paul Brandt answered 5 years ago

If someone knows C/C++ or not the code in a book should be correct or the book is worthless!

0 Vote Up Vote Down
Steve Mercer answered 5 years ago

I don’t know of any coding book in existence today that does not have an error in it somewhere. Just as in code bugs crop up. I’m sure Rui/Sara will be making an update soon.
 

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

Hi Paul.

I’m really sorry for that issue.

Can you tell me the exact code that you get the error? There are more than one ESP-NOW projects on the eBook.
There must have been some issue while copying/pasting the code.

Did you copy the code from the eBook or did you download it from our repository? I found the error on the eBook, but I couldn’t find it in the repository.

I advise you to always copy the code from the repository to avoid copy/paste issues from the PDF.
I’ll solve the issues on the eBook. The next eBook update will reflect those changes.

Finally, if you’re not happy with the content of our eBook, you can always ask for a refund within 60 days of the original purchase of the product. https://randomnerdtutorials.com/returns-and-refunds/

Once again, I’m sorry for the issue.
Regards,
Sara

0 Vote Up Vote Down
Paul Brandt answered 5 years ago

In the ESP32 Sender Sketch (ESP-NOW) which is in the Learn_ESP32_with_Arduino_IDE_2nd_Edition_Rui_Santos_Sara_Santos.pdf

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

Hi again.

I found the issue in the eBook. It was probably an issue while copy/paste the code. All related issues will be corrected on the next eBook update.

The code is correct on the repository. You can access the code here: https://github.com/RuiSantosdotme/ESP32-Course/blob/master/code/ESP_NOW/Unit_1/ESP32_Sender/ESP32_Sender.ino

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.