Monitoring sensors beyond Wi-Fi from a single panel

Sensor monitoring, relay control, alarms and remote configuration with ESP32 field devices, a LoRa gateway and a multi-tenant Laravel panel.

Monitoring sensors beyond Wi-Fi from a single panel
Industry
Endüstri
Type
Arge
Duration
4 months
Client
BayPro
Download as PDF
Industry
Endüstri
Duration
4 months
Technologies
Php-LaravelC++Laravel ReverbNode.jsTypeScriptMySQLDockerRaspberry Pi +3
4 Layers: device, gateway, broker, panel
3 Supported ESP32 board families
191 Automated gateway tests

The problem: no data where it matters most

Cold room temperature, the boiler room, a warehouse door, a generator battery… A business's most critical points are often where Wi-Fi and cabling don't reach. Giving every point its own internet link is expensive and leaves dozens of independent devices to manage.

Off-the-shelf IoT kits are usually tied to one sensor type or one cloud vendor, and adding a sensor often means reprogramming the device.

  • Read sensors at remote points without an internet connection
  • Drive relays, pumps and lighting safely from the panel
  • Add a sensor without removing or reflashing the device
  • Get notified when a threshold is crossed, and react automatically if needed
  • Manage several sites or customers separately on one platform
Mimari

Field devices never touch the internet

Field devices only know their gateway; the gateway is the only device that talks to the cloud. This is the basis of both the security model and the protocol.

  1. Field device ESP32 + LoRa
    • Sensors Temperature, humidity, light, voltage, door, motion
    • Outputs Relay, pump, lighting, buzzer
    • Fixed firmware Drivers chosen by config, code never changes
  2. Gateway Raspberry Pi
    • TypeScript service Sequential polling, command and config queue
    • Local cache Credentials and state in SQLite
  3. Cloud Laravel
    • MQTT broker Mosquitto with authentication
    • Control panel Multi-tenant; devices, telemetry, alarms
    • Live stream Reverb updates without page reloads
Live value, history and configuration of every device on one screen
Device detail

Live value, history and configuration of every device on one screen

Each field device's page updates its latest readings live, plots the last 24 hours and lists its attached sensors and outputs. A failing sensor does not make the device look "offline": if communication continues, the sensor error is shown separately.

The configuration saved in the panel and the one actually applied by the device are tracked separately. When they match a "Synced" badge appears, and every change is recorded in the version history.

Uzaktan yapılandırma

A new sensor goes live without reprogramming the device

The firmware on the device is fixed; which sensor sits on which pin is set by a configuration file. It is sent from the panel over LoRa in chunks, verified and applied without a restart.

  1. Panel Desired state
    • Add a sensor Pick driver, pin and unit
    • Version bump The change is logged
  2. Gateway Reconcile
    • Version check Which config is the device on?
    • Chunked push Short LoRa packets, each acknowledged
  3. Field device Apply
    • Integrity check A corrupt config is never applied
    • Hot apply Drivers set up without a restart
  4. Panel Reported state
    • Synced Desired equals applied
    • First reading On the chart within seconds
Notified when a threshold is crossed — and automatic action if needed
Alarms

Notified when a threshold is crossed — and automatic action if needed

Each sensor can have a numeric threshold, a range, an on/off condition or a "no data" rule. A number of consecutive readings prevents a single spike from raising an alarm, and a cooldown prevents repeated notifications.

A rule can trigger an action — such as switching off a pump when the boiler overheats — and optionally reverse it when the alarm clears. Active alarms arrive live, can be acknowledged and are kept in history.

Radyo katmanı

How the LoRa link is protected

How the LoRa link is protected
TopicChoiceWhy
Frequency 433 MHz ISM band Licence-free, good propagation indoors and at range
Module EBYTE E22-400T22D UART interface, configurable channel and rate
Packet Fixed header + CBOR payload Short airtime, schema-validated
Integrity HMAC-SHA256, per-device key Forged or altered packets are rejected
Replay protection Increasing sequence number, kept across reboots A recorded old packet cannot be replayed
Encryption None, payload in clear Legal constraint in the ISM band; integrity via HMAC
Channel access One ordered queue on the gateway Two transactions never collide on a half-duplex radio
Key distribution Only at first setup, over USB or the browser Secret keys are never sent over the air
Sürücü kataloğu

Supported sensors and outputs

Supported sensors and outputs
DriverMeasures / doesStatus
Sensors
DHT11, DHT22 Temperature and humidity Field-tested
ADC Voltage (calibrated reading) Field-tested
BH1750 Light level (lux) Beta
DS18B20 Temperature via waterproof probe Planned
Digital inputs
PIR Motion Field-tested
Button, magnetic contact Press, door/lid open-closed Beta
Outputs
Relay, LED, buzzer, digital out On/off command Field-tested
PWM Graduated output Planned
Boards
ESP32-S3, ESP32-WROOM-32, ESP32-C3 Same firmware built for all three Build verified

Beta: firmware ready and building, awaiting field testing.

Field reliability is part of the design

Visiting a remote device is expensive; the system must report its own state accurately, and a bad change must never brick a device.

Tarayıcıdan kurulum

Cihaz USB ile bağlanır, Chrome veya Edge'den tek tıkla programlanır; kimliği ve anahtarı o anda yazılır.

Kendini tanıtan cihaz

Açılan cihaz ağ geçidine imzalı bir "buradayım" mesajı gönderir; sensör tanımlanmamış olsa bile panelde çevrimiçi görünür.

Sürümlü ayarlar

İstenen ve uygulanan ayar ayrı izlenir; ayar bütünlük kontrolünden geçmeden uygulanmaz.

Sensör sağlığı

İletişim kopukluğu ile sensör arızası ayrı gösterilir; son geçerli okuma korunur.

Ağ geçidi güncellemesi

Ağ geçidi sürümünü bildirir; yeni sürüm olduğunda panelden güncellenir.

Çok kiracılı yapı

Her tesis ya da müşteri kendi cihazlarını, verisini ve alarmlarını görür; platform yönetimi ayrı bir roldür.

Lessons from the field

Every stage was tried on real hardware (ESP32-S3, an E22 LoRa module, a Raspberry Pi). Most problems that never show up on a desk surfaced there and fed back into the design:

  • The never-seen device. A device with no sensors defined was never handed to the gateway and stayed "never seen". Devices now announce themselves with a signed message.
  • Late first reading. Adding an hourly sensor meant the first value arrived an hour later. A one-off read is now triggered as soon as the config is applied, so the first value arrives in seconds.
  • Low voltage readings. The raw ADC formula read about 20% low without calibration; readings now use the chip's own calibration data.
  • Colliding radio traffic. Independent timers for several devices could collide on the half-duplex module; all radio transactions now go through one ordered queue.
  • False "offline". A device with a failed sensor but working link looked offline; link and sensor health were separated.

Panel screens

Click an image to enlarge it.

Tüm cihazlar: ağ geçitleri, saha cihazları ve durumları
Cihaz detayı: canlı değer ve son 24 saat
Işık sensörü ve panelden sürülen aydınlatma rölesi
Aktif alarmlar ve kurallar

Screenshots were taken with demo data from a fictional site.

How it developed

  1. May 2026

    Architecture decisions and protocol

    Four-layer structure, LoRa security model and single-source code generation decided.

  2. May 2026

    End-to-end telemetry on real hardware

    Continuous data from an ESP32 sensor to the cloud chart; gateway and broker live.

  3. June 2026

    Device setup from the browser

    One firmware for three boards, browser flashing and one-command gateway setup.

  4. June 2026

    Remote configuration and commands

    Hot configuration and driving a real relay from the panel verified in the field.

  5. June 2026

    Alarms and sensor health

    Alarm rules, automatic actions, notification settings and self-announcing devices added.

Technology

Technologies

Backend

Php-Laravel C++ Laravel Reverb Node.js TypeScript

Database

MySQL

DevOps

Docker

Other

Raspberry Pi ESP32 MQTT (Mosquitto) LoRa

Points in your facility you want to monitor?

Let's plan it together, from sensor choice to field installation and the control panel.

More projects

Related Projects

Endüstri from the industry

Endüstri Özel Yazılım

Tork Kalibrasyon Makinası İşletim Yazılımı

Test süreçleri ile makine kontrol operasyonları tek yazılım çatısı altında birleştirilerek daha kontrollü, izlenebilir ve verimli bir çalışma yapısı oluşturuldu

2025 2 mo Read

Have a similar project?

Share your needs and we will design and deliver a tailored solution.

Contact Us