ESPNow coding issue between ESP8266 & ESP32 #9128
Replies: 9 comments 6 replies
-
works for me on ESP32 Generic and SPIRAM |
Beta Was this translation helpful? Give feedback.
-
I wasn't going to assume that they both the same. Where are you making the interface active before trying to send?
N.B. e0.init() has been replaced with e0.active(True) |
Beta Was this translation helpful? Give feedback.
-
I still don't see where you are making it active. |
Beta Was this translation helpful? Give feedback.
-
As I said I've only posted the reliant code-snippet; and given that the full code runs without error in an ESP8266 all the basic coding; imports, and orders must not be the problem. |
Beta Was this translation helpful? Give feedback.
-
e0.init() might behave differently between the ESP8266 and ESP32 v1.19.1 images. Where ever you are making the interface active in the ESP8266 code try using e0.active(True) instead. |
Beta Was this translation helpful? Give feedback.
-
I have found: |
Beta Was this translation helpful? Give feedback.
-
For both ends of the link you are running power_saving(0) (the default) and both are STA? |
Beta Was this translation helpful? Give feedback.
-
Sent you a PM on the old forum |
Beta Was this translation helpful? Give feedback.
-
@mmliam I know we resolved this outside this discussion - but I thought I'd reply here as well for the benefit of others who may encounter this issue.
This error is returned by the Espressif software stack when sending to a device which has not been registered with The Espressif ESP8266 SDK does not enforce this requirement, but the ESP32 IDF does. While the Espressif ESP-Now API is very similar on the esp8266 and the esp32, they are not identical and even where they are similar, there can be subtle differences in behaviour. If you want your code to be portable between esp8266 and esp32 you should always register the peer with add_peer() before sending messages to that peer. |
Beta Was this translation helpful? Give feedback.
-
ESPNow code runs in ESP8266, throws an error in ESP32.
Code:
The full code runs without error in an ESP8266
In an ESP32 it throws this error:
Line 29 is the eNow.send function.
Both the ESP8266 & ESP32 are using their respective v1.19.1-espnow builds.
Anyone know what's causing the error for the ESP32?
Mike
Beta Was this translation helpful? Give feedback.
All reactions