Gateway Support

Trondheim, 2023-02-01

New release of the Span API and service

Gateway Structure

The gateway support has been in the works for quite a time and it’s finally here. It has required a fair bit of restructuring internally and slight overhaul of the API in selected places.

Cellular IoT is a nice IoT technology but one size does not fitt all (or everything). Last year’s release with support for WiFi was just one piece in the giant IoT puzzle. Gateways are another one one of those pieces.

The concept we’ve landed on is relatively simple ceonceptually - Span talks to gateways which talks to devices. The devices in Span can either connect through cellular IoT (LTE-M or NB-IoT), WiFi (aka The Internet) or via a gateway. This allows you to implement a redundant connectivity for your devices, f.e can you use WiFi as your bread-and-butter connectivitiy and if your WiFi router (or a switch on your network) goes away you can switch over to cellular IoT (lTE-M or NB-IoT) but that might again fail if an enthusiastic digger starts working on the street a few blocks away. If need more redundancy you can switch over to LoRaWAN, Sigfox or mesh networking for even more redundancy.

…all for the same device.

The example might be a bit far-fetched (a device with both WiFi, CIoT and LoRa chipsets will be quite a challenge to implement) but it is possible.


Another nice side effect is that you can use any proprietary radio technology when integrating devices; if you use a protocol built on top of LoRa (but not LoRaWAN) you can implement a relatively simple gateway and expose all of the devices via Span. This includes all the nice-to-have features such as message retention, data routing to your own backends and management API.

The gateway interface is based on gRPC so the gateway itself can be implemented in any of the officially supported languages such as C/C++, C#, Dart, Go, Java, Kotlin, Python and Ruby. (Rust isn’t on the list but both the tonic and grpc crates should work equally well.

Extended API

As part of this release the gateway references in the existing API has gotten a makeover and it should be more consistent across the board. The management UI is updated with the new gateway feature as well.

Gateway configuration for device

LoRaWAN support

As a proof-of-concept we’ve taken a trip down memory lane and built a sample gateway on top of the LoRaWAN projects we did a few years ago. It’s not production ready but integrates nicely with Span. The gateway contains a custom version of the Congress service. You can read more about it here

If you just want to experiment with the gateway the sample project contains a (very simple) gateway emulator with devices that will generate upstream messages to Span.

Right now the gateway setup is not very generic in the management UI but that will change in a later version. Enjoy!

Back to the news