ESP-NOW uiflow callback function not triggering
-
Hello All,
I cannot get the uiflow espnow callback(espnow.recv_cb(recv_cb))
to trigger from espnow messages sent from an Arduino IDE based or none-M5Stack micropython based ESP32. I can send and receive espnow data between 2 Arduino IDE based ESP32s. I can also send and receive espnow data between 2 uiflow M5Stack ESP32s. And I can also send and receive espnow data between an Arduino IDE and none-M5Stack micopython based ESP32.I using a Core2 and M5StickC Plus for testing.
The message is sent successfully based on
esp_now_register_send_cb(OnDataSent);
callback function in Arduino IDE. And if I power down the uiFlow ESP32 device the message fails to send, expected behavior. So I believe everything it set up correctly.I can send data from a uiFlow ESP32 to a Arduino IDE based ESP32. Although there seems to be a data alignment issue.
Has anyone been able to send espnow messages from a non-uiflow ESP32 to a uiflow ESP32?
How this make sense!
Thank you
Austin -
Hello All,
Me again. After doing some testing I determined that the uiFlow code is adding 10 bytes of information (preData
) to the beginning of the text being sent. Maybe some type of checksum. This can be seem here.Most the
preData
bytes are constant, either1
or0
. Below ispreData
I created in the Arduino IDE and sent to a M5StickC Plus to get the receive callback to be triggered.// Sent from Arduino IDE, ESP32, #include <esp_now.h> // The 3 combinations for header3, header5, header6 and cmd after the comment (//) trigger the uiFlow receive callback. // Changing any of the values causes the uiFlow receive callback not be to triggered // There must be a some type of checksum calculation within the M5Stack uiFlow code. data.header1 = 1; data.header2 = 1; data.header3 = 0; // 0, 1, 2 Seems to be a counter, rolling over a 255 data.header4 = 0; data.header5 = 222; // 222, 249, 144 Seems to be a checksum of some kind data.header6 = 67; // 67, 111, 27 Seems to be a checksum of some kind data.header7 = 0; data.header8 = 0; data.header9 = 0; data.header10 = 0; strcpy(data.cmd, "on");// on, on, on esp_now_send(broadcastAddress, (uint8_t *)&data, sizeof(data));
Can someone point me to the code which creates the 10 bytes of information?
Thanks You
Austin -
Hello M5Stack,
Can you please post the function used to create the 10 bytes ofpreData
when sending an espnow message from a device coded with uiFlow?This will allow us to send espnow messages from devices not coded with uiFlow to devices coded in uiFlow.
Thanks you
Austin