🤖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

    Scheduled Pinned Locked Moved General
    3 Posts 2 Posters 7.1k Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post