@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.