Difficulty with ArduinoBLE example LED sketches

Hi all,

I'm new to networking, and I have a pretty noob question about the example sketches for ArduinoBLE.

My end goal is to use 1 peripheral Arduino Nano 33 BLE, and about 20-25 central Arduino Nano 33 BLE units. The centrals are robots, and the peripheral will know all of their x,y coordinates. I want the centrals to be able to periodically check in with the peripheral (once or twice a second) to find out where they are located.

To start this project, and to start learning how to network, I've got two Nano 33 BLE's working. I've downloaded the:
Examples > ArduinoBLE > Central > LedControl sketch to one board, and the
Examples > ArduinoBLE > Central > LED sketch to the second board.

My presumption here is that these two programs are meant to work together, like a client and a server. Is this assumption correct?

At any given time during testing, both are powered, only one is connected to a computer so that I can look at the Serial Monitor.

When I have the peripheral hooked up to the computer, the Serial Monitor prints:
12:12:31.590 -> BLE LED Peripheral

When I have the central hooked up to the computer, it prints:
12:13:33.644 -> BLE Central - LED control

But nothing else happens (it doesn't report "Connected to central: " or "Connecting ..."), and when I press the button on pin 2 on the central Arduino the peripheral Arduino's LED doesn't go on.

I'm not sure what I'm missing here, and being so new to this area, I don't know where to being troubleshooting. Any advice would be greatly appreciated.

Thanks so much.

When you power your sketch trough a USB power supply or battery pack you need to disable the following line in your sketch first.

while (!Serial);

This will stop your sketch from working when you do not attach the Serial Monitor.

I recommend you get yourself a smartphone app like BLE Scanner on iPhone from bluepixel (maybe also on Android, there are many similar, try a few). This will allow you to quickly test whether the peripheral is working and you can read and write the necessary characteristics and services.

There is a forum sub section for the Arduino Nano 33 BLE and IoT. I recommend you post question about these boards there next time. Scroll down to Products -> Nano Boards (NEW types)

Hi Klause_K,

Thanks so much for your help on this! And thanks also for directing me to the Nano 33 BLE sub section; I will definitely post there in future.

And your suggestion worked--I've been able to get the two boards to talk to one another! :slight_smile: