---
title: "Connecting LumiSafe masts to a software gateway, for railway track safety"
description: "For Cesatec, a Python gateway and the firmware of the LumiSafe masts, a patented safety system for railway maintenance, linked by a serial protocol designed to stay compatible from one version to the next."
url: "https://mc-stud.io/en/work/lumisafe-mast-signalling"
author: "Matisse Chenavas"
date: "2026-04-08"
lang: "en"
---

# Connecting LumiSafe masts to a software gateway, for railway track safety

> LumiSafe masts talk to a software gateway over a serial protocol that evolves without breaking masts still running an earlier version.

- **Client**: Cesatec
- **Sector**: Railway safety, track maintenance
- **Period**: 2026
- **My role**: Designer and sole developer of the gateway and the firmware
- **Setting**: Through a partner
- **Team**: Solo · 1 person
- **Technologies**: Python, Arduino, UART
- **Reading time**: 2 min

## At a glance

- **Stake**: On a track under maintenance, everyone must know in real time whether an agent protects it, including the team leader, remotely.
- **Mechanism**: A Python gateway, Hermes, talks to the masts' Arduino firmware over UART; the protocol carries a lock mode and team assignment.
- **Proof**: The code and documentation of the gateway and the firmware, which I wrote alone between February and April 2026.
- **Impact**: Each mast’s state becomes readable by software, which serves remote supervision, and the protocol grows without updating every mast at once.
- **Limits**: Field deployment and its results are not documented here: this case describes the software, not its operation.

## The starting point

LumiSafe is Cesatec's patented system for the safety of railway maintenance agents[^product]. On the track, light masts receive the agents' badges, and agents signal their presence that way. The colour code reads from afar: green, the track is not protected; orange, protection is requested, type 1, 2 or 3; red, the track is protected by an agent. Team leaders follow these states remotely, in real time.

For that information to flow, each mast must talk reliably to software, and that dialogue must be able to evolve without immobilising the hardware already installed.

## What I built

I developed both ends of the chain: Hermes, a Python gateway, and the masts' Arduino firmware, linked by a serial protocol over UART. The protocol carries a lock mode, the fields that assign a mast to a team, and a mast variant with an OLED screen.

One rule guides everything else: evolve the protocol without breaking compatibility with earlier versions[^compat]. A mast that has not been updated must keep working with a newer gateway.

> [!TIP] Design a hardware protocol like a public API
> Once devices are in service, you never update them all on the same day. Adding fields without changing the meaning of the old ones takes a little discipline, and saves synchronising a whole fleet.

## What the evidence shows

The work lives in two repositories, the gateway and the firmware, with their documentation and project rules[^git]. There is no screenshot: this work has no interface to show, only a protocol and two programs that speak it.

## What it changes

Each mast's state, an agent's presence, the protection requested or granted, becomes data that software can read and pass on, which makes remote follow-up by team leaders possible. The protocol can grow without forcing every mast to update at once.

## Limits

- I designed neither the LumiSafe system nor its patent: my scope is the gateway and the firmware.
- No field indicator is available: number of masts, worksites, incidents avoided.
- This case publishes neither the protocol nor the code, which belong to the engagement.

[^product]: Product description based on the LumiSafe page of Cesatec's website, linked in the project facts.

[^compat]: Project rule written in the repositories: prefer backward-compatible protocol changes.

[^git]: Sole author of both repositories: 11 commits on the gateway, from February to April 2026, and 3 on the firmware, in February 2026.

## Links

- [LumiSafe, on Cesatec’s website](https://cesatec.fr/marques/lumisafe/)

---

Matisse Chenavas, Founder of MC Studio. https://mc-stud.io/en/work/lumisafe-mast-signalling
