I try to compile and get this:
"Sketch uses 43677 bytes (89%) of program storage space". Seriously? This library is absolutely not utilizable.
Ok, is there any other alternative library that I can use for just sending bytes in and out over the bluetooth? I see a lot of example that use a separate serial comm which I would be ok with.
Any suggestions would be much appreciated. Thanks.
Your code will load correctly, run properly and do exactly what you told it to do, nothing! I suggest you get the Arduino Cookbook, skim it then start at the beginning and follow the examples. Start with the Blink program. Hint: You can load any library you want but if you make no calls to it it will do nothing and probably be optimized out of your code.
I do undrstand that. I already run the bluetooth connection code normally.
My point is that I essentially can't connect any more libraries. I just added this: #include <WiFiNINA.h>
and the size increased to 94% leaving me with just 6% of memory. I will also need couple more libraries that will take me to about 96-98%. What kind of useful program can I make in 2-4% of the rest of memory?
My question is how can I utilize this on-board bluetooth chip without using all unnecessary staff that is in ArduinoBLE library? I don't think I need majority of it, I don't even need BLE, I could use just regular bluetooth connection, if there's a respective library (or API so I can create my own commands) rendering my memory free.
I know that it's mostly unneccesary by reviewing the code for a wireless module HC-05 which doesn't need any library at all (it works via a serial pipe) and which is used as an example of BT connections with Arduino everywhere in internet. So I was hoping I could have a similar approach with built-in chip.
you're completely correct, I understand that.
But as I mentioned - I would be ok with BT classic if this chip allows that. I do not need any functionality that BLE suggests over BT classic. All I need - is to transfer several bytes back and forth as it's done via HC-05
Ok, after studying what they've done - I tried to follow the sequence that user F14V suggested and I'm stuck at step 4. During uploading the sketch SerialToSerialBT into NINA module - it doesn't seem to work:
Sketch uses 1037645 bytes (79%) of program storage space. Maximum is 1310720 bytes.
Global variables use 39340 bytes (12%) of dynamic memory, leaving 288340 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port COM7
Connecting......
A serial exception error occurred: Write timeout
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool.py latest documentation
Failed uploading: uploading error: exit status 1
Do you have any idea what I should pay attention to since I use WiFi Rev2 instead of NANO? Google doesn't seem to be able to help in this case.
I don't have any Serial Monitors open and I double-checked I choose the proper board and all settings. Arduino sketch uploaded on the previous step tells that it's "Waiting for download..."
I bought a ESP32 controlled board and tried to do the same. Initially I got the same result - 80% of memory is occupied by the BLE library. But then I managed to change the partitioning for the board to remove OTA-reserved part and now my empty program with BLE library takes only 33% - exactly what I needed.
Question - is it possible to do the same with Uno WiFi Rev2? Or this board just naturally has less memory? I don't see the option of repartitioning Uno WiFi Rev2, but maybe there's hidden way to do that.
Thanks.
I'm also new in Arduino and I confirm that the Uno Wifi Rev2 board is not fully suitable for BLE. The space taken by ArduinoBLE.h is a real problem. So, how to use the board except for a very small sketch? When we buy this board, we should know this.
Moreover, the Bluetooth connection cannot be made everytime because very often the board doesn't appear when scanning Bluetooth devices. We have to restart the board may times to get a chance to connect.
So, is there a board with much memory and BLE or Bluetooth feature? I just see the Bluno board by DFRobot but based on ATmega328.
It's a pity that Arduino doesn't propose a board with 256 Kb and Bluetooth or BLE feature. So, it seems that we have to use the HM-10 module. Does somebody have an experience with it? Is it always recognized?
As I mentioned at the time if the post, I ended up using ESP32 board. But since then Arduino Uno R4 WiFi came out which has ESP32 co-processor on board. ArduinoBLE library doesn't work out of the box as it's is still in test mode for it, but after installation of test version of the library it works ok and the basic sketch with Bluetooth takes only 29% which gives plenty of room for the program.
So essentially Arduino Uno Rev2 WiFi is just not for Bluetooth.