Espressif 32 v6.10.0 and esp_now_recv_info_t (ESP-IDF - v5.4.0) about.
Thanks for big and important project and platform. I used and tested first time today :) and I very loved and now I have decided to abandon the Arduino IDE interface and use this platform with VS Code, This platform is much more impressive and effective. Thanks again!
I tested build for my esp now protocol. But I'm very confused about something.
Because, Espressif 32 version: 6.10.0 Release Notes saying: Added support for ESP-IDF v5.4 ([release notes](https://github.com/espressif/esp-idf/releases/tag/v5.4))
But espressif v5.4 referance page diffent for esp_now_recv_info_t
source: https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32/api-reference/network/esp_now.html?highlight=esp_now_recv_info_t#_CPPv419esp_now_recv_info_t
For issue for this platform behavior of this updated function (ESP-IDF - v5.4.0);
void OnDataRecv(const esp_now_recv_info_t *info, const uint8_t *incomingData, int len) { ..... }
Terminal output
....
....
....
Compiling .pio\build\esp32dev\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\FunctionalInterrupt.cpp.o
src/main.cpp:32:23: error: 'esp_now_recv_info_t' does not name a type; did you mean 'esp_now_peer_info_t'?
void OnDataRecv(const esp_now_recv_info_t *info, const uint8_t *incomingData, int len) {
^~~~~~~~~~~~~~~~~~~
esp_now_peer_info_t
src/main.cpp: In function 'void initESP_NOW()':
src/main.cpp:83:28: error: invalid conversion from 'void (*)(const int*, const uint8_t*, int)' {aka 'void (*)(const int*, const unsigned char*, int)'} to 'esp_now_recv_cb_t' {aka 'void (*)(const unsigned char*, const unsigned char*, int)'} [-fpermissive]
esp_now_register_recv_cb(OnDataRecv); // Alma callback'ini kaydet
^~~~~~~~~~
In file included from src/main.cpp:1:
C:/Users/<....>/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/esp_wifi/include/esp_now.h:136:54: note: initializing argument 1 of 'esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t)'
esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb);
~~~~~~~~~~~~~~~~~~^~
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
- Its not possible build if with this use. But I think this usage is correct because it is compiled on the
current versionArduino IDE platform.
And I tested to compare; for example old version use for this function behaivor on current version Ardunio IDE platform not compiling.
void OnDataRecv(const uint8_t * mac_addr, const uint8_t *incomingData, int len) { .... }
- But interesting, this compiling on
PlatformIObut PlatformIO v6.10.0 saysAdded support for ESP-IDF v5.4
This is my first time using this platform, so maybe there are things I don't understand or I made mistakes, really I don't know. But only according to the Release Notes, I think this function should be compilable.
Thank you again for this impressive and wonderful platform and it is so easy and beautiful to use. My heart is with you! With my best wishes and regards!
You mention "current Arduino", without versions, so it's really hard to tell if you mean "current according ot PlatformIO, which is almost two years behind now" or "current to the rest of the world." - it's even hard to tell if it's relevant, since you link to the token esp_now_recv_info_t although you later link to esp_now_recv_cb_t, which is a prototype decl.
PlatformIO no longer supports current Arduino or new (post-2020) Espressif Hardware (See issue #1225 https://github.com/platformio/platform-espressif32/issues/1225 - I've referred to it so often I don't even have to look it up) That leaves users like you in a pickle.
PlatformIO can support old Arduino 2.something, leaving it to you to find matching docs and blogs and employees not updating their skills so you don't accidentally get anything "new" on you, or you can just go to the PIOArduino project, which is a community-supported fork that actually supports current boards, chips, ESP-IDF versions, and ESPArduino 3.x. I'll let you look up PioArduino and move that conversation somewhere more appropriate if needed.
YOu didn't include enough code for anyone to be able to reproduce the issue, and we can't even see main.cpp, let alone line 83, which is where the error is. The error is saying that esp_now_register_rec_cb is expecting a pointer to a function that takes approximately (int*, const uchar*, int), but you passed it one that takes (uchar*, uchar*, int), which is indeed an incompatible type. Sometimes the 'did you mean' suggestions are more harmful than helpful, especially when recommending function callback pointers that differ by only an arg or two, where it can recommend the wrong one of nine, tricking you into thinking a tx callback is an rx calblack or something nonsensical.
Somewhere, somehow, your function signatures differ by that middle argument. It's a little academic, as on XTensa or RISC-V, an argument pointer to a uint and an argument pointer to a uchar are going to be identical in any case I can think of, but don't be tempted to cast this away - it's probably a sign that you have the wrong actual pointer in use more than just a difference in the type of arguments being used. The ESP types can read a little like Dr. Seuss, as all the types and args start to sound the same at the end of the day. I'd start asking if it's the pointer you think it is BEFORE asking if it points to what you think it should point to.
Signatures change over time, but it's hard to tell if you're really asking about ESP-IDF instead of Arduino. You're almost certainly not asking about the vscode-ide, so this probably belongs in https://github.com/platformio/platform-espressif32. Be prepared to bring enough code for people to SEE and actually reproduce.
This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.