I have a seeed nrf52840 sense and a tuya bluetooth temperature sensor (this one: https://nl.aliexpress.com/item/1005006117643965.html). The idea is I want the seeed to read the temperature, humidity and battery status of the sensor.
I’m using the latest arduino IDE and installed the bluetooth library (BLE) as zip from it’s github, to ensure I have the latest version.
So far so good. However, whatever I try, i cannot find the sensor, as in it’s address, and so forth.
I installed nrfConnect on my phone, and this found the sensor without issues. From this, I learned the sensor address.
However, this address cannot be found by the nrf52840. It does find almost every bluetooth device in my surrounding, but not my sensor.
This produces no result. I have also removed the wanted address and did a normal ble.scan(). This produces a lot of addresses, but not the wanted one.
On my phone I noticed due to the way it is setup irl, the sensor had a lot lower rssi than other devices. So I wrote code to just find the closest devices. This works, however it does NOT find the tuya sensor.
So you can see it with Nrf_connect for Mobile then You should be able to see it with the Xiao. What code are you using? The basic BLE scanner should yield the MAC address advertising once the device it turned on.
it may time out so, be aware. If it’s a peripheral it’s services should be subscribable for the NOTIFY it sends every 30 Seconds or unless the temps change over a certain Delta (from the product description page)
Which BSP & LIB’s are you using on Xiao mbed or non. ?
Arduino BLE or Blufruit?
HTH
GL PJ
What’s the end goal here?
use the code tags above " </> " paste it in there. we can get you going
So , my bad , code looks good, Tags AOK
Ok , Arduino BLE , Check…
Look at the compiler output , first 3 lines you 'll see at the end which BSP it is using to compile with.
Can you load this example and run it?
Ok, So can you turn on the verbose output in the settings for the compiler output, You will see more useful info that way…
What mobile phone are you using?
It may NOT be a BLE device but a Legacy 4.0 device?
Let’s find out which BSP your using?
GL PJ
FQBN: esp32:esp32:XIAO_ESP32S3:PSRAM=opi
Using board 'XIAO_ESP32S3' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14
Using core 'esp32' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14
this is an ESP output example (first 3 lines) , we are looking for your Nrf52840 FQBN the end of the second line(scroll) tells you the version.
FQBN: Seeeduino:mbed:xiaonRF52840Sense
Using board 'xiaonRF52840Sense' from platform in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3
Using core 'arduino' from platform in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3
So you are using the mbed Board Support Package version 2.9.3.
and the Sammy is AOK…
Appears you do have what should work? The Tuya could be classic BT in which case you can try the NON-mbed BSP’s like 1.1.1 and the BlueFruit (bluetooth) LIB , open the basic scan example and see if it shows it’s colors. Can you show how it looks (what service it advertises) Picture from the nrf_connect mobile app?
If it shows up there, You should be able to read the characteristics and services, sub and get the Notify if the temp or Humidity changes, if not only a update(notification) ever 30 seconds I think the data sheet or sales page said.
Just for grins maybe switch to the 2.9.0 BSP. and do a quick test again. before trying the NON-mbed stuff.
HTH
GL PJ
I’m a big fan of the Nrf_connect for Desktops & the $9 nordic BLE dongle. Makes testing this stuff a breeze
Switched to ‘FQBN: Seeeduino:nrf52:xiaonRF52840Sense’, compiled the scan example from the bluefruit libraries. It shows the same results, the same addresses and not the address i’m looking for.
The device type is LE only, advertising type legacy.
LE General discoverable BR/EDR not supported
So you are welcome for sure, I missed something here? You posted a question, I asked a question, You provided the answer as best you could. I asked you to try some things to troubleshoot your issue. This revealed the answer pretty clearly IMO. (and the compiler showed us that) They are not compatible. The Tuya device is a classic BT device. None of the Nordic devices can hear. I offered and alternative (BT dongle) suggestion.
Not much more juice to squeeze from this one , so if there’s a question in this rhetorical reply ???
I’m here that’s why I answered, I don’t work for Seeed Studio but Paying it forward for there great products and the excellent support I received when I needed it.
HTH
GL PJ
I dunno what you mean by attitude? Seems all cordial to me , but hay I’m older and like animals and technology more than people.
Now, I will say , maybe irrelevant to you… but in your own words its your mobile that was able to see the adverts, My answers and Questions were not just to pass the time… you don’t have to take the advice or tell me what I should or shouldn’t do. What you say to me outside the tech is what’s irrelevant ,WHO the F’ are YOU! anyway.
Beside it’s advertising in Classic mode… So good luck with that.
You seem like a CLOWN just starting trouble. I doubt you could write any code for anything …
You seem like someone who does not know to solve issues, but wants attention and therefor feels the need to answer even questions he knows jack shit about.
It’s not advertising in classic mode. Where did you get that nonsense from. Probably from not reading correctly.