Sign inSign up

irfanuruchi/wmn-collector

By irfanuruchi

Updated 9 months ago

Image
0

1.8K

irfanuruchi/wmn-collector repository overview

WMN Dockerized Edge Gateway – Collector (Docker Image)

This project provides a Dockerized edge collector that measures wireless/network performance and publishes metrics to an MQTT broker (e.g., HiveMQ Cloud). It is designed for Raspberry Pi edge deployment and also supports PC/WSL/macOS for development and testing.

The Docker image includes a first-run interactive setup wizard that stores configuration inside a persistent Docker volume.


What the Collector Publishes

Each interval, the collector publishes a JSON payload that includes:

  • latency_ms_avg – average ping latency
  • jitter_ms – ping jitter (mdev approximation)
  • packet_loss_pct
  • rssi_dbm – Wi-Fi RSSI (Linux + real Wi-Fi only, e.g., Raspberry Pi)

MQTT topic format:

<MQTT_TOPIC>/<DEVICE_ID>

Default:

wmn/metrics/<device hostname>

Docker Image

Docker Hub:

irfanuruchi/wmn-collector:latest

This is a multi-architecture image:

  • linux/amd64 – PCs, Windows WSL, macOS(older Intel based Macs)
  • linux/arm64 – macOS (Apple M series of chips) , Raspberry Pi

Use this mode on Raspberry Pi to enable Wi-Fi RSSI collection via iw.

1) Pull the image
docker pull irfanuruchi/wmn-collector:latest
2) Run (first time – interactive setup)
docker run -it --name wmn-collector \
  --restart unless-stopped \
  --net=host --privileged \
  -v wmn_config:/config \
  -v wmn_data:/data \
  irfanuruchi/wmn-collector:latest

The container will prompt for:

  • MQTT broker host
  • port (default 8883)
  • TLS (default 1)
  • username/password
  • device ID
  • topic base, ping target, interval, Wi-Fi interface

Configuration is saved to:

/config/config.env

inside the Docker volume wmn_config.

3) Detach without stopping

Press:

Ctrl + P, then Ctrl + Q
4) View logs
docker logs -f wmn-collector
5) Stop / start
docker stop wmn-collector
docker start wmn-collector
6) Remove container (keeps volumes)
docker rm -f wmn-collector

Quick Start – PC / Windows WSL / macOS

In WSL/macOS/PC Docker environments, RSSI is expected to be null because Wi-Fi radio information is not accessible inside the container VM.

Pull
docker pull irfanuruchi/wmn-collector:latest
Run (interactive setup)
docker run -it --name wmn-collector \
  --restart unless-stopped \
  -v wmn_config:/config \
  -v wmn_data:/data \
  irfanuruchi/wmn-collector:latest
Logs
docker logs -f wmn-collector

Non-Interactive Mode (Optional)

If preferred, configuration can be passed directly via environment variables.

Example
docker run -d --name wmn-collector \
  --restart unless-stopped \
  -e MQTT_BROKER="xxxxxx.s1.eu.hivemq.cloud" \
  -e MQTT_PORT="8883" \
  -e MQTT_TLS="1" \
  -e MQTT_USERNAME="wmn-client" \
  -e MQTT_PASSWORD="YOUR_PASSWORD" \
  -e DEVICE_ID="irfanwmn" \
  -e MQTT_TOPIC="wmn/metrics" \
  -e PING_TARGET="1.1.1.1" \
  -e INTERVAL_SEC="5" \
  -v wmn_data:/data \
  irfanuruchi/wmn-collector:latest

On Raspberry Pi, add --net=host --privileged to enable RSSI.


Persistence

This image uses Docker volumes for persistence:

  • Configuration: wmn_config/config/config.env
  • Offline buffer (SQLite spool): wmn_data/data/spool.db

Volumes remain even if the container is removed.

List volumes:

docker volume ls

Expected Behavior Notes

RSSI (rssi_dbm)
  • ✅ Works on Raspberry Pi / Linux with real Wi-Fi interface
  • ❌ Expected null on Windows Docker, WSL, and macOS
MQTT Connection

Successful connection shows:

[mqtt] on_connect rc=0 connected=True

Troubleshooting

Container name already exists
docker rm -f wmn-collector
Check Wi-Fi on Raspberry Pi host
iw dev wlan0 link
View logs
docker logs -f wmn-collector

Academic Value

This project demonstrates:

  • Edge-based wireless monitoring using Raspberry Pi
  • Containerized deployment with Docker
  • Secure runtime configuration (no secrets baked into images)
  • MQTT-based telemetry
  • Offline buffering with SQLite
  • Cross-platform development and testing (WSL/macOS/PC) with hardware-dependent metrics collected at the edge

Tag summary

Content type

Image

Digest

sha256:5dbe87d5a

Size

52.3 MB

Last updated

9 months ago

docker pull irfanuruchi/wmn-collector