I got two errors, first one is:Exception (28): epc1=0x402064ec epc2=0x00000000..., the other one is: ets Jan 8 2013,rst cause:2, boot mode:(3,6)

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

And what did you get when you put the text between --------------- CUT HERE FOR EXCEPTION DECODER --------------- through the Exception Decoder?

by the way, the variable "timeinterval" doesn't needed in this section

sometimes it's like this:

����x�n��>r���n�b � � rb�e� ���a��l�<��n���l`e�>r�8e��l # � �----------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (28):
epc1=0x402064ec epc2=0x00000000 epc3=0x00000000 excvaddr=0x000d9e53 depc=0x00000000

stack>>>

ctx: cont
sp: 3ffffd00 end: 3fffffd0 offset: 0150
3ffffe50: 4020001c 00011454 0000fa00 00000006
3ffffe60: 00000001 5319f75a 426ef054 40201b25
3ffffe70: 0000002b 45000000 3ffffeb0 40201b71
3ffffe80: ffffffff 00000000 3ffee5e0 40201465
3ffffe90: 00000000 00000000 000d9e43 3ffef76c
3ffffea0: 0101001c 00000000 00000020 00000000
3ffffeb0: 3ffffe90 00000302 00000000 401020c0
3ffffec0: 3ffe8f50 40232e67 3ffef76c 40201706
3ffffed0: 00000000 00000000 3ffe85e4 401006ce
3ffffee0: 010e003b 00000300 b374bc6a 00000000
3ffffef0: 3ffef708 00000020 3ffef73c 3fffff88
3fffff00: 3fffff64 0000037c 3ffee5e0 40201983
3fffff10: 3fffff40 3ffef73c 3ffee5bc 40218126
3fffff20: e0508206 3ffef71c 3fffdad0 3ffee81c
3fffff20: e0508206 3ffef71c 3fffdad0 3ffee81c
3fffff30: 3fffdad0 00000000 3ffee5bc 4020118b
3fffff40: 00000024 00000000 0000000d 00000000
3fffff50: 0000037b 420fd973 00000000 00000000
3fffff60: 00000000 00000001 00000000 00000004
3fffff70: 00000000 0000037b 40fc022e bef4a711
3fffff80: 00000000 00000000 00000001 00000000
3fffff90: 00000001 00000000 0000037b 3ffee81c
3fffffa0: 3fffdad0 00000000 3ffee7f0 3ffee81c
3fffffb0: 00000000 00000000 3ffee7f0 402037b4
3fffffc0: feefeffe feefeffe 3fffdab0 40100dc9
<<<stack<<<

--------------- 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
����8�n��r���n�b � � rb�e� ���a��l�<

and i guess
the first nonsense and the last one is the same thing

If you won't answer a simple, direct question then I'm done.

it's here

please~~~

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:

����x�n��>r���n�b � � rb�e� ���a��l�<��n���l`e�>r�8e��l # � �----------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (28):
epc1=0x402064ec epc2=0x00000000 epc3=0x00000000 excvaddr=0x000d9e53 depc=0x00000000

> > > stack>>>

ctx: cont
sp: 3ffffd00 end: 3fffffd0 offset: 0150
3ffffe50: 4020001c 00011454 0000fa00 00000006
3ffffe60: 00000001 5319f75a 426ef054 40201b25
3ffffe70: 0000002b 45000000 3ffffeb0 40201b71
3ffffe80: ffffffff 00000000 3ffee5e0 40201465
3ffffe90: 00000000 00000000 000d9e43 3ffef76c
3ffffea0: 0101001c 00000000 00000020 00000000
3ffffeb0: 3ffffe90 00000302 00000000 401020c0
3ffffec0: 3ffe8f50 40232e67 3ffef76c 40201706
3ffffed0: 00000000 00000000 3ffe85e4 401006ce
3ffffee0: 010e003b 00000300 b374bc6a 00000000
3ffffef0: 3ffef708 00000020 3ffef73c 3fffff88
3fffff00: 3fffff64 0000037c 3ffee5e0 40201983
3fffff10: 3fffff40 3ffef73c 3ffee5bc 40218126
3fffff20: e0508206 3ffef71c 3fffdad0 3ffee81c
3fffff20: e0508206 3ffef71c 3fffdad0 3ffee81c
3fffff30: 3fffdad0 00000000 3ffee5bc 4020118b
3fffff40: 00000024 00000000 0000000d 00000000
3fffff50: 0000037b 420fd973 00000000 00000000
3fffff60: 00000000 00000001 00000000 00000004
3fffff70: 00000000 0000037b 40fc022e bef4a711
3fffff80: 00000000 00000000 00000001 00000000
3fffff90: 00000001 00000000 0000037b 3ffee81c
3fffffa0: 3fffdad0 00000000 3ffee7f0 3ffee81c
3fffffb0: 00000000 00000000 3ffee7f0 402037b4
3fffffc0: feefeffe feefeffe 3fffdab0 40100dc9
<<<stack<<<

