Bluz gateway shield how to program?


#1

Hi,

I need a suggestion. First, I’ll give you an idea what I am trying to accomplish and what I’ve done so far.

I want to collect data from BLE devices via Gateway shield + Electron. I have almost implemented that connectivity via Redbear DUO, but the requirements have changed, and I cannot use Wifi to connect to the Internet. BLE devices were peripherals and DUO was central BLE, who periodically connected to each of the BLE and collected data from it.

Any suggestions where I should look and change the code in order to do the same via Bluz GW + Electron?

Vitaliy


#2

You can do this today with the Gateway Shield and an Electron. If you look in the Particle gateway shield code, you will see that it supports the Electron: https://github.com/bluzDK/particle-gateway-shield-code/blob/master/particle-gateway-code/particle-gateway-code.cpp

Now, there is one down side at the moment. Every bluz board (and in fact the gateway itself) transmits data to the cloud every 15 seconds. This will consume your 1MB of monthly Particle data pretty fast.

The one way to get around this is to put the Gateway Shield into MANUAL mode, so it won’t connect to the cloud, and then use the BLE devices in Local mode. This would allow you to send data from each bluz to the Electron, which could forward the data on for them.

I am currently working on a tutorial on how to do this. If you want to live with the data consumption for the short term, you can try this out now. I will get the tutorial posted soon and you can then use that for this purpose.


#3

Thanks, Eric.

Since I have already BLE devices which are not Bluz, I can see these number of options.

  1. to add an application (1kb RAM limitation could be a problem since the data stream from each BLE device more that 1k) to BluzGW which can talk to BLE peripherals, collects the data and sends the data to the Electron.
  2. change BluzGW firmware or basically mix application code with BluzGW firmware: which potentially can give me more space to store data
  3. adopt BLE devices so they will act like Bluzes, which I am not sure since they have to be registered on the particle side with keys (authentication) etc…

From my point of view, 1 option is limited due to the RAM limitation and caching (can’t save temp data to flash). Which leaves me with option 2 only.

Any suggestions are welcome.


#4

I see what you are getting at.

1 would indeed be very difficult, much more so because we don’t expose many of the functions you would need to do this to the app. Since we use modular firmware, functions have to be added to the swap space and wrappered, this would be tricky. We do have the option now to store data on bluz, and hence the gateway as well, so you can local cache in persistent flash. But still, this would be very tricky due to the functions of the underlying firmware not being exposed.

Number 2 is probably your best bet. You could pretty easily change the underlying firmware to connect to your boards and talk to them. You would be programming directly with the Nordic SDK, but they have good support and documentation.

3 would be tricky most likely. Are the boards you already have using Nordic nrf51? If so, it is possible, though it would probably require some tricks if you didn’t already have the external SPI flash. If it’s not nrf51, it would be much more difficult.

A 4th option would be to simply use bluz as the peripheral devices and replace your current boards :smile: Not sure how invested you are in your existing BLE devices, but this would be the path of least resistance from an integration standpoint as everything is already integrated.


#5

Thanks for the suggestions, Eric.

Regarding the 4th option I was thinking about it initially, when I came across to Bluz. We were looking for a bit more ready to use version, so that it only requires to program BLE devices. Powering (battery) + small size + packaging already provided. We don’t have resources and expertise to do it in-house. So our primary option atm is Nordic nrf51 beacons, a bit expensive but it’s almost ready to use and as you said quite good documented and tested which are our main requirements.


#6

@vitaliy, am I reading your first post correctly and that you almost had the Redbear DUO acting as your gateway device for Bluz devices? This is something that I’m very interested in. Would you be willing to share what you have?

Thanks!


#7

Hi @vitaliy @xc0de! … i’m also veeery interested on that connection between a redbear duo acting as a Central device, and a Bluz acting as a Peripheral device to transfer data … could you please share some info about how you did it? thanks!