I add my own annotated tag (v1.19.1-espnow) on the first commit of the espnow-g20-v1.19.1 branch. However, I had not pushed that tag to github. I have done that now. So, after updating your clone/fork, git describe should return v1.19.1-espnow-4-g537248958 (unless I have misunderstood how tags work when pushed upstream ).
ESP-Now support for ESP32 (and ESP8266)
Re: ESP-Now support for ESP32 (and ESP8266)
Re: ESP-Now support for ESP32 (and ESP8266)
Most likely I have done something wrong - I have compiled the vanilla hundreds of times before without any issuesglenn20 wrote: ↑Fri Jul 08, 2022 1:15 amI have encountered similar issues in the past myself. Sometimes it is due to a bug I have introduced or some incompatibility with the IDF version I am using (most common).
A good starting point is to compile a vanilla micropython image without the espnow patches applied and check success with that.
Re: ESP-Now support for ESP32 (and ESP8266)
I cloned your repository and switched to your branch before compiling and getting the 1.13.... tag
Code: Select all
git switch espnow-g20-v1.19.1
Re: ESP-Now support for ESP32 (and ESP8266)
Better- it shows 1.19 as it should
Code: Select all
[mekanix@eb850 g20-1.19.1-07-07-2020]$ git describe
v1.13-1968-g537248958
[mekanix@eb850 micropython]$ git describe
v1.19.1-espnow-4-g537248958
Code: Select all
/home/mekanix> repl
Entering REPL. Use Control-X to exit.
>
MicroPython v1.19.1-espnow-4-g537248958-dirty on 2022-07-08; ESP32 module with ESP32
Type "help()" for more information.
>>>
>>>
Last edited by mekanixms on Fri Jul 08, 2022 6:01 am, edited 1 time in total.
Re: ESP-Now support for ESP32 (and ESP8266)
By the way, works like a charmglenn20 wrote: ↑Fri Jul 08, 2022 12:57 amI have uploaded new espnow-enabled micropython images to: https://github.com/glenn20/micropython-espnow-images.
Hope to see it soon accepted into the main branch
Re: ESP-Now support for ESP32 (and ESP8266)
Thanks for the feedback. I presumed that without my v1.19.1-espnow tag, "git describe" would find the v1.19.1 tag on the master branch. Odd that it didn't.mekanixms wrote: ↑Fri Jul 08, 2022 5:47 amBetter- it shows 1.19 as it shouldCode: Select all
[mekanix@eb850 g20-1.19.1-07-07-2020]$ git describe v1.13-1968-g537248958 [mekanix@eb850 micropython]$ git describe v1.19.1-espnow-4-g537248958
Re: ESP-Now support for ESP32 (and ESP8266)
With that out of the way, I noticed yesterday that, while using irq, the ESPNow object, passed to the callback, does not expose the recv method to read the data.
How should I read the received data from inside the irq's callback??
How should I read the received data from inside the irq's callback??
Re: ESP-Now support for ESP32 (and ESP8266)
Doh - that's an unfortunate regression. I forgot that since I switched to .recvinto() in _espnow, I had to undo the prior changes to the callback api. I had meant to fix that in the espnow.py wrapper module.
In the meantime, you can:
Code: Select all
import espnow
e = espnow.ESPNow()
...
def recv_cb(x):
peer, msg = e.irecv(0)
print(peer, msg) # Replace with your own msg processing code.
e.irq(recv_cb)
Re: ESP-Now support for ESP32 (and ESP8266)
Great, I wait for the fix. Need to use the ESPNow object passed to the callback as I do not have access to the global object, like you show in your code example
Many thanks
Many thanks