--------------- 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
����8�n��r���n�b � � rb�e� ���a��l�<

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++;
    }
  }
}

➜ install the exception decoder in the IDE and use it to find out what's going on

(I added code tags around your serial dump as it looks ugly otherwise - please pay attention to how you format things when posting).

1 Like
void OnDataSent(uint8_t *mac_addr, uint8_t sendStatus){ 
. . .
. . .
}

Possibly, the above call back routine should be kept in IRAM (instruction RAM) like this:

void IRAM_ATTR OnDataSent(uint8_t *mac_addr, uint8_t sendStatus){ 
. . .
. . .
}

Newer releases of the Arduino ESP8266 core are much stricter in this respect, which could mean code which did work on an older release now crashes.

However, you should anyway follow the advice to use the exception decoder.

1 Like

@arthsu5158, please do not cross-post. Threads merged.

1 Like

unfortunately, it still appear the same error message after I added the "IRAM_ATTR" instruction

I installed the exception decoder in IDE properly, however it keep showing that it can't recognize my stack trace.
I tried pasting all messages between two
------CUT HERE FOR EXCEPTION DECODER --------
and i tried pasting messages just between
>>> stack>>> and <<<stack<<<
neither ways worked

i solved this problem
i done it by pasting from >>>stack>>> to <<<stack<<< including these two instruction

the following message is the result, however i don't understand what it means.

Decoding stack results:

摘要

0x40203748: loop_wrapper() at C:\Users\arths\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266\core_esp8266_main.cpp:263
0x402015e4: Adafruit_MPU6050::_read() at c:\Users\arths\OneDrive\���\Arduino\libraries\Adafruit_MPU6050\Adafruit_MPU6050.cpp:646
0x40205140: run_scheduled_recurrent_functions() at C:\Users\arths\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266\core_esp8266_features.h:64
0x402018ff: is in Adafruit_MPU6050::getEvent(sensors_event_t*, sensors_event_t*, sensors_event_t*) (c:\Users\arths\OneDrive\���\Arduino\libraries\Adafruit_MPU6050\Adafruit_MPU6050.cpp:712).
0x40201107: loop() at C:\Users\arths\OneDrive\Desktop\magic_stick\testing\sender_test\sender_test.ino:67
0x40100af0: malloc(size_t) at C:\Users\arths\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266\umm_malloc\umm_malloc.cpp:912
0x40100d6c: is in calloc(size_t, size_t) (C:\Users\arths\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266\umm_malloc\umm_malloc.cpp:1274).
0x40100d5e: is in calloc(size_t, size_t) (C:\Users\arths\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266\umm_malloc\umm_malloc.cpp:1268).
0x40203730: loop_wrapper() at C:\Users\arths\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266\core_esp8266_main.cpp:258

At a quick look it appears to complain about this statement in your code:

Post a link to the code sample which you used as the basis for your own solution.

1 Like

where can i find this link
i don't understand what you mean
i am really sorry
please rephrase it so that it is more easy for me to understand
thanks

You are missing the initialization of the mpu instance in the setup after Serial.begin()

  // Try to initialize!
  if (!mpu.begin()) {
    Serial.println("Failed to find MPU6050 chip");
    while(true) yield();
  }
  Serial.println("MPU6050 Found!");

So later the getEvent() call fails due to some memory reasons

1 Like

ok i will try this way