Skip to main content

BERadio is an encoding specification and implementation for efficient communication in constrained radio link environments. It is conceived and used for over-the-air communication within the Hiveeyes project.

Project description

CI outcome Test suite code coverage PyPI downloads per month Package version on PyPI Project status (alpha, beta, stable) Support Python versions Project license

BERadio README

About

BERadio is an encoding specification and implementation for efficient communication in constrained radio link environments. It is conceived and used for over-the-air communication within the Hiveeyes project.

Together with Kotori, a multi-channel, multi-protocol data acquisition and graphing toolkit for building flexible telemetry solutions, it powers the Hiveeyes system on the gateway side, which you can enjoy by visiting the Hiveeyes platform.

Usage

Handbook

The beradio Python distribution provides convenient commandline-based decoding tools for working with messages in Bencode and BERadio formats, called beradio, bdecode, bencode, and bemqtt.

For more information, have a look at the BERadio handbook.

Synopsis

Decoding an example message on the command line.

$ bdecode d1:#i999e1:_2:h11:hli488ei572ee1:tli2163ei1925ei1092ei1354ee1:wi10677ee
OrderedDict([('#', 999), ('_', 'h1'), ('h', [488, 572]), ('t', [2163, 1925, 1092, 1354]), ('w', 10677)])
$ beradio decode d1:#i999e1:_2:h11:hli488ei572ee1:tli2163ei1925ei1092ei1354ee1:wi10677ee --protocol=2
{
    "meta": {
        "protocol": "beradio2",
        "network": "b6a6b04c-a929-4a6c-9238-185e9af79eed",
        "gateway": "deh22",
        "node": "999",
        "time": 1659487642526373120,
        "profile": "h1"
    },
    "data": {
        "hum1": 4.88,
        "hum2": 5.72,
        "temp1": 21.63,
        "temp2": 19.25,
        "temp3": 10.92,
        "temp4": 13.54,
        "wght1": 106.77
    }
}

Environment

There are a number of Arduino sensor nodes in the field communicating unidirectional via radio link to a central Arduino acting as a gateway. The gateway Arduino receives message payloads and writes them verbatim to the serial port connected to a Raspberry Pi, which transforms and forwards the messages to a MQTT bus.

The data now being on the bus, arbitrary systems can consume information by subscribing to specific MQTT topics where measurement events are delivered.

The Kotori multichannel DAQ subscribes to topics on the MQTT bus, receives telemetry data payloads and stores the measurements into a contemporary time-series database. After that, Grafana is used to display the measurement information.

Details

Features

BERadio is a specification and also provides reference implementations for Arduino and Python.

  • Some details have been written down in the BERadio specification document.

  • It uses the Bencode format on the wire to provide space-efficient data encoding.

  • beradio forward processes data messages received over the air and forwards them to MQTT.

  • libberadio will be an appropriate C++ library for Arduino.

The main workhorse

beradio forward ingests message payloads from a serial interface, sanitizes and decodes them from Bencode format and republishes the data to a MQTT topic.

The MQTT topic name used for publishing is derived from some parameters contained in the data of the message, the topic template used for this is currently programmed to {realm}/{network}/{gateway}/{node}/{field}. The actual values will get separated, mapped and formatted in different variants before republishing them to MQTT.

Project information

Contributing

We are always happy to receive code contributions, ideas, suggestions and problem reports from the community. Spend some time taking a look around, locate a bug, design issue or spelling mistake and then send us a pull request or create an issue ticket.

Thanks in advance for your efforts, we really appreciate any help or feedback.

License

This software is copyright © 2015-2022 The Hiveeyes developers. All rights reserved.

Use of the source code included here is governed by the GNU Affero General Public License and the European Union Public License. The software is and will always be free and open source software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beradio-0.13.1.tar.gz (72.3 kB view details)

Uploaded Source

Built Distribution

beradio-0.13.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file beradio-0.13.1.tar.gz.

File metadata

  • Download URL: beradio-0.13.1.tar.gz
  • Upload date:
  • Size: 72.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for beradio-0.13.1.tar.gz
Algorithm Hash digest
SHA256 ef14fddac2ced78efe31572514d1182725f00d1f28b12ff9ff37a366dd8fc64e
MD5 067ee05ad79ec9fe3d1ad2ab0dedf010
BLAKE2b-256 b438654a24af27e62db063c721e2560b22e615f9336e005f8ea245794c718606

See more details on using hashes here.

File details

Details for the file beradio-0.13.1-py3-none-any.whl.

File metadata

  • Download URL: beradio-0.13.1-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for beradio-0.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64af54b63b06d8bc812513f501ec0fa56a36ab445176cf3fac0b6cfb88b43903
MD5 9b806003c51a63c104daa80888fd5a0a
BLAKE2b-256 eeca035245ea88262477e8ebba8f0bcbc655552a15fdd2d6db3fa2667b185ef9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page