Development of the BERadio RFM-to-MQTT gateway software


i would like to use the LinkIt Smart 7688 Duo as gateway and data forwarder to let data converge from the radio to the MQTT bus. I am currently running a recent version of LEDE on it.

I installed python-pip, but the installation of BERadio does not work.
This is the Stacktrace:

root@LEDE:/# pip install -v --index-url= beradio
Collecting beradio
  1 location(s) to search for versions of beradio:
  Getting page
  Looking up "" in the cache
  No cache entry available
  Starting new HTTPS connection (1):
  "GET /hiveeyes/python/eggs/beradio/ HTTP/1.1" 200 None
  Updating cache with response from ""
  Analyzing links from page
    Skipping link (from; not a file
    Found link (from, version: 0.4.4
    Found link (from, version: 0.5.0
    Found link (from, version: 0.6.0
    Found link (from, version: 0.7.0
    Found link (from, version: 0.8.0
  Using version 0.8.0 (newest of versions: 0.4.4, 0.5.0, 0.6.0, 0.7.0, 0.8.0)
  Looking up "" in the cache
  Current age based on date: 67
  "GET /hiveeyes/python/eggs/beradio/beradio-0.8.0.tar.gz HTTP/1.1" 304 0
  Using cached
  Downloading from URL (from
  Running (path:/tmp/pip-build-1gZhDi/beradio/ egg_info for package beradio
    Running command python egg_info
    /usr/lib/python2.7/distutils/ UserWarning: Unknown distribution option: 'entry_points'
    /usr/lib/python2.7/distutils/ UserWarning: Unknown distribution option: 'include_package_data'
    /usr/lib/python2.7/distutils/ UserWarning: Unknown distribution option: 'install_requires'
    /usr/lib/python2.7/distutils/ UserWarning: Unknown distribution option: 'zip_safe'
    /usr/lib/python2.7/distutils/ UserWarning: Unknown distribution option: 'test_suite'
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: invalid command 'egg_info'
Cleaning up...
Command "python egg_info" failed with error code 1 in /tmp/pip-build-1gZhDi/beradio/
Exception information:
Traceback (most recent call last):
  File "/tmp/pip-build-R0GTLf/pip/pip/", line 215, in main
  File "/tmp/pip-build-R0GTLf/pip/pip/commands/", line 324, in run
  File "/tmp/pip-build-R0GTLf/pip/pip/req/", line 380, in prepare_files
  File "/tmp/pip-build-R0GTLf/pip/pip/req/", line 634, in _prepare_file
  File "/tmp/pip-build-R0GTLf/pip/pip/req/", line 129, in prep_for_dist
  File "/tmp/pip-build-R0GTLf/pip/pip/req/", line 439, in run_egg_info
  File "/tmp/pip-build-R0GTLf/pip/pip/utils/", line 707, in call_subprocess
InstallationError: Command "python egg_info" failed with error code 1 in /tmp/pip-build-1gZhDi/beradio/

@Andreas do you have Ideas, why i get this error?

thanks a bunch. See you

Hi there,

thanks for reporting this! We just updated the setup documentation:

Please try:

pip install --extra-index-url= beradio

Hopefully, everything will be fine with that.



thanks for your help, but it didn’t fix the problem. Same output.

I see, it’s this error:

error: invalid command 'egg_info'

This will fix it:

pip install --upgrade setuptools

See also:

Thanks, this worked! Now, the installation shows further progress, but still croaks when cleaning up:

Cleaning up...
  Removing source in /tmp/pip-build-RAOI9B/beradio
  Removing source in /tmp/pip-build-RAOI9B/json-store
Traceback (most recent call last):
  File "/tmp/pip-build-R0GTLf/pip/pip/", line 215, in main
  File "/tmp/pip-build-R0GTLf/pip/pip/commands/", line 342, in run
  File "/tmp/pip-build-R0GTLf/pip/pip/req/", line 784, in install
  File "/tmp/pip-build-R0GTLf/pip/pip/req/", line 851, in install
  File "/tmp/pip-build-R0GTLf/pip/pip/req/", line 1064, in move_wheel_files
  File "/tmp/pip-build-R0GTLf/pip/pip/", line 247, in move_wheel_files
  File "/tmp/pip-build-R0GTLf/pip/pip/", line 140, in distutils_scheme
  File "/usr/lib/python2.7/site-packages/setuptools/", line 321, in __init__
    _Distribution.__init__(self, attrs)
  File "/usr/lib/python2.7/distutils/", line 287, in __init__
  File "/usr/lib/python2.7/site-packages/setuptools/", line 387, in finalize_options
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 2324, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 862, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 2568, in requires
    dm = self._dep_map
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 2815, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 2824, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 2806, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 1468, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "/usr/lib/python2.7/site-packages/pkg_resources/", line 1577, in _get
    with open(path, 'rb') as stream:
IOError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/appdirs-1.4.3.dist-info/METADATA'

Thanks! We tried to address the problem of “appdirs==1.4.3” being already installed on the LEDE system per:

It looks like it is working now:

root@LEDE:~# beradio --version
beradio 0.8.1

root@LEDE:~# beradio info
                  beradio 0.8.1
config file: /root/.local/share/beradio/config.json
network_id:  755af7af-66aa-44f8-9b78-5dc6c2dd5670
gateway_id:  siss4

Yes, that looks good. Thanks @Andreas for hands on support.

by the way: Wenn ich

pip install -v --index-url= beradio

probiere, dann beschwert er sich, daß er das cert nicht prüfen kann:

connection error: [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Der unsichere Weg ist, die url per http anzusprechen, dann warnt pip: uses an insecure transport scheme (http). Consider using https if has it available

Mit openssl s_client -connect -showcerts kann man das cert beurteilen, und mit

openssl s_client -connect -showcerts </dev/null 2>/dev/null|openssl x509 -outform PEM >packages-he.pem

lokal ablegen. Mittels folgendem

pip install -v --cert packages-he.pem --index-url= beradio

kommt er aber bei mir auch nur bis

connection error: hostname '' doesn't match u''

Hmmm… ẁget und lokales install haben es dann gelöst ;)

3 posts were merged into an existing topic: Probleme mit SNI und Python 2.7.6

Ältere Python Versionen < 2.7.9 haben die SNI Erweiterung für SSL leider noch nicht an Bord. Um dies nachzuholen, tippt man:

pip install requests pyOpenSSL idna

Klappt es damit vielleicht auch bei Dir?

Update: für requests 2.2.1 (py2.7.6) wurde noch gebraucht:

pip install ndg-httpsclient pyasn1

P.S.: Bei der globalen Installation von Python Modulen ist Vorsicht geboten: Der pip Installer überschreibt ggf. Python Module, die bereits durch das Betriebssystem installiert wurden. Das Paketframework der Linux Distribution bekommt davon jedoch nichts mit, was zu Problemen führen kann.
Auf Nummer sicher geht man, wenn man sich vom Betriebssystem per virtualenv isoliert, wie unter Probleme mit SNI und Python 2.7.6 beschrieben wird.

Ja, das ist halt immer toll mit venv, da kann man das alles machen…

Da hier appdirs v 1.4.3 ist, geht es ‘nativ’ nicht, wenn Du
appdirs==1.4.0 im Paket festnagelst. Wie wäre es mit einem ‘mindestens 1.4.0’ ?

Auch das haben wir bereits adressiert:

Hattest Du Dir das 0.8.0er Release per wget besorgt? Falls ja, dann versuche es doch mal mit der Version 0.8.1.

genau: der Ziepfad von wget war ein anderer, die schon geholte 0.8.1 war unausgepackt - der Versuch davor war tatsäch leider die 0.8.0…

Mit 0.8.1 installiert der tarball!


Nachdem Du Deine beradio/config.json angepasst hast (network_id: testdrive), um ohne Authentifizierung Nachrichten auf den Bus publizieren zu können …

$ beradio info
                  beradio 0.8.1
config file: /Users/amo/Library/Application Support/beradio/config.json
network_id:  testdrive
gateway_id:  area-42

… kannst Du das ganze im Trockendock testen:

beradio forward --source='data://d1:#i999e1:_2:h11:hli488ei572ee1:tli2163ei1925ei1092ei1354ee1:wi10677ee' --target='mqtt://'

Das Datenfeld, das als “#i999e” kodiert ist, beschreibt dabei die Node ID. Die kannst Du ggf. ebenfalls ad hoc ändern.

So kannst Du sehen, was auf dem Bus ankommt:

$ mosquitto_sub -h -t 'hiveeyes/testdrive/#' -v

hiveeyes/testdrive/tug22/999/wght1 106.77
hiveeyes/testdrive/tug22/999/hum1 4.88
hiveeyes/testdrive/tug22/999/hum2 5.72
hiveeyes/testdrive/tug22/999/temp1 21.63
hiveeyes/testdrive/tug22/999/temp2 19.25
hiveeyes/testdrive/tug22/999/temp3 10.92
hiveeyes/testdrive/tug22/999/temp4 13.54
hiveeyes/testdrive/tug22/999/message-json {"wght1": 106.77, "hum1": 4.88, "hum2": 5.72, "temp1": 21.63, "temp2": 19.25, "temp3": 10.92, "temp4": 13.54, "time": 1491179577482038016}
hiveeyes/testdrive/tug22/999/message-beradio d1:#i999e1:_2:h11:hli488ei572ee1:tli2163ei1925ei1092ei1354ee1:wi10677ee

… und im Dashboard:

Mit der Version 0.9.0 ist nun auch MQTT Authentifizierung möglich:

1 Like

Hi there,

we just released BERadio 0.12.3 on PyPI, so it can be easily installed using

pip install beradio --upgrade

Also, it finally features a working blueprint for running it as a system service on OpenWrt/LEDE, see beradio.init. You will find appropriate installation instructions inside this file.

For further instructions, please have a look at the updated section at LinkIt Smart 7688 Duo as RFM95 to Wifi-BERadio gateway.

@einsiedlerkrebs is currently using this release of BERadio after he rigged up his telemetry setup again the other day, enjoy berlin-wedding-42-pirate.


Preview: A reassembling decoder for BERadio messages

Hi there,

we just pushed some features for completing the BERadio gateway functionality as a counterpart of the BERadio C++ encoder library: Enjoy the BERadioMessageDecoder — BERadio 0.12.3 documentation, it includes some doctests to both proof and document its functionality at the same time.

By now, it’s only a working prototype, thus it is not integrated into the runtime machinery of BERadio yet. We would love to hear any thoughts, questions or criticisms. Thanks.

Cheers and have a good summer!