ArduinoBLE library consume 95% of program storage

I use Arduino UNO Wifi Rev2 and my code is below:

#include <ArduinoBLE.h>

void setup() {
  // put your setup code here, to run once:

}

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

}

This already says that it uses 95% of program storage space. Does BLE really take up that much storage space?
Is there a way to just use some functions of the library and not include the whole library instead?

If no, is there a better alternative for BLE?
The project aims to have multiple Bluetooth arduino/Microcontroller as temperatute sensing peripherals then a single arduino/Microcontroller that will connect to each one and get the temperature details

This looks to be exactly the same topic discussed here before, I haven't read all the 27 posts, but see if it somehow answers your question:

Hello I also have read this thread. The thread mostly says that Arduino UNO wifi Rev2 is not practical for BLE. So I guess it answers that the BLE library really has high size.

However it does not say whether it is possible to just select the needed functions of the library. In an analogy, like python "from (library) import (functions). I wonder if arduino has the same thing.

Nonetheless, Thank you for the reply

As an author of that referenced topic after a significant time of researches - I can answer your question in this way: just forget about Arduino WiFi Rev2. Use R4 WiFi or other MCUs - like ESP32 or Raspberry Pi Pico W.
It's not possible to just choose neccesary functions from BLE (like python's style), but you essentially won't need it with modern MCUs as they have much more memory to handle that bs from BLE.

Update: Also check the link from replies in my post if you want - they are working with Nano33 IoT and it seems like feasible solution, but by that time I already switched to R4 Wifi so I didn't try that. Maybe you'll have success with that.

2 Likes

@cloudfone @voxifer
For anyone who is still running into this problem, you can actually downgrade the version of the ArduinoBLE library to 1.2.2 and the usage goes down from 89% to 70% on an Arduino Uno WiFi Rev2 . The library size seems to have increased considerably at 1.3.0 -- 70% is still a lot but definitely more reasonable than 89%. Hope that helps!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.