Abstract
OFMon is an open-source Internet of Things (IoT) project. Offline-first smart energy monitoring platform using Rust, ESP32, Thingsboard, and a fork of Thingsboard Mobile flutter app. There have been numerous smart energy monitoring systems based on the Internet of things (IoT). In most of these systems, the end devices are directly connected to a network and are continuously sending out their data. It is built using Rust, ESP32. The complete source code is publicly available on GitHub under the GNU General Public License v3.0, making it a useful reference for students building an Internet of Things (IoT) mini project or final-year project.
1. Introduction
There have been numerous smart energy monitoring systems based on the Internet of things (IoT). In most of these systems, the end devices are directly connected to a network and are continuously sending out their data. This poses a real challenge in environments where a reliable wireless connection is not always available, e.g., inside containers, remote locations, or even in places where there is simply no proper infrastructure for wireless communication.
I have developed an offline-first energy monitoring system using ESP32 microcontrollers and their bleeding-edge Rust ecosystem to store data locally in their flash. The readings are collected from the devices by connecting to their access point and are saved on the local storage using a smartphone running a fork of the Thingsboard Flutter Mobile application. After collecting the telemetry data from the devices and when a network connection is available, the mobile app can flush the data of all the devices to the Thingsboards server, an IoT platform used for data collection and visualization. Rust is a type-safe and memory-safe system programming language, it provides its safety guarantees at compile time using rules that eliminate many memory-safety issues. There has been a significant adoption using Rust for embedded development after companies like STMicrocontrollers and Espressif Systems introduced their community projects for enabling the use of the Rust programming language on their SoCs and modules.
A Current transformer is connected to the ADC subsystem of the ESP32 microcontroller and is used to calculate the RMS current and voltage and kWh of the power line. These readings are periodically saved to flash storage. The device also creates a Wi-Fi access point using a unique SSID that is a combination of its MAC address and a predefined string. It then spins up a web server to which clients can request telemetry data along with other operations.
2. Objective
Offline-first smart energy monitoring platform using Rust, ESP32, Thingsboard, and a fork of Thingsboard Mobile flutter app.
This project demonstrates how Rust, ESP32 can be applied to a real-world Internet of Things (IoT) problem.
4. Technology Stack
5. System Requirements
General requirements for this technology stack — check the README for exact versions.
- Rust toolchain (rustup / cargo)
- Git (to clone the repository)
6. Installation & Setup
git clone https://github.com/arashsm79/OFMon.git
cd OFMon- Send the current time in UNIX epoch time format to the device to update its RTC. If you are connected to the Internet, this time is taken online, and otherwise, the time of the mobile phone itself is used.
- The memory of the device should be reset to make sure that no unwanted data remains in the memory.
Full setup instructions are in the project README.
7. Future Enhancements
Suggested extensions you can add to make this your own project.
- Add a mobile dashboard using Blynk or Firebase
- Store readings in a cloud database for history charts
- Add alerts via SMS / Telegram when thresholds are crossed
8. Viva / Review Questions
Common questions examiners ask for projects in this domain.
- Which microcontroller / board and sensors are used and why?
- How does the device send data (Wi-Fi, MQTT, HTTP, Bluetooth)?
- Where is the sensor data stored and visualised?
- How is power consumption managed?
- How would you secure the device and its communication?
9. Source Code & License
This project is developed by arashsm79 and published on GitHub under the GNU General Public License v3.0. Please follow the license terms and credit the original author when you use or modify this code.
Want to build this as your internship project?
Work on an Internet of Things (IoT) project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.
Apply for Internet of Things (IoT) Internship