and about having solutions; you have compiled some examples. Pretty sure you made nothing yourself. I, ont he other hand, did.
Hi there,
LOLā¦
You know you copied my example⦠LOL
Go for it ā¦Get it working Iām sure YOU can.
I copied nothing from you. And itās not your example. Itās an example someone else wrote.
Pls stop thinking youāre the best invention since sliced bread. Youāre not.
Pls if you donāt see the problem, or do not know the answer, then donāt answer.
Hi there,
Ok. LOL sure thingā¦
Iām pretty sure I amā¦
To demonstrate how useless you are⦠I checked. And as the nordic docs say, legacy is pretty normal and has 4 modes. Nordic. You know, the maker of the chip in the XIAO NRF52840 that I use.
Also, most if not all devices in nrfConnect say to be of scanning type legacy, but ARE visible to the XIAO.
In other words: you are hungup on something not relevant. Again.
Great⦠another topic where you didnāt help somoene. Good for you! You like having lots of topics, eh?
Well I found one thing wrong in my code (thereās probably more). I called the BLE.scan() function within the main loop.
This means every time the scan function gets called, even when it is already scanning.
I moved it to the init loop, and now I get more devices. Still not the device Iām looking for tho.
Fun fact: the XIAO itself sais: advertising: legacy in nrfconnect
@zikken - I checked your code āas isā and it didnāt work.
Apart from the #include ArduinoBLE.h (probably a typo?) and the quotes around the peripheral.address() in the Serial.println, I find that the address filter should be set up first.
Soā¦
void setup() {
Serial.begin(115200);
while (!Serial)
;
// Init BLE
BLE.begin();
// Set up address filter
BLE.scanForAddress(wanted, false);
}
void loop() {
BLEDevice peripheral = BLE.available();
if (peripheral) {
Serial.println(peripheral.address());
}
}
I donāt have the same (Tuya) device as you but if this doesnāt work I can create a BLE device here that uses ālegacyā advertising.
Edit> I think the quotes around peripheral.address() may have been on purpose? If so, please ignore remark above
Another Edit> I had an extra BLE.scan() which wasnāt required so removed it above.
The code was a bit of a mashup as Iāve been exerimenting a lot. Your remarks are correct. The quotes was not on purpose, also not used in IRL code.
Basically what you have was about my first try. Which didnāt work and led me down the rabbit hole of finding the address and trying to connect to it.
@zikken - Thanks for the reply.
I will try to create a device that uses legacy advertising and similar Flags and UUIDs to the device you have.
Unfortunately, Iām not sure what other issue it could beā¦
@zikken - I have created a device that only uses legacy advertising and it works with your code.
If possible, from your NRF Connect mobile app, can you enable some settings and send me the resulting data?
There is an āexportā button just below the settings.
I would, but nrfconnect on android doesnāt seem to have those optionsā¦
@zikken - With further investigation there are two possible issues I can think ofā¦
- Scan responses are being filtered at the device (but would than mean NRF Connect would miss the advertisements as well?)
- The device is in basic operating mode (ie sleeps for 10s) then wakes and advertises.
Have a look here - this may be an option?
will take a look.
I was leaning towards the first, was already looking into underlying code.
The second is also true⦠it advertises every 8125 ms.
Regarding nrF Connect for Android⦠There is a drop down menu to the top right with a āShow Logā menu item.
Then at the bottom left of the screen is a drop down with a āVerboseā option. Thereās also ācopy, share and saveā buttons.
You should be able to use those settings and buttons.
You are right!
That yielded this:
nRF Connect, 2025-05-15
TyOS (DC:23:50:25:01:A8)
I 11:46:34.091 [Server] Server started
V 11:46:34.094 Heart Rate (0x180D)
- Heart Rate Measurement [N] (0x2A37)
Client Characteristic Configuration (0x2902)
- Body Sensor Location [R] (0x2A38)
- Heart Rate Control Point [W] (0x2A39)
Unknown Service (0000aaa0-0000-1000-8000-aabbccddeeff)
- Unknown Characteristic [N R] (0000aaa1-0000-1000-8000-aabbccddeeff)
Client Characteristic Configuration (0x2902)
Unknown Descriptor (0000aab0-0000-1000-8000-aabbccddeeff)
Characteristic User Description (0x2901)
Characteristic Presentation Format (0x2904)
- Unknown Characteristic [I W WNR] (0000aaa2-0000-1000-8000-aabbccddeeff)
Client Characteristic Configuration (0x2902)
User Data (0x181C)
- First Name [R W] (0x2A8A)
- Last Name [R W] (0x2A90)
- Gender [R W] (0x2A8C)
V 11:46:34.275 Connecting to DC:23:50:25:01:A8...
D 11:46:34.275 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D 11:46:43.837 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 11:46:43.837 [Server] Device with address DC:23:50:25:01:A8 connected
I 11:46:43.843 [Server] MTU changed to 247
D 11:46:43.861 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 11:46:43.861 Connected to DC:23:50:25:01:A8
V 11:46:43.875 Discovering services...
D 11:46:43.875 gatt.discoverServices()
D 11:46:44.185 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I 11:46:44.331 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D 11:46:44.719 [Callback] Services discovered with status: 0
I 11:46:44.719 Services discovered
V 11:46:44.724 Generic Access (0x1800)
- Device Name [R] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
Client Characteristic Configuration (0x2902)
Unknown Service (0000fd50-0000-1000-8000-00805f9b34fb)
- Unknown Characteristic [W WNR] (00000001-0000-1001-8001-00805f9b07d0)
- Unknown Characteristic [N] (00000002-0000-1001-8001-00805f9b07d0)
Client Characteristic Configuration (0x2902)
D 11:46:44.724 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 11:46:44.727 gatt.setCharacteristicNotification(00000002-0000-1001-8001-00805f9b07d0, true)
I 11:46:45.252 Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)