SensMonitor integration

LilyGO T-SIM7000G

Connect an ESP32, SIM7000G cellular modem and BME280 sensor to the SensMonitor platform using the open-source smonitor-iot firmware.

  • ESP32Wi-Fi and Bluetooth 4.2
  • SIM7000GNB-IoT, LTE-M and GPRS
  • BME280Temperature, humidity and pressure
Front and rear views of the LilyGO T-SIM7000G development board
Photo: LILYGO T-SIM7000G

01 / Overview

A field-ready cellular IoT node

The LilyGO T-SIM7000G combines an ESP32 microcontroller with a SIM7000G modem. It can send measurements from locations without Wi-Fi by using a cellular network and a TLS WebSocket connection to the SensMonitor platform.

01

Controller

ESP32 with 4 MB flash memory, Wi-Fi and Bluetooth connectivity.

02

Cellular network

SIM7000G supports NB-IoT, LTE-M and 2G/GPRS, depending on the mobile operator.

03

Power

USB-C, an 18650 battery or a suitable solar source through the board connector.

04

Sensor

The initial SensMonitor profile uses a BME280 connected over the I2C bus.

What does the firmware do? On startup, it derives a unique serial number from the ESP32 eFuse MAC address, establishes a PPP connection, synchronizes the system clock, downloads the device configuration and continuously sends measurements to SensMonitor.

02 / Preparation

What you need

LilyGO T-SIM7000G board

Nano SIM card with an active data plan

LTE antenna connected before powering the modem

BME280 I2C module and four wires

USB-C cable that supports data transfer

Linux, macOS or Windows computer with Git

ESP-IDF 5.5.4 development environment

SensMonitor user account

Before powering the board: connect the LTE antenna, insert the SIM card while the board is powered off, and verify the APN, network type and radio band with your mobile operator.

03 / Hardware

Connect the BME280

The default profile uses GPIO 21 for SDA, GPIO 22 for SCL and the I2C address 0x76. If your module uses 0x77, change the address later in the configuration.

BME280LilyGOFunction
VIN / VCC3.3VPower
GNDGNDGround
SDAGPIO 21I2C data
SCLGPIO 22I2C clock
LilyGO T-SIM7000G board shown at an angle
The board photo is provided for reference. Use the wiring table and the markings on your board revision when connecting hardware.
Modem pins used by the firmware
TX GPIO 27 RX GPIO 26 RTS GPIO 25 CTS GPIO 23 PWRKEY GPIO 4

These connections are already routed on the T-SIM7000G board and do not need to be wired manually.

04 / Firmware

Install and configure smonitor-iot

The project uses ESP-IDF 5.5.4. Internet access is required during the first build so that ESP-IDF Component Manager can download the SensMonitor components.

  1. 1

    Install ESP-IDF 5.5.4

    Follow the official Espressif instructions for your operating system, then open a terminal with the ESP-IDF environment activated.

    ESP-IDF installation guide ↗
  2. 2

    Download the firmware

    git clone https://github.com/sensmonitor/smonitor-iot.git
    cd smonitor-iot
    idf.py set-target esp32
  3. 3

    Configure the cellular network

    idf.py menuconfig

    Open the SensMonitor IoT menu and configure:

    • Mobile network APN — the operator APN is required.
    • PPP authentication — usually None.
    • Preferred mobile network — NB-IoT, LTE-M, GPRS or Automatic.
    • LTE band — only when required by the operator; the initial profile uses band 20.
  4. 4

    Check the sensor configuration

    In SensMonitor IoT → I2C sensor, keep BME280, SDA 21, SCL 22 and address 0x76 unless your wiring is different.

  5. 5

    Build and flash the firmware

    idf.py build
    idf.py -p /dev/ttyACM0 flash monitor

    Replace /dev/ttyACM0 with your board’s serial port, such as /dev/ttyUSB0 on Linux or COM5 on Windows.

05 / SensMonitor

Register the device

The firmware automatically derives a serial number from the factory ESP32 MAC address. The serial number identifies the device and is not a secret.

smonitor_iot: Device serial:
SM-ESP32-A1B2C3D4E5F6

DEVICE_NOT_REGISTERED:
Register SM-ESP32-A1B2C3D4E5F6
in the SensMonitor application.
  1. 1

    Sign in at app.sensmonitor.com.

  2. 2

    Open the Devices section and choose to add a new device.

  3. 3

    Select LilyGO T-SIM7000 as the device type.

  4. 4

    Enter the serial number exactly as shown in the monitor, including the SM-ESP32- prefix.

  5. 5

    Create a station, assign the device to it and configure the BME280 sensors.

  6. 6

    Restart the board. The firmware will request the configuration again.

06 / Verification

What a successful connection looks like

BME280 initialized successfully
Modem connected to PPP server
System time set
WebSocket connected
Received device config
Received device-sample-ack
Message: APN is empty

Run idf.py menuconfig, enter the APN in the SensMonitor IoT menu and build the firmware again.

PPP does not receive an IP address

Check the APN, active data plan, antenna, selected network type, radio band and PPP authentication.

BME280 does not initialize

Check the power supply, SDA/SCL wiring, pull-up resistors and sensor address 0x76 or 0x77.

WebSocket does not connect

First verify that PPP has an IP address and that the system time is synchronized. The production WebSocket URL is already configured by default.

Ready to measure?

Monitor field data in real time.

LilyGO T-SIM7000G