🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    BLE arduino libraries crashing on M5 stack

    General
    2
    3
    5.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rob.biernat
      last edited by

      Hi,

      I'm writing some code that uses BLE to discover a couple of sensors. I've been able to initialise the BLE library, scan for a device and succesfully match the service UUID with the one I'm interested in. However once I want to do something with services characteristics my M5 crashes with the following error when I call

        std::map<std::string, BLERemoteService*>* servicesMap  = pClient->getServices();         
        for (auto &myServiceEntry : *servicesMap)   
        {
          BLERemoteService* svc = myServiceEntry.second;
          Serial.printf("Service found on Device: %s \n",  svc->getUUID().toString().c_str());
      
          if (svc->getUUID().toString() == myUUID)
          {   
            Serial.println("Searching for characteruistics");        
      
            std::map<std::string, BLERemoteCharacteristic*>* characteristics = svc->getCharacteristics();
            
            Serial.println("Finished search");
                
          }        
        }
      

      results in

      Finished search
      E (9180) FreeRTOS: FreeRTOS Task "loopTask" should not return, Aborting now!

      Backtrace: 0x40091e8c:0x3ffcaac0 0x400920bd:0x3ffcaae0 0x4008ddef:0x3ffcab00

      Rebooting...

      Has anyone used the BLE libraries with the M5? My understanding is the BLE libraries are now part of the ESP32 libraries for arduino and I am currently using ESP21 1.0.2

      Thanks

      1 Reply Last reply Reply Quote 0
      • G
        Gero Nimo
        last edited by

        Hmm had something similar some time ago. Check for null values e.g. empty fields on the ble device.

        1 Reply Last reply Reply Quote 0
        • R
          rob.biernat
          last edited by

          I have no control over the ble server device. It appears the ble libraries are just flaky

          1 Reply Last reply Reply Quote 0
          • First post
            Last post