Argon BLE as peripheral - connect to it using its MAC address

I'm using an Argon as a peripheral BLE device. I can use iOS apps such as BLE Scanner and Bluefruit to connect to it all day - no problem with reads/writes etc. Works great.

Next, I have a Boron which is currently connecting to a third-party peripheral using that device's BLE MAC address (i.e. I do not use scan in the Boron) and after connecting it polls for data. Works great.

I grabbed the BLE MAC address from the Argon device using BLE.address() and
I added this address to the Boron polling list, but it simply won't connect.

Below I even byte swapped address [0] into [1] to make sure that wasn't an issue.
BleAddress ShellyAddress[2] = {"1D3FB6A1F9C7","C7F9A1B63F1D"}
peer = BLE.connect(ShellyAddress[0]);
peer = BLE.connect(ShellyAddress[1]);

It just doesn't connect. Is there something that needs to be performed on the Argon during setup to allow it to be connected to via its MAC address?

When you specify the BLE MAC address using a string, it defaults to type PUBLIC, and I presume the address you are connecting to is not public. In BLE, public means the address is registered with IEEE.

This page seems to be a good summary of address types.

These are the available types:

enum class BleAddressType : uint8_t {
    PUBLIC                          = BLE_SIG_ADDR_TYPE_PUBLIC,
    RANDOM_STATIC                   = BLE_SIG_ADDR_TYPE_RANDOM_STATIC,
    RANDOM_PRIVATE_RESOLVABLE       = BLE_SIG_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE,
    RANDOM_PRIVATE_NON_RESOLVABLE   = BLE_SIG_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE
};

These are the available BLEAddress constructors:

    BleAddress(const hal_ble_addr_t& addr);
    BleAddress(const uint8_t addr[BLE_SIG_ADDR_LEN], BleAddressType type = BleAddressType::PUBLIC);
    BleAddress(const char* address, BleAddressType type = BleAddressType::PUBLIC);
    BleAddress(const String& address, BleAddressType type = BleAddressType::PUBLIC);
1 Like

Thanks Rick!

Adding BleAddressType::RANDOM_STATIC did the trick on the central side. All is connecting.

A separate question: I see that the Argon by default is also showing uuid's starting with 6FA90003. I see that these are Particle BLE specific (google). Not that it matters, but any way to get rid of them? I tried BleAdvertisingData clear(). It did not work, and I cant see anything else that might do it.

Thanks so much for your help!

Are you seeing those services when the device is in normal operating mode? They should only appear when the device is in listening mode (blinking dark blue) so the Wi-Fi can be configured over BLE. You can also use up provisioning mode which uses your own UUIDs instead of the Particle UUIDs.

1 Like

Yes, normal operating mode breathing cyan. They are always present alongside the uuids Iā€™m adding (characteristics). I even tried not adding mine and they (particle ones) appeared as soon as I advertised data.

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