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?
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));
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?
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.
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?
If someone knows C/C++ or not the code in a book should be correct or the book is worthless!
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.
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.
In the ESP32 Sender Sketch (ESP-NOW) which is in the Learn_ESP32_with_Arduino_IDE_2nd_Edition_Rui_Santos_Sara_Santos.pdf
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