However, when we trigger the power-down as soon as the callback registered with esp_now_register_send_cb() is called, most of the packets are never received. If instead we wait another 300ms (using ets_delay_us(300000)), the transmission is successful. The needed wait appears to depend on the packet size used.
It appears that the sent-callback is called as soon as the CPU has submitted data to the radio, and thus potentially before the radio has actually sent the data. And once the ESP gets powered down, such not-yet-sent data is lost.
Unfortunately, our (extremely limited) power budget requires us to power down at the absolute earliest possible time, so simply delaying for a safe, maximum amount of time is not an option.
Obviously, the CPU must be able to check whether the radio is still buffering data or not (to decide whether submitting more data would result in overflow), but I have not seen that functionality exposed. Is there any API for it? Or possibly just a bit in a hardware register that can be read? Any indication at all which is accessible from a user application?Statistics: Posted by umisef — Thu Dec 17, 2015 3:30 pm
]]>