Read Bluz DK RSSI From Gateway


#1

Hi,

I have a Bluz Gateway (with Photon) and a couple of Bluz DK’s.

My scenario is I would like to read the RSSI of the DK’s from the Gateway whenever they come within range. I understand that the IOS/Android app is able to detect the RSSI but I can’t figure out how to do this in the Gateway. I’ve read the following related post although I’m not sure if the comments there mean that this feature is still WIP or if there is some other way to accomplish my goal:

At this point I don’t care about Particle cloud communication. I just want the Gateway to detect the Bluz DK RSSI and then (for now) I’ll stream the data over the Photon USB connector to a PC.

I’m not sure if the Bluz DK needs to be in a “connected” state to accomplish this or just an “advertising” state (I assume the latter).

On a related note, I tried the local communication tutorial to see if I could tweak that somehow to get the RSSI value, but I can’t seem to get the Gateway and the DK to see each other (the firmware doesn’t report any connected devices). The IOS app can see the DK with no problems though.

http://docs.bluz.io/tutorials/local_communication/

Hopefully my simple use case is clear but I can provide additional clarification if necessary. Any help would be greatly appreciated.

Thanks,
Mike


#2

As of now, there is no way to read the RSSI from the gateway shield. However, you can probably still do what you like.

In local communication mode, the DL will not connect to the cloud. So what you can do is put the DKs in that mode, and then when you connect to the gateway shield read the RSSI from the gateway shields side and transmit it to the gateway shield. That would work just fine.

Let me know if that makes sense.


#3

@eric,

Yeah, I understand what you mean. I am working through this now trying to get it set up.

When the DK is in local communication mode, is it expected for the Status LED on the DK to be turned off? (not blinking any color) The Power LED on the CR2032 battery board is still white though.

Thanks,
Mike


#4

No, the LED should blink white. You can see the different LED states in our doc: http://docs.bluz.io/tutorials/states/

Does your code call RGB.control()? That would override the state of the LED and turn it off.


#5

@eric,

No, I’m not calling RGB.control(). I’m at the point now where the Gateway seems to be working correctly-- the CONNECTION_RESULTS event shows the Bluz DK is connected to the Gateway.

However, the Bluz DK itself is stuck in Safe Mode (blinking yellow) no matter what I try. I’ve been trying to use the Particle Build IDE to flash the DK firmware in combination with the Bluz DK app on my phone. These are the steps I’m trying:

  1. Bring Bluz DK online by connecting to it from the IOS phone app (this seems to work fine, although sometimes the app crashes for no reason); it’s in a blinking yellow state already at this point
  2. In Build IDE, click Flash; the flash proceeds and I see the following messages (in this order):

spark/safe-mode-updater/updating (1)
spark/flash/status (started)
spark/flash/status (success)
device went offline

…at this point the Bluz DK LED is just blinking magenta as if it’s processing an OTA update, but it just stays in this state forever until I manually reset the DK. After the reset it just goes back to blinking yellow.

Any thoughts on what is going wrong here? On a related note, in the Build IDE I have the “System Firmware Target” for the DK set to 2.3.50 but it never seems to update during the flash. The current reported value is 2.1.50.

Thanks,
Mike


#6

@eric,

Just after I typed this I tried to flash the firmware again and this time it made it all the way through (the system firmware was updated to 2.3.50 and it came out of safe mode). And the RSSI retrieval technique works! I see the blinking white light on the DK as well.

One problem though. I’m sending the data to the gateway using BLE.sendData() once per second, but it seems to arrive at the gateway in chunks every 30 seconds or so (instead of every second). So for example I’ll see 30 RSSI values logged in the gateway at the same time. Is there some config/behavior that is controlling this?

Thanks,
Mike


#7

Glad it is working!

Not sure about the 30 second delay, that shouldn’t be happening unless there is something specifically blocking/waiting. How are you measuring that value? Is it the Photon on the gateway outputting the values somehow?