[Q]: How to use .write asynchronously
I've got some operations that are quite fragile to timing [multi-threading is not possible] and using network.write in between causes these operations to fail. I only want to write for sending agnostic data back to my master node, so it receiving this data is non-critical. Can I somehow write asynchronously? - I've noticed that the RF24 has a startWrite method, could I somehow use this without having to sacrifice the additional benefits [reliable data transfers] that RF24Network gives me?
RF24Network uses RF24::writeFast() and RF24::txStandby() under the hood.
https://github.com/nRF24/RF24Network/blob/4e804ee5c1479e6ef51d8279eae880c5d367e6e7/RF24Network.cpp#L995-L1000
There is no way to write asynchronously from RF24Network/Mesh. Normally, I'd suggest inheriting from RF24Network and overwriting some behavior, but it wouldn't be that easy because
- messages over 24 bytes long are fragmented into a series of 24 byte payloads with changing
RF24NetworkHeaderinfo. - Receiving payloads (during
network.update()) isn't designed for using interrupts.
I think your best approach is to separate out some of the logic in your app to different processors. The RP2040 seems well suited for this because it is a dual-core processor.