Skip to content

Commit 32b9149

Browse files
committed
Add initial support for Thinger NB-IOT Core and update version to 2.40.0
1 parent 7565c22 commit 32b9149

File tree

5 files changed

+541
-2
lines changed

5 files changed

+541
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode/settings.json
2-
.DS_Store
2+
.DS_Store
3+
.idea

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.40.0
2+
3+
#### NB-IOT CORE
4+
5+
- **Added** initial support for [Thinger NB-IOT Core](https://docs.thinger.io/others/hardware/thinger32-nb-iot). A module based on BC660 using Narrowband Technology.
6+
17
## 2.31.0
28

39
#### ESP32

examples/Thinger/NBCore/NBCore.ino

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
// uncomment to use custom iot server
3+
//#define THINGER_SERVER "acme.thinger.io"
4+
5+
// uncomment to enable thinger debug messages
6+
#define THINGER_SERIAL_DEBUG
7+
8+
// use only if using M2 based module
9+
// #define THINGER_NB_M2_CORE
10+
11+
// Requires TinyGSM (https://github.com/vshymanskyy/TinyGSM)
12+
#include <ThingerNBCore.h>
13+
#include <ThingerESP32OTA.h>
14+
#include "arduino_secrets.h"
15+
16+
ThingerNBCore thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
17+
ThingerESP32OTA ota(thing, 512);
18+
19+
String iccid;
20+
21+
void setup(){
22+
Serial.begin(115200);
23+
24+
// start modem
25+
while (!thing.init_modem()){
26+
delay(1000);
27+
}
28+
29+
// read SIM ICCID (sim card ID)
30+
iccid = thing.get_sim_iccid();
31+
THINGER_DEBUG_VALUE("NB-IOT", "SIM ICCID: ", iccid.c_str());
32+
33+
// set username and password with ICCID
34+
thing.set_credentials(USERNAME, iccid.c_str(), iccid.c_str());
35+
36+
// sample device resources
37+
thing["voltage"] >> outputValue(thing.get_batt_voltage());
38+
39+
thing["operator"] >> outputValue(thing.get_operator());
40+
41+
thing["modem"] >> [](pson &out)
42+
{
43+
out["modem"] = thing.get_modem_info();
44+
out["IMEI"] = thing.get_modem_imei();
45+
out["CCID"] = thing.get_sim_iccid();
46+
out["operator"] = thing.get_operator();
47+
};
48+
}
49+
50+
void loop(){
51+
// iotmp handle
52+
thing.handle();
53+
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=thinger.io
2-
version=2.31.0
2+
version=2.40.0
33
author=Alvaro Luis Bustamante <[email protected]>
44
maintainer=Thinger.io <[email protected]>
55
sentence=Arduino library for IOTMP protocol used on Thinger.io IOT Platform.

0 commit comments

Comments
 (0)