mekanixms wrote: ↑Fri Jul 08, 2022 9:36 am
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??
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)
Thanks for the bug report. Clearly I need to include some tests against the callback api in the test suite. I'll post a fix soon.