MonSet
.
[English Version]
MonSet — Industrial IoT Telemetry Device with 4-Channel Redundant Connectivity
#STM32F407 #W5500 #GSM #NB-IoT #Iridium #ModbusRTU #ThingsBoard #MQTT #IndustrialIoT
⚠️ README is written in Russian. This curation is based on the full README content.
01 — What is this project?
MonSet is an industrial IoT telemetry device designed for monitoring process parameters at remote field sites — water level sensors, pressure gauges, flow meters, and other Modbus RTU instruments in locations with unreliable or no fixed-line network connectivity.
The defining characteristic of MonSet is its four-tier redundant communication architecture: Ethernet W5500 → GSM (NB-IoT) → WiFi → Iridium satellite. If the primary channel fails, the device automatically switches to the next available channel and returns to the priority channel when connectivity is restored.
It runs on STM32F407VET6, powered by a LiFePo4 24V 15Ah battery, and is designed to survive without human intervention in remote industrial environments.
02 — System architecture
[Modbus RTU sensors] [Remote site]
RS-485 (2× ports)
↓
[MonSet — STM32F407VET6]
├─ Sensor polling (Modbus RTU)
├─ Data logging → SD card (FAT32)
├─ NTP time sync → DS3231 RTC
└─ Telemetry transmission — priority chain:
1st: W5500 Ethernet (SPI1)
2nd: GSM SIM7020C/E (NB-IoT, USART2)
3rd: WiFi ESP8266 (USART6)
4th: Iridium SBDNR9602G (UART5, satellite)
↓
[ThingsBoard / MQTT / HTTP Webhook]
[Home Assistant / Node-RED / Yandex IoT Core]The state machine follows: INIT → ETHERNET_INIT → NTP_SYNC → MODEM_INIT → SENSORS_POLL → SEND_DATA → SLEEP and loops continuously.
03 — Why W5500?
🔷 W5500 is the primary channel — highest priority
In the 4-channel priority chain, W5500 Ethernet is first. When a wired network connection is available, all telemetry goes through W5500. GSM, WiFi, and Iridium are fallbacks for when Ethernet is unavailable.
The reason is straightforward: W5500 provides the most stable, lowest-latency, lowest-cost-per-byte connection. GSM costs airtime. Iridium satellite costs significantly more per message. W5500 costs nothing beyond the hardware.
🔷 TLS/HTTPS requires a proper TCP/IP stack
MonSet transmits over HTTPS using mbedTLS for encryption. Running a full TLS handshake requires a reliable TCP implementation. W5500's hardware TCP/IP stack (ioLibrary) provides this without burdening the STM32F407's CPU. The hardware handles TCP session management, retransmission, and checksum — the STM32 just reads and writes data.
🔷 Modbus TCP — bidirectional industrial protocol
Beyond outbound telemetry, MonSet also operates as a Modbus TCP master — polling Modbus TCP devices on the local network via W5500. It can simultaneously act as a Modbus TCP slave, exposing its sensor readings to SCADA systems (planned for future release).
🔷 Web interface over Ethernet
The built-in web interface is served via W5500 (alongside ESP8266 WiFi and GSM). Runtime logs, live sensor values, configuration changes, log download, and CSV export — all accessible from a browser on the LAN without ThingsBoard.
| Channel | Cost | Stability | Use case |
|---|---|---|---|
| W5500 Ethernet | Low | High | Primary — always preferred |
| GSM NB-IoT | Airtime | Medium | Fallback — remote sites |
| WiFi ESP8266 | Low | Medium | Local access / fallback |
| Iridium satellite | Very high | Very high | Last resort — no coverage |
04 — Key components
🧠 STM32F407VET6 — the industrial-grade MCU
168MHz Cortex-M4F, 512KB Flash, 192KB RAM. Handles Modbus RTU polling, data processing, TLS handshake (via mbedTLS + hardware RNG), SD card management, and all communication channel coordination. Hardware watchdog (IWDG, ~32s) ensures automatic recovery from any freeze.
🌐 WIZnet W5500 — primary Ethernet interface
Connected to SPI1 (PA5/PA6/PA7), CS on PA8, INT on PC4, RST on PC3. SPI speed: 1.3125 Mbit/s (Prescaler=64). Default MAC: 02:30:05:00:00:01 (configurable in config.hpp). Handles HTTPS and MQTT over TCP, Modbus TCP master, and web server. Uses WIZnet ioLibrary (hardware TCP/IP stack).
📡 GSM SIM7020C/E (NB-IoT)
Cat NB1/NB2 modem on USART2. Second-priority channel. Supports MQTT (AT+CMQTTCONNECT, AT+CMQTTPUB) and HTTPS. The README recommends upgrading from SIM7020C to SIM7020E for wider frequency band coverage in Russia (adds B20, B28). PSM power consumption ~1µA — optimal for battery-powered remote operation.
📶 WiFi ESP8266
Connected to USART6. Third-priority communication channel. Also hosts the Captive Portal for initial device setup, and serves the web interface independently of Ethernet.
🛰️ Iridium SBDNR9602G
Satellite Short Burst Data modem on UART5. Last-resort channel — covers locations with zero cellular or Ethernet coverage. High per-message cost but guaranteed global connectivity. Hardware supports both RS-232 (MAX3232) and RS-485 (MAX485) physical layers.
💾 SD card + DS3231 RTC
All telemetry is logged locally to backup.jsn (JSONL, lines up to 240 bytes) during connectivity outages and uploaded when connection restores. config.json on the SD card holds all runtime configuration — Modbus register map, APN, server URL, polling intervals — changeable without reflashing.
05 — Modbus configuration without reflashing
One of the most practically useful features: the Modbus register map is defined in JSON on the SD card, not in firmware.
{ "port": "USART3", "baudrate": 9600, "sensors": [ { "address": 1, "function": 3, "register": 100, "type": "float", "scale": 0.1, "unit": "m" } ] }Changing which sensor registers to read, what data type they use, and how to scale the values requires only editing a JSON file on the SD card — no firmware recompilation, no reflashing. This is critical for industrial deployment where different sites have different sensor configurations.
06 — Application scenarios
01. Remote water level monitoring
Water level sensors (pressure-based submersible, radar ULM31) at remote pumping stations or reservoirs. Modbus RTU data collected, averaged, and sent to ThingsBoard via the best available channel. Iridium guarantees delivery even in zero-coverage areas. #WaterManagement #LevelSensor #Remote
02. Oil & gas field telemetry
Flow meters, pressure gauges, and temperature sensors at remote wellheads. NB-IoT primary channel covers Russia's rural areas; Iridium as final fallback. SD card backup ensures no data loss during multi-day outages. #OilGas #Pipeline #Telemetry
03. Environmental monitoring stations
Air quality, soil moisture, meteorological sensors at unmanned field stations. Battery-powered operation with LiFePo4. Low-power NB-IoT PSM mode (~1µA) between transmissions extends battery life. #Environmental #FieldStation #BatteryPowered
04. SCADA integration
W5500 Modbus TCP slave mode (planned) allows existing SCADA systems (GE iFIX, WinCC, InTouch) to read MonSet measurements directly as a standard Modbus device — no custom protocol adaptation needed. #SCADA #ModbusTCP #Industrial
05. Home Assistant / Node-RED integration
MQTT support with Home Assistant auto-discovery (Mosquitto broker), Node-RED, and Yandex IoT Core makes MonSet usable beyond industrial SCADA — in smart building management, agricultural monitoring, and custom IoT applications. #HomeAssistant #NodeRED #SmartBuilding
Conclusion
Four communication channels, one device — W5500 first, Iridium satellite as last resort.
MonSet solves the fundamental challenge of industrial remote monitoring: what happens when the network goes down? The answer is a 4-tier priority chain where Ethernet W5500 is always preferred, GSM NB-IoT and WiFi serve as fallbacks, and Iridium satellite guarantees delivery even from the most remote sites on Earth.
W5500 is not just a communication channel here — it is the Modbus TCP master for local network devices, the TLS/HTTPS transport backed by mbedTLS and hardware RNG, and the web server for browser-based configuration and monitoring.
The JSON-configurable Modbus register map means the same firmware runs on sites with completely different sensor configurations — a significant operational advantage for field deployment at scale.
- ✅ 4-channel redundant connectivity: W5500 → GSM → WiFi → Iridium
- ✅ W5500 as primary channel, Modbus TCP master/slave, and HTTPS transport
- ✅ JSON-configurable Modbus register map — no reflashing required
- ✅ mbedTLS TLS 1.2 with hardware RNG for secure HTTPS
- ✅ SD card backup — no data loss during connectivity outages
- ✅ ThingsBoard, MQTT, Home Assistant, Node-RED, Yandex IoT Core, HTTP Webhook
- ✅ Hardware watchdog (IWDG ~32s) for autonomous recovery
- ✅ LiFePo4 battery powered, NB-IoT PSM ~1µA sleep current
- ✅ Web interface via Ethernet, WiFi, and GSM
Q&A
Q. What is Modbus RTU? A serial communication protocol widely used in industrial automation. Devices (sensors, meters, controllers) communicate over RS-485 wiring using a master/slave model. MonSet is the master — it polls connected sensors at configured intervals and reads their measurement registers.
Q. What is NB-IoT? Narrowband IoT (NB-IoT) is a cellular network technology designed for low-power, low-data-rate IoT devices. It provides better building and underground penetration than standard LTE, uses very little power in PSM sleep mode (~1µA), and is optimized for devices that send small amounts of data infrequently — exactly the telemetry use case.
Q. What is Iridium SBD? Iridium Short Burst Data (SBD) is a satellite communication service that transmits small data packets (up to 340 bytes) via the Iridium satellite constellation, which covers the entire Earth including poles. It is expensive per message but works anywhere on the planet. MonSet uses it as the absolute last resort when all other channels fail.
Q. Why use W5500 instead of just GSM for everything? GSM charges airtime per message and has latency. For sites with wired Ethernet available, W5500 provides unlimited, low-latency, low-cost connectivity. GSM is reserved as a fallback to minimize operating costs while guaranteeing connectivity.
Q. What does "configurable Modbus register map without reflashing" mean? Industrial sites use hundreds of different sensor models, each with different Modbus register addresses, data types, and scaling factors. Without this feature, every site configuration would require custom firmware. With JSON-based configuration on the SD card, the same firmware binary works on all sites — only the config.json file differs.
[한글 버전]
MonSet — 4채널 이중화 통신을 갖춘 산업용 IoT 원격측정 기기
#STM32F407 #W5500 #GSM #NB-IoT #이리듐 #ModbusRTU #ThingsBoard #MQTT #산업용IoT
⚠️ README는 러시아어로 작성되어 있습니다. 이 큐레이션은 전체 README 내용을 기반으로 작성했습니다.
01 — 이 프로젝트는 무엇인가?
MonSet은 원격 현장에서 공정 파라미터를 모니터링하기 위한 산업용 IoT 원격측정 기기입니다 — 수위 센서, 압력계, 유량계 등 Modbus RTU 기기들을 네트워크 연결이 불안정하거나 없는 원격 위치에서 모니터링합니다.
MonSet의 핵심 특징은 4단계 이중화 통신 아키텍처입니다: 이더넷 W5500 → GSM(NB-IoT) → WiFi → 이리듐 위성. 주 채널이 실패하면 자동으로 다음 채널로 전환하고, 주 채널이 복구되면 자동으로 복귀합니다.
STM32F407VET6 기반으로 LiFePo4 24V 15Ah 배터리로 구동되며, 사람의 개입 없이 원격 산업 환경에서 자율 동작하도록 설계되었습니다.
02 — 시스템 구조
[Modbus RTU 센서들] [원격 현장]
RS-485 (2개 포트)
↓
[MonSet — STM32F407VET6]
├─ 센서 폴링 (Modbus RTU)
├─ 데이터 로깅 → SD 카드 (FAT32)
├─ NTP 시간 동기화 → DS3231 RTC
└─ 텔레메트리 전송 — 우선순위 체인:
1순위: W5500 이더넷 (SPI1)
2순위: GSM SIM7020C/E (NB-IoT, USART2)
3순위: WiFi ESP8266 (USART6)
4순위: 이리듐 SBDNR9602G (UART5, 위성)
↓
[ThingsBoard / MQTT / HTTP 웹훅]
[Home Assistant / Node-RED / Yandex IoT Core]상태 기계: 초기화 → 이더넷 초기화 → NTP 동기화 → 모뎀 초기화 → 센서 폴링 → 데이터 전송 → 슬립 루프 반복.
03 — 왜 W5500인가?
🔷 W5500이 1순위 채널 — 최우선
4채널 우선순위 체인에서 W5500 이더넷이 첫 번째입니다. 유선 네트워크 연결이 가능한 경우 모든 텔레메트리가 W5500을 통해 전송됩니다. GSM, WiFi, 이리듐은 이더넷이 불가능할 때의 폴백입니다.
이유는 단순합니다: W5500이 가장 안정적이고, 지연이 낮고, 데이터당 비용이 최저입니다. GSM은 통화료가 발생합니다. 이리듐 위성은 메시지당 비용이 상당합니다. W5500은 하드웨어 비용 외에 추가 비용이 없습니다.
🔷 TLS/HTTPS는 안정적인 TCP/IP 스택이 필요하다
MonSet은 mbedTLS로 암호화한 HTTPS로 전송합니다. 완전한 TLS 핸드셰이크를 실행하려면 신뢰할 수 있는 TCP 구현이 필요합니다. W5500의 하드웨어 TCP/IP 스택(ioLibrary)이 STM32F407 CPU 부담 없이 이를 제공합니다. 하드웨어가 TCP 세션 관리, 재전송, 체크섬을 처리하고 STM32는 데이터를 읽고 씁니다.
🔷 Modbus TCP — 양방향 산업 프로토콜
아웃바운드 텔레메트리 외에도 MonSet은 W5500을 통해 Modbus TCP 마스터로 동작하여 로컬 네트워크의 Modbus TCP 기기를 폴링합니다. 동시에 Modbus TCP 슬레이브로도 동작해 SCADA 시스템에 측정값을 노출할 수 있습니다(향후 지원 예정).
🔷 이더넷을 통한 웹 인터페이스
내장 웹 인터페이스가 W5500(ESP8266 WiFi, GSM과 함께)을 통해 서빙됩니다. 런타임 로그, 실시간 센서값, 설정 변경, 로그 다운로드, CSV 내보내기 — ThingsBoard 없이 LAN의 브라우저에서 모두 접근 가능합니다.
| 채널 | 비용 | 안정성 | 용도 |
|---|---|---|---|
| W5500 이더넷 | 낮음 | 높음 | 1순위 — 항상 선호 |
| GSM NB-IoT | 통화료 | 중간 | 폴백 — 원격지 |
| WiFi ESP8266 | 낮음 | 중간 | 로컬 접근 / 폴백 |
| 이리듐 위성 | 매우 높음 | 매우 높음 | 최후 수단 — 무신호 지역 |
04 — 핵심 구성 요소
🧠 STM32F407VET6 — 산업급 MCU
168MHz Cortex-M4F, 512KB Flash, 192KB RAM. Modbus RTU 폴링, 데이터 처리, TLS 핸드셰이크(mbedTLS + 하드웨어 RNG), SD 카드 관리, 모든 통신 채널 조율을 처리합니다. 하드웨어 워치독(IWDG, ~32초)으로 어떤 동결 상황에서도 자동 복구됩니다.
🌐 WIZnet W5500 — 1순위 이더넷 인터페이스
SPI1(PA5/PA6/PA7) 연결, CS PA8, INT PC4, RST PC3. SPI 속도: 1.3125Mbit/s(Prescaler=64). 기본 MAC: 02:30:05:00:00:01(config.hpp에서 설정 가능). HTTPS/MQTT TCP, Modbus TCP 마스터, 웹 서버를 처리합니다. WIZnet ioLibrary(하드웨어 TCP/IP 스택) 사용.
📡 GSM SIM7020C/E (NB-IoT)
USART2의 Cat NB1/NB2 모뎀. 2순위 채널. MQTT(AT+CMQTTCONNECT, AT+CMQTTPUB)와 HTTPS를 지원합니다. README에서 SIM7020C에서 SIM7020E로 업그레이드를 권장합니다(러시아 내 B20, B28 대역 추가). PSM 소비 전력 ~1µA — 배터리 구동 원격 운용에 최적입니다.
📶 WiFi ESP8266
USART6 연결. 3순위 통신 채널. 초기 설정을 위한 Captive Portal 호스팅 및 이더넷과 독립적으로 웹 인터페이스를 제공합니다.
🛰️ 이리듐 SBDNR9602G
UART5의 위성 단거리 데이터 모뎀. 최후 수단 채널 — 셀룰러나 이더넷 커버리지가 없는 위치에서 동작합니다. 메시지당 비용이 높지만 전 지구적 연결이 보장됩니다. 하드웨어가 RS-232(MAX3232)와 RS-485(MAX485) 물리 레이어를 모두 지원합니다.
💾 SD 카드 + DS3231 RTC
연결 중단 중 모든 텔레메트리가 로컬로 backup.jsn(JSONL, 최대 240바이트 줄)에 기록되고 연결 복구 시 업로드됩니다. SD 카드의 config.json이 Modbus 레지스터 맵, APN, 서버 URL, 폴링 간격 등 모든 런타임 설정을 보관합니다 — 재플래시 없이 변경 가능합니다.
05 — 재플래시 없는 Modbus 설정
가장 실용적인 기능 중 하나: Modbus 레지스터 맵이 펌웨어가 아닌 SD 카드의 JSON으로 정의됩니다.
{ "port": "USART3", "baudrate": 9600, "sensors": [ { "address": 1, "function": 3, "register": 100, "type": "float", "scale": 0.1, "unit": "m" } ] }어떤 센서 레지스터를 읽을지, 데이터 타입, 스케일링 값 — SD 카드의 JSON 파일만 수정하면 됩니다. 펌웨어 재컴파일, 재플래시 불필요. 현장마다 센서 구성이 다른 산업 배포에서 결정적인 장점입니다.
06 — 응용 시나리오
01. 원격 수위 모니터링
원격 펌프장이나 저수지의 수위 센서(수압식 수중, 레이더 ULM31). Modbus RTU 데이터를 수집, 평균화해 최적 채널로 ThingsBoard에 전송. 이리듐이 무신호 지역에서도 전송을 보장합니다. #수자원관리 #수위센서 #원격
02. 석유·가스 현장 텔레메트리
원격 유정의 유량계, 압력계, 온도 센서. NB-IoT 1순위 채널이 러시아 농촌 지역을 커버하고 이리듐이 최종 폴백. SD 카드 백업으로 며칠간 통신 중단에도 데이터 유실 없음. #석유가스 #파이프라인 #텔레메트리
03. 환경 모니터링 스테이션
무인 야외 스테이션의 대기질, 토양 수분, 기상 센서. LiFePo4 배터리 구동. NB-IoT PSM 모드(~1µA)로 전송 사이 배터리 수명 연장. #환경모니터링 #야외스테이션 #배터리구동
04. SCADA 연동
W5500 Modbus TCP 슬레이브 모드(향후 지원)로 기존 SCADA 시스템(GE iFIX, WinCC, InTouch)이 MonSet 측정값을 표준 Modbus 기기로 직접 읽을 수 있습니다. #SCADA #ModbusTCP #산업
05. Home Assistant / Node-RED 연동
Home Assistant 자동 발견(Mosquitto 브로커), Node-RED, Yandex IoT Core MQTT 지원으로 산업 SCADA를 넘어 스마트 빌딩 관리, 농업 모니터링, 커스텀 IoT 애플리케이션에도 활용 가능합니다. #HomeAssistant #NodeRED #스마트빌딩
결론
4개 통신 채널, 기기 하나 — W5500 우선, 이리듐 위성이 최후 수단.
MonSet은 산업 원격 모니터링의 근본 과제를 해결합니다: 네트워크가 다운되면 어떻게 되나? 답은 4단계 우선순위 체인입니다 — 이더넷 W5500을 항상 선호하고, GSM NB-IoT와 WiFi가 폴백이 되며, 이리듐 위성이 지구상 어디서든 전송을 보장합니다.
W5500은 단순한 통신 채널이 아닙니다 — 로컬 네트워크 기기를 위한 Modbus TCP 마스터이자, mbedTLS와 하드웨어 RNG로 지원되는 TLS/HTTPS 전송이자, 브라우저 기반 설정과 모니터링을 위한 웹 서버입니다.
JSON 기반 Modbus 레지스터 맵 설정으로 동일한 펌웨어가 완전히 다른 센서 구성의 모든 현장에서 동작합니다 — 현장 규모 배포의 결정적인 운영 장점입니다.
- ✅ 4채널 이중화 통신: W5500 → GSM → WiFi → 이리듐
- ✅ W5500이 1순위 채널, Modbus TCP 마스터/슬레이브, HTTPS 전송
- ✅ JSON 설정 가능 Modbus 레지스터 맵 — 재플래시 불필요
- ✅ 하드웨어 RNG를 사용한 mbedTLS TLS 1.2 보안 HTTPS
- ✅ SD 카드 백업 — 통신 중단 중 데이터 유실 없음
- ✅ ThingsBoard, MQTT, Home Assistant, Node-RED, Yandex IoT Core, HTTP 웹훅
- ✅ 하드웨어 워치독(IWDG ~32초) 자율 복구
- ✅ LiFePo4 배터리 구동, NB-IoT PSM ~1µA 슬립 전류
- ✅ 이더넷, WiFi, GSM을 통한 웹 인터페이스
Q&A
Q. Modbus RTU란 무엇인가요? 산업 자동화에서 널리 사용되는 시리얼 통신 프로토콜입니다. 기기(센서, 미터, 컨트롤러)가 RS-485 배선으로 마스터/슬레이브 방식으로 통신합니다. MonSet이 마스터 — 설정된 간격으로 연결된 센서를 폴링하고 측정 레지스터를 읽습니다.
Q. NB-IoT란 무엇인가요? 저전력 저데이터율 IoT 기기를 위한 셀룰러 네트워크 기술입니다. 일반 LTE보다 건물 내부와 지하 침투가 우수하고, PSM 슬립 모드에서 전력을 매우 적게 사용합니다(~1µA). 소량의 데이터를 드물게 전송하는 기기에 최적화되어 있습니다 — 정확히 텔레메트리 사용 사례입니다.
Q. 이리듐 SBD란 무엇인가요? 이리듐 위성 군을 통해 작은 데이터 패킷(최대 340바이트)을 전송하는 위성 통신 서비스로 극지방을 포함한 전 지구를 커버합니다. 메시지당 비용이 높지만 지구상 어디서든 작동합니다. MonSet은 다른 모든 채널이 실패했을 때 최후 수단으로 사용합니다.
Q. 모든 것에 GSM만 쓰지 않고 W5500을 쓰는 이유는? GSM은 메시지당 통화료가 발생하고 지연이 있습니다. 유선 이더넷이 가능한 현장에서 W5500은 무제한, 저지연, 저비용 연결을 제공합니다. GSM은 운영 비용을 최소화하면서 연결을 보장하기 위한 폴백으로 예약됩니다.
Q. "재플래시 없는 Modbus 레지스터 맵 설정"이 무슨 의미인가요? 산업 현장은 각각 다른 Modbus 레지스터 주소, 데이터 타입, 스케일링 계수를 가진 수백 가지 센서 모델을 사용합니다. 이 기능이 없으면 모든 현장 구성에 커스텀 펌웨어가 필요합니다. SD 카드의 JSON 설정으로 동일한 펌웨어 바이너리가 모든 현장에서 동작합니다 — config.json 파일만 다르면 됩니다.
