We are using the nRF52840 DevKit with our BLE peripheral app and after connecting on iPhone (iOS11) and trying to read the RSSI (readRSSI() from CoreBluetooth with SWIFT) the values are always invalid, mostly 0. We tried third party apps and the same occurred. When trying to actively read the RSSI on the peripheral side the RSSI is OK.
Is there any reason to justify this? Do you have any suggestion to solve it?
That's pretty normal for iOS. CoreLocation is even worse as with it when the location accuracy goes below a certain threshold it will report 0 for RSSI. But generally it occurs earlier for CL. Normally at about 30 feet. With CB you can normally get out to about 100 feet before it acts up.
I don't have my resources at hand, but the 0 will also get reported at +128dBm depending on how you format the data coming back from the API call.
In our applications, I just reuse the last good value and then keep a rolling average of good values. Some iPhones are worse than others. The iPhone 5(c) are the worst of BLE4+. Everything 6 and up is pretty comparable in performance.
I have never seen it to be BLE device dependent. And have tested many, many different beacon types with the same results.
One thing to remember also is that after about 2 minutes of getting data from CB, the OS will cut back on your resources and you will get many fewer data points from your advertisements.
Thank you for your reply.
We are interacting with iphone and Nordic BLE peripherals for 4years and never had these issues. We are using iPhone8 with iOS11 and it reads RSSI on advertise without any problems, the issue occurs when reading RSSI after connecting to the nRF52840-based peripheral. Also, Android phones don't seem to have this problem and the iPhone reads RSSI fine after connecting to peripherals based on nRF51822.
Is there any justification for this?
This is an odd problem. Since it reports correctly when not connected but wrong when connected.
I searched a bit. There was a bug in iOS10.1 that was precisely this problem that connected peripherals would not report an RSSI value. But of course 10.1 was a long time ago.
Happy to test them side by side next chance I get. But otherwise haven't heard or seen this phenomena.
Hopefully Nordic or someone else has some input.
"readRSSI()" only after you have connected by "centralManager" object.You need also implement "peripheral(_:didReadRSSI:error:)" delegate in order to received the value.If it fails, it reports the error.
"readRSSI()" only after you have connected by "centralManager" object.
peripheral(_:didReadRSSI:error:)" delegate in order to received the value.If it fails, it reports the error.