Skip to content

About

Firmware for HARDWARIO STICKER — low-power LoRaWAN sensor built on Zephyr RTOS.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

STICKER Firmware

GitHub Actions GitHub Release GitHub License


Overview

STICKER is HARDWARIO's compact LoRaWAN sensor platform: a battery-powered device that can collect environmental and motion data and connect external sensors, while running for many months on two AA battery cells.

This repository contains the open firmware for STICKER, built on the Zephyr RTOS and using the Zephyr toolchain (West, Zephyr SDK, CMake). It is intended for main firmware development and customization.

The firmware implementation covers functionality of the catalog applications:

The firmware is focused on the device side - you bring your own LoRaWAN network server, gateway and cloud/backend.

Learn more about STICKER


Key Features

STICKER platform highlights (hardware + firmware):

  • LoRaWAN connectivity for long-range, low-power wireless communication
  • Low-power design - operation from two AA battery cells with long lifetime
  • Built-in sensors
    • Temperature, humidity, light intensity
    • PIR motion detection
    • 3-axis accelerometer
  • Extensibility
    • 1-Wire interface for external temperature and other probes
    • Support for voltage measurement (up to 30 V) and digital/industrial inputs
  • NFC configuration
    • Configure LoRaWAN settings, alarms and other parameters using NFC from a phone
  • Open firmware based on Zephyr
    • Full control over application logic
    • Reuse of existing Zephyr drivers and subsystems

Firmware Capabilities (v2.0.0)

Beyond the hardware highlights above, the current firmware adds:

  • Two radios — LoRaWAN (EU868, US915, AU915, AS923) or a raw-LoRa P2P link to a HARDWARIO Hub on the TOWER protocol, one radio-mode switch, the same commands and telemetry on both
  • Remote control over the radio — configure and query the device via downlink/uplink commands (set_param/get_param/get_config/get_settings/get_info, link reset/join, reset tiers), with paged answers for the low data rates, no NFC tap or physical access required
  • Device info on join — an Info uplink (serial, firmware version, reset cause, claim token, radio mode, battery) is sent automatically on every join and clock sync
  • Real-time clock, synced from the LoRaWAN network and readable/settable over NFC or LoRaWAN
  • Sensor history (store-and-forward) — samples are captured on a fixed cadence and buffered (RAM or flash ring, depending on build) so a temporary LoRaWAN outage doesn't lose data; replay on request
  • Alarm engine — a table of up to 16 threshold/state/rate rules over the sensor channels (onboard, 1-Wire, GP inputs), a no-data watchdog and a low-battery alarm, with buzzer melodies
  • GP inputs — one owner per GP pin pair (inputs, PIR, buzzer); each input digital, pulse counter (S0 meters) or analog voltage up to 30 V
  • Encrypted local access over NFC — a phone reads/writes configuration and sends commands through the ST25DV fast-transfer mailbox (powered device), AES-CCM encrypted with an anti-replay nonce, plus a vendor-token-authenticated channel for factory/claim operations
  • Claim-token provisioning — a write-once claim token ties a physical unit to its first claiming backend without requiring a LoRaWAN join first
  • LED signalling scheme — a unified severity-ordered heartbeat (join state, alarms, radio mode) plus one-shot patterns for NFC interaction and input events

See doc/version 2.0.md for the v2.0.0 changes and upgrade notes (doc/version 1.4.md for the v1.4.0 base), and doc/manual-test-plan.md / doc/automated-test-playbook.md for how each of these is verified.


Getting Started

NixOS / Nix users: a shell.nix at the repository root provides a reproducible development environment. Running nix-shell sets up the ARM toolchain, CMake/Ninja, J-Link and — on first entry — bootstraps the Python venv and the west workspace (west init/west update), so you can skip the manual steps below and go straight to cd app && make. Note that this environment builds with the gnuarmemb toolchain (GNU Arm Embedded) rather than the Zephyr SDK used by CI, so binary size may differ slightly; use the standard setup below for size-sensitive verification.

1. Create a workspace

Create a workspace directory:

mkdir sticker

Enter the workspace directory:

cd sticker

2. Set up Python environment

Create Python virtual environment:

python -m venv .venv

Activate the virtual environment (Linux/macOS):

source .venv/bin/activate

Upgrade pip:

pip install --upgrade pip

3. Install Zephyr tooling

Install West (Zephyr meta-tool):

pip install west

Initialize Zephyr workspace and fetch modules:

west init -m https://github.com/hardwario/sticker-firmware.git

Fetch all modules:

west update

Apply the STICKER patches to west-managed modules (listed in zephyr/patches.yml; re-run after every west update). A LoRaWAN build refuses to configure while a patch is missing:

west patch apply

Export Zephyr CMake package:

west zephyr-export

Install required Python packages for Zephyr:

west packages pip --install

4. Additional tools

Install RTT terminal helper:

pip install rttt

Install Protocol Buffers tooling:

pip install protobuf grpcio-tools

5. Install Zephyr SDK

Install the appropriate Zephyr SDK version:

west sdk install

Refer to the Zephyr documentation if you need to select a specific SDK version.


Building & Flashing

All firmware-specific commands are run from the app directory:

cd app

Build (production)

make

Build (debug)

make debug

Flash firmware

make flash

Clean build outputs

make clean

Open RTT terminal

make rttt

Format source code

make format

Available make targets may evolve over time; inspect the Makefile for details.


Firmware update & security model

STICKER ships a flat application image with no bootloader (linked from the base of flash; no MCUboot, no DFU partition). The only way to update the firmware is physically over SWD with a J-Link (make flash). There is no in-field / over-the-air update: no LoRaWAN FUOTA, no NFC firmware update. The enter_dfu command was deliberately removed (#239).

This is an intentional design decision, not a limitation to be worked around:

  • Benefit — zero remote update attack surface. An image cannot be replaced, downgraded, or tampered with over the radio or NFC; only someone with physical access to the SWD pads can reprogram the device.
  • Cost — a defect found in the field cannot be fixed remotely; it requires physical access. Weigh this when triaging field issues.

Because there is no bootloader, there is likewise no image signature check and no anti-downgrade protection — those live in a bootloader, which this product does not have. If in-field update is ever introduced, design it with MCUboot from the start: signed images + monotonic anti-downgrade versioning, wired to the existing config-version scheme. Until then, the security model relies on the image being immutable in the field.


Continuous Integration

This repository uses GitHub Actions for CI:

If you make any changes, please ensure they build cleanly in CI.


Contributing

Contributions are welcome — whether you:

  • Fix a bug
  • Improve configuration or board support
  • Extend support for additional sensors
  • Enhance documentation or comments

Basic workflow

  1. Fork this repository

  2. Create a feature branch:

    git checkout -b feature/my-improvement
  3. Commit your changes with a clear message:

    git commit -am "Describe your change briefly"
  4. Open a Pull Request against main with:

    • A short description of the change
    • Any relevant notes for reviewers

Try to keep changes focused and small; it makes review easier and more pleasant for everyone.


Support & Resources

If you are using STICKER in a commercial or larger-scale deployment and need guidance, you can also reach out via the contact form on the website.


License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Made with ❤ by HARDWARIO a.s. in the heart of Europe.

About

Firmware for HARDWARIO STICKER — low-power LoRaWAN sensor built on Zephyr RTOS.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages