TM32-InfluxDbClient
TM32-InfluxDbClient
Project Overview
STM32-InfluxDbClient is a project that uses the STM32F103ZET development board and the W5100 Ethernet controller to send metric data generated by an embedded device directly to InfluxDB over a wired network. The repository describes it as an InfluxDB metric transmission example based on an “STM32F103ZET board + W5100 Ethernet Controller (wired),” and the platformio.ini file is configured for the genericSTM32F103ZE board with the Arduino framework.
The main value of this project is that it shows how an MCU can write data directly to a time-series database without a separate PC application or a complex gateway. In this sense, it is a lightweight telemetry example in which an embedded system operates as a network node and uploads collected sensor or device status data straight to InfluxDB. The code generates data every 5 seconds and sends it using the InfluxDB HTTP write API format.
How the Project Works
At startup, the program configures the Ethernet connection method, using Static IP + DNS + Gateway by default. It then periodically calls GetMetricsAndTag() to combine the measurement name, tags, and metric values, and sends them through either Send_Influx() for standard TCP or Send_Influx_SSL() for SSL.
The default measurement is "temperature", with example tags such as device=embarcado and rack=Titan, and example fields such as temperature=10.29 and humidity=10.3.
Overall, the project clearly shows the flow of “sensor data generation → line protocol conversion → InfluxDB upload.” Because the structure is simple, it is easy to understand how data moves from an embedded device to a time-series database.
What is Ethernet_STM?
Ethernet_STM is a fork of the standard Arduino Ethernet library, adapted specifically for STM32 boards. The original Arduino Ethernet library targets AVR-based hardware and is not directly compatible with STM32's SPI peripheral and memory layout. Ethernet_STM resolves this by providing the same familiar Arduino EthernetClient API while handling the low-level differences of the STM32 platform. This allows the project to use the W5100 on an STM32 board without rewriting the networking layer from scratch.
(Ref. There is another STM32library is based on LwIP, a Lightweight TCP/IP stack for Arduino)
Key Features
1. Wired Ethernet-Based Data Upload
This project uses W5100-based wired Ethernet instead of Wi-Fi. That makes the network structure simpler and more suitable for environments that require wired connections, such as equipment networks or fixed installations.
2. Direct InfluxDB Integration
Unlike many simple IoT examples that rely on an intermediate gateway or server, this project allows the MCU to directly build HTTP requests and send data to InfluxDB.
3. Separate Tag and Metric Modeling
The code manages tags and metrics separately through TagContainer and MetricContainer, and then serializes them into InfluxDB line protocol. This makes the project useful for understanding the basics of time-series data modeling.
4. SSL Transmission Path
The code also includes a Send_Influx_SSL() path for HTTPS-based transmission. However, SSL is disabled by default, and certificate verification is omitted, so additional work would be required for production-level security.
Technical Significance
This project demonstrates an edge telemetry architecture in which an embedded device acts as both a data producer and a data uploader. Rather than serving only as a peripheral node, the MCU directly connects to a central time-series database over the network. This simplifies the data collection path and clearly illustrates how device status can be managed over time.
Because the code is relatively short and simple, it also serves as a good example for learning three concepts in one place: embedded networking, HTTP-based data transmission, and time-series data structuring.
What is influxDB?
InfluxDB is a time-series database designed to efficiently store, organize, and query timestamped data such as sensor readings, device status, and telemetry logs. In this project, it serves as the backend database that receives metric data generated by the embedded device and stores it in a structured time-series format. By using InfluxDB, the system can manage continuously collected data over time and later connect it with visualization or monitoring tools such as Grafana. This makes the project suitable not only as a simple data transmission example, but also as a foundation for practical monitoring and industrial IoT applications.
| 플랫폼 | 방법 | 비고 |
| ESP32 / ESP8266 | InfluxDB-Client-for-Arduino | InfluxDB 공식 |
| STM32 | HTTP write API 직접 호출 | 이번 프로젝트 |
| Arduino UNO/Mega | Ethernet shield + HTTP 직접 구현 | 메모리 제약 |
| Raspberry Pi | Python 공식 클라이언트 | 리눅스 기반 |
| Raspberry Pi Pico W | MicroPython HTTP 직접 구현 |
Potential Applications
Although it is currently an example-level implementation, the structure can be extended to many real applications. If the MCU collects values such as temperature, humidity, voltage, current, network status, or equipment operating time and stores them in InfluxDB, the system could be expanded into environmental monitoring, equipment status tracking, rack-level sensor logging, or industrial IoT telemetry, especially when combined with visualization tools such as Grafana.
