RP2040 Connect: Problems using ArduinoBLE Lbrary

Hello,

I'm playing around with TensorFlow Lite for Microcontrollers - Experiments with Google.
These samples are designed to work with Nano 33 BLE sense.

Now I want to use my RP2040 Connect with it.
I updated the sensor part in the sketch. Compilation is Ok.

But I encountered some BLE problems when I run the sketch

  • Most of the time I can't get a connection.
  • If I get a connection, "somewhere" data transfer fails.

The sketch uses the ArduinoBLE library.

  • Can this be the source of my problem?
  • Can I use the ArduinoBLE library with RP2040?
  • If not, what library to use?

I'm using the

  • Arduino IDE 1.8.15
  • Board: Ardunio Mbed OS Name Boards / Arduino Nano RP2040 Connect
  • ArduinoBLE library V1.2.1

Thanks
Harald

Welcome to the forum.

I am still on Arduino IDE 1.8.13 (ArduinoBLE library 1.2.1) and just tried a BLE example with Environmental Sensing Service with 3 characteristics. Everything seems to work so far. I can connect and disconnect, subscribe and read all characteristics. Connection seems stable trough a wall.

Did you test any of the library example e.g. BatteryMonitor and some simply WiFi stuff e.g. ScanNetworks?

Hello,

I verified the BatteryMonitor example with the Nano RP2040.
Works as expected when I connect it to nRF Connect on Android. (-42 db, 208 ms)

I verified the BatteryMonitor example with the Nano 33 BLE sense too.
Works as expected when I connect it to nRF Connect on Android. (-62 db, 178 ms)

In short, I'm getting better values with the Nano 33 BLE sense board.

How can this information help to solve my specific problem?
The sample works, so we can assume the ArduinoBLE library ist not the problem?
Then it should be an application problem,,isn't it?

Thanks for you effort,
Harald

Why do you think that? According your data, the Nano RP2040 signal has 100 times more power.

Can you post your code? Use code tags. Click </> and past your code inside. Make sure it all appears in one box. e.g., otherwise the code cannot be copied properly. The new web page contains invisible characters in normal text that prevent compilation.

// Your example code

Also please let me know what additional libraries I might need.

Hello,

Thanks for the clarification on signal strength. My misunderstanding / misinterpretation.

My connection problems are solved.
If the board runs into "troubles" after a failed file transfer, connect fails.
If I reset the board connect always works.

Still open is my transfer problem.

I have one ino file, 3 cpp files and 3 h files.
Do you want me to paste each single file here or shall I put it in an archive?

Thank for your effort,
Harald

I leave this up to you. ZIP file is OK.

Hello,

I attach the sketch I use with the Nano RP2040 Connect board.
I turned on logging in the BLE part of the sketch.
This is what I get in the serial monitor

16:48:19.201 -> Received numClasses: 5
16:48:19.320 -> Received numSamples: 25
16:48:19.440 -> Received threshold: 0.1810
16:48:19.561 -> Received delay: 30
16:48:19.684 -> Received disableMagnetometer: 1
16:48:19.771 -> state is now FILE_TRANSFER
16:48:19.771 -> Received state: 2
16:48:19.811 -> Connected to central: 98:54:1b:48:79:4c
16:48:19.971 -> Received fileTransferType: 0

If I run the sketch for the Nano BLE 33 Sense with logging enabled, i get this output

16:43:08.145 -> Received numClasses: 5
16:43:08.273 -> Received numSamples: 25
16:43:08.401 -> Received threshold: 0.1810
16:43:08.537 -> Received delay: 30
16:43:08.625 -> Received disableMagnetometer: 1
16:43:08.745 -> state is now FILE_TRANSFER
16:43:08.745 -> Received state: 2
16:43:08.745 -> Connected to central: 98:54:1b:48:79:4c
16:43:08.881 -> Received fileTransferType: 0
16:43:09.529 -> Data received: length = 128
...more
16:43:54.582 -> reloading model
16:43:54.582 -> done reloading model

I miss the "Data Received" log entries when I use the Nano RP2040 Connect.

The Nano BLE 33 Sense sketch is available at the web site.

Thanks for taking a closer look at the problem,
Harald

PS: When I try to upload the zip archive, I get a warning
"Entschuldige, neue Benutzer dürfen keine Dateien hochladen" :open_mouth:

So let me upload each single source code file, 7 total.
Again, I get a message
"Entschuldige, neue Benutzer können Beiträgen höchstens 2 Links hinzufügen."

So what shall I do? Stop this (nonsense) or smile? :slight_smile:

Let's stop this journey for now, I can't upload files.
I come back to you when I have the required permissions.

Keep calm,
Harald