
Development of Firmware for Remote Monitoring Device for Wastewater Pumping Stations
Project Background
The device detects and reports, in real time:
- blockages within the system
- pump activity
- pump malfunctions and failures
- excessive water levels
- various alarms indicating problems in the system

In this type of deployment, devices are often inaccessible, failures are expensive, and post-deployment changes are limited, making firmware architecture, diagnostics, and long-term maintainability critical from day one.
Although a proof of concept existed, it was not designed to scale into a product platform. It fulfilled its purpose as a feasibility validation, but its structure made further development, maintenance, and manufacturing increasingly difficult. In parallel, the client wanted to migrate to Zephyr RTOS and introduce LwM2M for device management while being compliant with the EN 303 645 cybersecurity standard.
The required work exceeded the team’s internal capacity and Zephyr’s experience, which is why they engaged us.
Key Challenges
- the firmware was implemented as a bare-metal application, without an RTOS
- firmware requirements did not exist
- the structure of existing firmware was not convenient to port on Zephyr
- LwM2M needed to be introduced from scratch
- the hardware design included a cellular modem not supported by Zephyr at the time
Our Contribution
We were responsible for establishing a firmware foundation that could support long-term product evolution so that their internal team could continue the development.
This included:
- porting the existing bare-metal firmware to Zephyr RTOS
- defining and implementing a scalable and maintainable firmware architecture
- introducing low-power cellular technologies (NB-IoT and LTE-M)
- implementing LwM2M for remote monitoring and device management
- ensuring stable operation under real-world conditions
- transferring knowledge to the client’s internal team to enable independent future development.
Here is how we did it.
Architecture
Definition
We performed a comprehensive analysis of the existing system, covering both software and hardware, followed by:
- a structured risk analysis
- definition of a new firmware architecture
Multiple architectural options were discussed with the client. While the initially proposed approach was sufficient for a Proof of Concept, it would have resulted in tight coupling between hardware-specific code and application logic, limiting scalability and future extensions.
From the standpoint of long-term maintainability, system quality, and scalability, the client decided to proceed with the architecture proposed by us.
Key Characteristics
The final solution was based on:
- event-driven architecture
- clearly separated layers:
- Board Support Package (BSP) with low-level drivers
- application layer built on top
- Finite State Machine (FSM) to ensure deterministic and reliable state handling
- modular design, enabling reuse and extension across future products
This structure allowed the system to remain predictable, testable, and adaptable as requirements evolved.
Zephyr RTOS Implementation
The focus was on establishing a stable development environment before scaling application development.
This included:
- setup of the complete Zephyr development environment and selection of an appropriate RTOS version
- creation of a custom Zephyr board, including:
- device tree configuration
- tailoring Zephyr settings to the specific hardware platform
- development of Board Support Package, including:
- low-level drivers
- adaptation of unsupported components
- implementation of FSM and event-based logic
- cellular modem activation and integration
- development of the application layer and functional modules
Cellular Connectivity
At the start of the project, suitable modem drivers did not exist in Zephyr. A generic cellular driver became available later, but it was immature, unstable, and affected by multiple defects.
To achieve reliable communication, the following steps were required:
- adaptation of existing driver components to the specific modem
- implementation of missing and modem-specific functionality
- stabilization of modem behavior under real operating conditions
The system was extended to support multiple cellular technologies as well:
- NB-IoT for underground and remote locations
- LTE-M for higher data throughput
LwM2M Integration
A complete LwM2M communication stack was implemented, including:
- integration with the client’s selected backend platform
- definition of custom LwM2M objects and resources
- clear and systematic configuration of subsystem parameters such as digital I/O states, polarity, debouncing, and alarm intervals.
This provided the client with:
- structured device data view
- simplified device management
- improved remote diagnostics and control
- reduced cellular data usage
- lower power consumption through lightweight, efficient communication and event-based reporting
- scalability for future device generations and firmware updates without architectural rework
- a standardized and vendor-agnostic foundation for long-term device lifecycle management
Testing and CI/CD
The system was thoroughly tested across multiple operating scenarios, with a strong focus on stability and uninterrupted long-term operation.
We implemented our internal engineering processes, including:
- GitLab-based CI/CD pipeline
- static code analysis (SonarQube)
- automated build systems
- detailed test plans and extensive test coverage
Hardware Issues
Several critical hardware issues were identified, which were causing connection drops, an inability to register on the cellular network, and unpredictable system behavior.
Our team identified the root causes and proposed concrete hardware design changes to improve overall system reliability.
The first limitation was insufficient memory capacity. The existing microcontroller did not provide enough resources for a Zephyr-based system, which led to a microcontroller replacement.
Further analysis revealed power supply design issues, including inadequate voltage regulation and diode failures in the rectifier stage. These problems affected overall system stability under load.
In addition, the cellular modem was supplied at the minimum operating voltage, which caused random modem resets during network activity.
Results
- fully ported system on Zephyr RTOS
- a scalable and maintainable firmware platform
- support for previously unsupported modem
- stable, market-ready system
- extensively tested firmware covering all critical scenarios
- documented solutions and knowledge transfer to the internal team
- clear future development guidelines
This project established a solid foundation for an entire product line, with reduced technical risk and shorter development cycles going forward.
In parallel, we worked closely with the client to define:
- the firmware specification
- expected system behavior
- and key technical requirements
This was supported by our internal development practices, including:
- structured requirements definition
- clear firmware architecture organization
- CI/CD setup
- coding standards
- and a systematic approach to testing and documentation.
As a result, the client gained not only a stable solution for the current project, but a long-term, sustainable firmware framework and know-how, so they can independently maintain and evolve in future developments.



