Skip to content

Avatar library don't work with WiFi On #65

@sweemeng

Description

@sweemeng

Describe the bug
Code crash in setup() when Avatar library and WiFi is used together. There is no compilation error.

To Reproduce
Compile the following source code, in platform IO, upload to M5Stack-fire. View the serial monitor.

#include <Arduino.h>
#include <M5Stack.h>
#include <WiFi.h>
#include <Avatar.h>

using namespace m5avatar;

const char* ssid = "ssid";
const char* password = "passwd";
Avatar avatar;

void setup_wifi(){
  delay(10);
  WiFi.begin(ssid, password);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  while(WiFi.status() != WL_CONNECTED){
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

void setup() {
  M5.begin();
  Serial.begin(115200);
  Serial.println("Init wifi");
  setup_wifi();
  Serial.println("Init avatar");
  avatar.init();
  Serial.println("Done");
}

void loop() {
  // put your main code here, to run repeatedly:
}

Platformio config is here

[env:m5stack-fire]
platform = espressif32
board = m5stack-fire
framework = arduino
monitor_speed = 115200

lib_deps = meganetaaan/M5Stack-Avatar@^0.7.3

Expected behavior
Code should work run on m5stack-fire. It should not cause the device to rebook.

Logs
If any compile error occurs, add a full compile log.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows
  • IDE: VSCode with PlatformIO plugin
  • Versions
  • This library(M5Stack-Avatar): M5Stack-Avatar@^0.7.3
  • M5Stack: 0.3.4

Additional context

This is run on M5Stack-fire

Output from serial monitor when running the code

Init wifi

Connecting to ssid
.....
WiFi connected
IP address:
192.168.0.149
Init avatar
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (drawLoop)

ELF file SHA256: 0000000000000000

Backtrace: 0x4008bc54:0x3ffcc910 0x4008d212:0x3ffcc920 0x4008d391:0x3ffcc9f0 0x4008d675:0x3ffcca10 0x40089422:0x3ffcca30 0x4008d1d1:0x3ffccaf0 0x4008d44d:0x3ffccb10 0x4008918d:0x3ffccb30 0x400892b9:0x3ffccb60 0x400f5bef:0x3ffccb80 0x400f1efd:0x3ffcce40 0x400f1e98:0x3ffcce90 0x4008f475:0x3ffccec0 0x40091483:0x3ffccef0 0x40091abd:0x3ffccf10 0x40081f59:0x3ffccf30 0x40082130:0x3ffccf50 0x400815d7:0x3ffccf70 0x40142979:0x3ffccf90 0x401429fe:0x3ffccfb0 0x400d5eec:0x3ffccfd0 0x400d5243:0x3ffcd010 0x400d526f:0x3ffcd060 0x4008e452:0x3ffcd080

Rebooting...
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions