mgrub / demo_sensor_network

demonstration of a sensor network with actual hardware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sensor Network Demonstrator

This is the repository for a small sensor network demonstrator. It can be used to demonstrate various aspects of the IoT like edge device/fog/cloud devices, data streams, sensor self-description, homogeneous/heterogeneous networks, absolute time synchronization and wireless sensor networks. To do so, it builds on existing standards (WIFI, MQTT, NTP, GPS, JSON) and uses off-the-shelf hardware.

The repository documents:

  • hardware setup
  • communication setup
  • Arduino microcontroller code
  • Arduino programming environment
  • RaspberryPi setup

Hardware Setup

  • 3x Arduino Nano 33 IoT
  • 1x RaspberryPi 4
  • 1x Waveshare NEO-M8T GNSS TIMING HAT
  • power supply and mount for the Arduinos
  • power supply, case and fan for the RaspberryPi
  • 1x development PC

Communication Setup

┌───────────┐  ┌───────────┐  ┌───────────┐
│ Arduino 1 │  │ Arduino 2 │  │ Arduino 3 │
│           │  │           │  │           │
│   - Wifi  │  │   - Wifi  │  │   - Wifi  │
└────┬──────┘  └────┬──────┘  └────┬──────┘
     │ ▲            │ ▲            │ ▲
 MQTT│ │        MQTT│ │        MQTT│ │
     │ │NTP         │ │NTP         │ │NTP
     ▼ │            ▼ │            ▼ │
┌──────┴──────────────┴──────────────┴────┐
│ Raspberry Pi                            │
│                                         │  Serial    ┌─────────────────┐
│   - Wifi Accesspoint                    │◄───────────┤ GNSS satellites │
│   - MQTT Broker                         │  Interface └─────────────────┘
│   - NTP Server                          │
└─────────┬───────────────────────────────┘
          │                 ▲
          │                 │
      MQTT│             MQTT│
          │                 │
          ▼                 ▼
      ┌───────┐     ┌────────────────┐
      │ Users │     │ Cloud-Services │
      └───────┘     └────────────────┘

MQTT topics

  • each Arduino publishes to multiple MQTT topics
    • <sensor_name>/data -> json
    • <sensor_name>/description -> json

Useful Resources

Security Setup

Network Level

Wifi connections from and to the RaspberryPi / MQTT Broker are encrypted using WPA2. Thi effectively blocks attackers that do not have the Wifi credentials.

Network level security could be increased further by whitelisting (MAC-addresses of) allowed devices.

Transport Level

A username and password is required to read and write topics from the MQTT broker. However, the message transport itself is not encrypted.

To enable transport encryption a TLS/SSL certificate needs to be issued for the MQTT broker.

Application Level

The payload of the MQTT message is a non-encrypted JSON-string.

TODO / Future Ideas

  • MQTT agent for AgentMet4FoF -> check out https://github.com/PTB-M4D/thementag-demo
  • test high sampling rates (500-1000 Hz)
  • adjust messages sent by Arduino (e.g. follow BMBF FAMOUS approach of eclipse unide)
  • adjust self-description message (to something more semantic like JSON-RDF-triples, currently only {"id": "sensor_1"})
  • include uncertainty service to add uncertainty based on self-description

About

demonstration of a sensor network with actual hardware

License:MIT License


Languages

Language:C++ 89.8%Language:Python 10.2%