The Thinger.io Arduino library (thinger.io in the library managers) supports these boards and network modules. Include the header of your board and create the thing object with its class; the rest of the sketch is the same for every board (see the Coding guide). Each board has a complete sketch on its family page, and the same sketch in File > Examples > thinger.io of the Arduino IDE.
Boards and classes
The Example column is the name of the sketch in File > Examples > thinger.io.
Espressif
| Board | Network | Include | Class | Example | OTA |
|---|---|---|---|---|---|
| ESP32, ESP32-S2, S3, C3, C5, C6 | Wi-Fi | ThingerESP32.h | ThingerESP32 | ESP32, ESP32OTA, ESP32RTOS | Yes, ThingerESP32OTA |
| ESP32, ESP32-P4 | Ethernet | ThingerESP32Eth.h | ThingerESP32Eth | ESP32Eth | Yes, ThingerESP32OTA |
| ESP32 | Wi-Fi set up from a phone | ThingerESP32WebConfig.h | ThingerESP32WebConfig | ESP32WebConfig | — |
| ESP8266 | Wi-Fi | ThingerESP8266.h | ThingerESP8266 | ESP8266, ESP8266OTA | Yes, ThingerESP8266OTA |
| ESP8266 | Wi-Fi set up from a phone | ThingerESP8266WebConfig.h | ThingerESP8266WebConfig | ESP8266WebConfig | — |
| ESP8266 | Wi-Fi set up with ESP-Touch | ThingerSmartConfig.h | ThingerSmartConfig | ESP8266SmartConfig | — |
| Arduino with an ESP8266 as Wi-Fi modem (AT commands) | Wi-Fi | ThingerESP8266AT.h | ThingerESP8266AT | ESP8266AT | — |
Arduino
| Board | Network | Include | Class | Example | OTA |
|---|---|---|---|---|---|
| Arduino Nano RP2040 Connect | Wi-Fi | ThingerMbed.h | ThingerMbed | ArduinoNanoRP2040 | Yes, ThingerMbedOTA |
| Arduino Nano 33 IoT | Wi-Fi | ThingerWiFiNINA.h | ThingerWiFiNINA | ArduinoNano33IOT | Yes, ThingerWiFiNINAOTA |
| Arduino MKR WiFi 1010 | Wi-Fi | ThingerWiFiNINA.h | ThingerWiFiNINA | ArduinoMKR1010 | Yes, ThingerWiFiNINAOTA |
| Arduino UNO WiFi Rev2 | Wi-Fi | ThingerWiFiNINA.h | ThingerWiFiNINA | — | — |
| Arduino Portenta H7, GIGA R1 WiFi (Zephyr core) | Wi-Fi | ThingerZephyr.h | ThingerZephyr | ArduinoZephyr | — |
| Arduino Opta WiFi (Zephyr core) | Wi-Fi | ThingerZephyr.h | ThingerZephyr | ArduinoOptaZephyr | — |
| Arduino Portenta H7 (Mbed OS core) | Wi-Fi | ThingerMbed.h | ThingerMbed | ArduinoPortentaH7 | Yes, ThingerPortentaOTA |
| Arduino Portenta H7 (Mbed OS core) | Ethernet | ThingerMbedEth.h | ThingerMbedEth | ArduinoPortentaH7Ethernet | Yes, ThingerPortentaOTA |
| Arduino Opta (Mbed OS core) | Wi-Fi | ThingerMbed.h | ThingerMbed | ArduinoOptaWiFi | Yes, ThingerPortentaOTA |
| Arduino Opta (Mbed OS core) | Ethernet | ThingerMbedEth.h | ThingerMbedEth | ArduinoOptaEthernet | Yes, ThingerPortentaOTA |
| Arduino MKR NB 1500 | NB-IoT / LTE-M | ThingerMKRNB.h | ThingerMKRNB | ArduinoMKRNB1500 | Yes, ThingerMKRNBOTA |
| Arduino MKR GSM 1400 | GSM / GPRS | ThingerMKRGSM.h | ThingerMKRGSM | ArduinoGSM1400 | — |
| Arduino MKR1000 | Wi-Fi | ThingerWifi101.h | ThingerWifi101 | ArduinoMKR1000 | — |
| Arduino UNO R4 WiFi | Wi-Fi | ThingerR4WiFi.h | ThingerR4WiFi | ArduinoR4Wifi | Yes, ThingerR4OTA |
| Arduino UNO Q | Wi-Fi, through its Linux side | ThingerUnoQ.h | ThingerUnoQ | ArduinoUnoQ | — |
| Arduino Yún | Wi-Fi or Ethernet | ThingerYun.h | ThingerYun | ArduinoYun | — |
| Arduino with Ethernet shield | Ethernet | ThingerEthernet.h | ThingerEthernet | ArduinoEthernet | — |
| Arduino with ENC28J60 module | Ethernet | ThingerENC28J60.h | ThingerENC28J60 | ArduinoENC28J60 | — |
| Arduino with WiFi shield | Wi-Fi | ThingerWifi.h | ThingerWifi | ArduinoWifi | — |
| Arduino with Adafruit CC3000 | Wi-Fi | ThingerCC3000.h | ThingerCC3000 | ArduinoCC3000 | — |
| Arduino with a GSM modem (SIM800, SIM900, A6, A7, M590) | GPRS | ThingerTinyGSM.h | ThingerTinyGSM | ArduinoTinyGSM | — |
Other boards
| Board | Network | Include | Class | Example | OTA |
|---|---|---|---|---|---|
| Raspberry Pi Pico W and Pico 2 W | Wi-Fi | ThingerPicoW.h | ThingerPicoW | PicoW | Yes, ThingerPicoOTA |
| Thinger.io NB-IoT Core | NB-IoT | ThingerNBCore.h | ThingerNBCore | NBCore | Yes, ThingerESP32OTA |
| Texas Instruments CC3200 (Energia IDE) | Wi-Fi | ThingerWifi.h | ThingerWifi | EnergiaCC3200 | — |
| SeeedStudio LinkIt ONE | Wi-Fi | ThingerLinkItOneWifi.h | ThingerLinkItOneWifi | LinkItOneWifi | — |
| SeeedStudio LinkIt ONE | GPRS | ThingerLinkItOneGPRS.h | ThingerLinkItOneGPRS | LinkItOneGPRS | — |
A board with OTA support can receive firmware updates over the Internet from the Visual Studio Code extension. Add the OTA include and create the OTA object after thing:
#include <ThingerESP32.h>
#include <ThingerESP32OTA.h>
ThingerESP32 thing("YOUR_USER", "YOUR_DEVICE", "YOUR_TOKEN");
ThingerESP32OTA ota(thing);Credentials file
The example sketches keep the credentials out of the code, in a file called arduino_secrets.h in the sketch folder (the Arduino IDE shows it as a second tab). The sketch includes it with #include "arduino_secrets.h". Replace the placeholders with your username, the device ID and the device credentials, and add the settings of your network:
#define USERNAME "YOUR_USER"
#define DEVICE_ID "YOUR_DEVICE"
#define DEVICE_CREDENTIAL "YOUR_TOKEN"
#define SSID "wifi-network"
#define SSID_PASSWORD "wifi-password"#define USERNAME "YOUR_USER"
#define DEVICE_ID "YOUR_DEVICE"
#define DEVICE_CREDENTIAL "YOUR_TOKEN"
#define PIN_NUMBER "1234"
#define GPRS_APN "internet.example"
#define GPRS_LOGIN ""
#define GPRS_PASSWORD ""#define USERNAME "YOUR_USER"
#define DEVICE_ID "YOUR_DEVICE"
#define DEVICE_CREDENTIAL "YOUR_TOKEN"DEVICE_CREDENTIALholds the device credentials, not an access token.- Keep
arduino_secrets.hout of version control if you share the sketch. - You can also write the values in the sketch itself, as the Arduino guide does.
Server and TLS
The library connects to the free Cloud server by default. On a private instance, define your domain before the first include, where YOUR_SERVER is your own domain:
#define THINGER_SERVER "YOUR_SERVER"Most boards connect over TLS, to port 25202, and validate the server certificate. These connect without TLS, to port 25200: the Ethernet shield, the ENC28J60 module, the WiFi shield, the CC3000 module, the ESP8266 as Wi-Fi modem, the CC3200 and the LinkIt ONE. All the options are in Compile options.
The ESP32, the ESP8266, the Raspberry Pi Pico W and Pico 2 W, the Arduino UNO R4 WiFi, the Arduino UNO Q and the boards of the Arduino Zephyr core (ThingerZephyr) validate the server with a root certificate built into the library: the one of the free Cloud servers, or the one of Let's Encrypt when you set THINGER_SERVER. If the certificate of your instance comes from another authority, such as your own, define its root certificate in PEM format with THINGER_ROOT_CA, before the include. It replaces the default certificates:
#define THINGER_SERVER "YOUR_SERVER"
#define THINGER_ROOT_CA R"(-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----)"
#include <ThingerESP32.h>Paste the whole certificate between the R"( and )" marks, with its BEGIN and END lines. thing.set_root_ca() can also set it from the sketch, in setup() or while the device runs; it takes effect on the next connection.
#define THINGER_INSECURE_SSL skips the certificate check, for a private instance with a self-signed certificate, on the ESP32, the ESP8266, the Raspberry Pi Pico W and Pico 2 W and the boards of the Zephyr core. The Wi-Fi module of the UNO R4 WiFi always checks the certificate: with this option it uses its own root certificates instead of the one of the library.
See also
- Arduino: install the library and connect a board.
- Arduino library reference: every class and function.
- Thinger.io hardware: boards made by Thinger.io.