BLE AdvertisementData returns empty []

... You are right! I have been too long without a coffee......

Yeah i know about adafruit and power, but i am now at a state that I am desperate to get my data into MIT. Once that works I can probably go back, because then I know what i am doing wrong...

I'm just compiling a Sketch.
You are using a recent Arduino IDE right?
And you have uploaded the Seeed Lib for XIAO?

Thanks Chris , yeah Ive got both
and using the nrf52840

Well here is the News - ArduinoBLE.h (On my PC) is apparently not compatible with the XIAO boards. I have compiled a version of LED1.ino as LED2.ino with the function niggles fixed (for example, add the Service before adding the Characteristic to the Service). Compiles for Arduino BLE boards, but for the Seeed XIAO nr52840, it verifies but fails to compile:

Arduino: 1.8.18 (Windows 7), Board: "Seeed XIAO nRF52840, S140 7.3.0, Level 0 (Release)" ArduinoBLE at version 1.3.6
Error compiling for board Seeed XIAO nRF52840.

LED2.ino (3.0 KB)

did you select the non mbed version of the board?

I am now back to where I started. by also changing to yet another uuid.
I now get the empty array returned again. When I change the uuid or user_data2 it goes to null.
so everything okay: advertismentData returns

ino:
test2.ino (2.4 KB)

aia
Advertise_test7.aia (278.2 KB)

oh wauw i got it!
had to add some data to the user_data2 array
at last.

Thanks Chris for your help. It is very much appreciated!!
I know a lot more about BLE, thats for sure!

Yes I did. Note that the Arduino Nano 33 also uses nRF52840 and the Sketch compiles for it.

I have the seeed xiao nrf52840

Can I see the Sketch?

yes ofcourse! :
test2.ino (2.2 KB)

it did not show the data, because there was none...

by the way, strictly speaking this is not sending manufacturer data, but adv. servicedata.
But for now: Fine!

1 Like
#include <Adafruit_TinyUSB.h> //For Serial

//Chars must be within ASCII A-Z, a-z
char user_data2[8] = {0x41,0x42,0x43,0x44,0x45,0x46}; 

Hi, dont know what your point is,but user_data2 needs the two uuid bytes (0x1c, 0x18) in the first two positions. Otherwise data is not returned

Well that's interesting - if I compile the Sketch (IDE 1.8.18) it fails on those bytes. I assume they are 'flags' specific to the XIAO then. Am I right in thinking you have a higher version IDE?

yeah, the latest, 2.3.2

I believe you need to read out each character of the advertisement and reverse the order?

yes, at least with my setup. all uiid's need to be correct.