due to the text length limit, i will paste whole error messages i got bellow the following description.
i'm just testing if i can get the data from a mpu6050 board and send it from
a D1 mini board to another one. the receiver works really well, however the sender sometimes stopped with the error message mentioned downward.
here's the error message:
first one:
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (28):
epc1=0x402064ec epc2=0x00000000 epc3=0x00000000 excvaddr=0x0002bb59 depc=0x00000000
stack>>>
ctx: cont
sp: 3ffffd00 end: 3fffffd0 offset: 0150
3ffffe50: 4020001c 40b18ccf 000003e8 4e252d17
3ffffe60: 00004c95 4e252d16 00000000 40201b25
3ffffe70: 00004c17 45000000 3ffffeb0 40201b71
3ffffe80: 00000000 3fffdad0 3ffee5e0 40201465
3ffffe90: 00000000 00000000 0002bb49 3ffef76c
3ffffea0: 0101001c 00000000 00000020 00000000
second one:
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3424, room 16
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8
tail 0
chksum 0x2b
csum 0x2b
v00045370
~ld
here's my code
#include <espnow.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <espnow.h>
unsigned long timeinterval=100;
Adafruit_MPU6050 mpu;
uint8_t ServerAddress[] = {0x2C, 0xF4, 0x32, 0x4F, 0xD1, 0x28};
typedef struct info_struct {
float gyro[3];
float acc[3];
int mode,ID,place;
} info_struct;
info_struct OutputInfo;
const int BUTTON= D4;
int LastButtonState=HIGH,COB=0;
void OnDataSent(uint8_t *mac_addr, uint8_t sendStatus){
Serial.print("Packet to:");
for(int i=0;i<6;i++){
Serial.print(mac_addr[i]);
Serial.print(" ");
}
Serial.println(" ");
Serial.print(" send status: ");
if (sendStatus == 0){
Serial.println("Delivery success");
}
else{
Serial.println("Delivery fail");
}
}
void setup() {
//to intialize wifi
// Set device as a Wi-Fi Station
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.disconnect();
// Init ESP-NOW
if (esp_now_init() != 0) {
Serial.println("Error initializing ESP-NOW");
return;
}
esp_now_set_self_role(ESP_NOW_ROLE_CONTROLLER);
// Once ESPNow is successfully Init, we will register for Send CB to
// get the status of Trasnmitted packet
esp_now_register_send_cb(OnDataSent);
// Register peer
esp_now_add_peer(ServerAddress, ESP_NOW_ROLE_SLAVE, 1, NULL, 0);
}
void loop() {
OutputInfo.ID=rand()%1000;
OutputInfo.mode=0;
OutputInfo.place=0;
// put your main code here, to run repeatedly:
if(digitalRead(BUTTON)==LOW){
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
OutputInfo.gyro[0] = g.gyro.x;
OutputInfo.acc[0] = a.acceleration.x;
OutputInfo.gyro[1] = g.gyro.y;
OutputInfo.acc[1] = a.acceleration.y;
OutputInfo.gyro[2] = g.gyro.z;
OutputInfo.acc[2] = a.acceleration.z;
esp_now_send(0, (uint8_t *) &OutputInfo, sizeof(OutputInfo));
}else{
if(COB==0){
Serial.println("----------");
COB++;
}
}
}
please help me deal with this problem
lastly, this is my first post, if there are any other advice, please let me know