Skip to contentSkip to navigationSkip to topbar
On this page

Narrowband: The Breakout SDK for Massive IoT


The Breakout SDK for Massive IoT enables developers to exchange data between low-powered devices and their services running in the cloud. The SDK abstracts complex elements of Narrowband IoT (NB-IoT) deployment and removes development barriers by handling tasks such as network registration on your behalf.

The SDK is built to be cross-platform. It currently supports three modems: the u-blox SARA-R410 and SARA-N410(link takes you to an external page) and the Quectel BG96(link takes you to an external page) . The SDK supports sending data over TCP and UDP, and using the modems' internal MQTT and TLS implementations.


Download the SDK

download-the-sdk page anchor

The SDK repository(link takes you to an external page) can be downloaded from GitHub.


Using the Massive IoT SDK on your device

using-the-massive-iot-sdk-on-your-device page anchor

First, a few platform-specific functions need to be implemented as is described in the porting section of the Read Me(link takes you to an external page). After that you can write the code in either blocking or non-blocking style (see the example).

If you are working in multithreaded environment, please note that the Breakout SDK is not thread-safe, so it should either be owned by a single thread, or protected by a mutex.

Working with Massive SDK - BG96

working-with-massive-sdk---bg96 page anchor
1
#include "modem/OwlModemBG96"
2
3
OwlModemBG96 *modem;
4
int socket;
5
6
void init(MySerialInterface* interface) {
7
modem = new OwlModemBG96(interface)l
8
9
modem->initModem();
10
modem->waitForNetworkRegistration();
11
12
modem->mqtt.openConnection("my.mqtt.broker", 1883);
13
modem->mqtt.login("BG96 Device", nullptr, nullptr);
14
modem->mqtt.subscribe("some_topic", 1);
15
}
16
17
void on_message(str topic, str message) {
18
// process incoming message
19
}
20
21
void do_work() {
22
str buf;
23
buf.s = new char[512];
24
buf.len = 0;
25
for (;;) {
26
// publish data
27
if (should_send) {
28
modem->mqtt.publish("another_topic",
29
{.s = ..., .len = ...});
30
}
31
}
32
}

Working with Massive SDK - SARA-R410/SARA-N10

working-with-massive-sdk---sara-r410sara-n10 page anchor
1
#include "modem/OwlModemRN4"
2
3
OwlModemRN4 *modem;
4
int socket;
5
6
void init(MySerialInterface* interface) {
7
modem = new OwlModemRN4(interface)l
8
9
modem->initModem();
10
modem->waitForNetworkRegistration("test");
11
12
modem->socket.open(AT_USO_Protocol__UDP, OUT_PORT, &socket);
13
}
14
15
void do_work() {
16
str buf;
17
buf.s = new char[512];
18
buf.len = 0;
19
for (;;) {
20
// receive part
21
modem->socket.receiveUDP(socket, 512, &buf, 512);
22
if (buf.len != 0) {
23
// received data, process it
24
}
25
26
// transmit part
27
if (should_send) {
28
int sent;
29
modem->socket.sendUDP(socket, {.s = ..., .len = ...}, &sent);
30
}
31
}
32
}
33
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.