Terkin for MicroPython

underway
normal
improvement
#1

As @clemens is already experimenting with LoRa using the …

… see also …

… we stepped in and provided convenient telemetry client wrapper libraries for MicroPython to receive data from LoRa and forward it to MQTT or HTTP.

Franken - ESP32 mit MicroPython - Daten via MQTT
Embedded Radio-to-IP Gateway (ESP)
#2

Demo example

Besides others, there’s a simple demo program which sends dummy telemetry data in CSV format to the HTTP endpoint of “swarm.hiveeyes.org”:

As you can see here, this already does the job on MicroPython for Unix:

Transmit data

$ micropython -c 'import sys; sys.path.insert(0, ".")' examples/node_http_csv_raw.py

Channel URI:  http://swarm.hiveeyes.org/api-notls/hiveeyes/testdrive/area-42/node-1
HTTP Path:    /api-notls/hiveeyes/testdrive/area-42/node-1/data
Payload:      ## temperature, humidity, weight

Channel URI:  http://swarm.hiveeyes.org/api-notls/hiveeyes/testdrive/area-42/node-1
HTTP Path:    /api-notls/hiveeyes/testdrive/area-42/node-1/data
Payload:      42.42, 84.84, 35

Receive data

After receiving the data on the HTTP interface, Kotori republishes it to the MQTT bus, so:

$ mosquitto_sub -h swarm.hiveeyes.org -p 1883 -t 'hiveeyes/testdrive/#' -v
hiveeyes/testdrive/area-42/node-1/data.json {"temperature": 42.42, "humidity": 84.84, "weight": 35.0}

LoRa-to-HTTP gateway example

There’s also a gateway/forwarder which receives data from the LoRa subsystem and sends it to HTTP as well. Everything is forwarded verbatim without any decoding involved, the payload just is being announced as “Content-Type: text/csv” when performing the HTTP POST request:

It is based on the contribution “lopy_lora_server.py” by @constantinos on the Pycom Forum (thanks!):


Note: Please be aware that this hasn’t been run on any real iron yet. We appreciate your help in doing this!

#3

Hi there,

we are happy to announce that we have been able to take this to the next level. Based on good experiences by @Ron, @tonke, @RalfL and others with MicroPython (thanks for sharing your efforts!), we are currently working on GitHub - hiveeyes/hiveeyes-micropython-firmware: Hiveeyes MicroPython Datalogger -- Data logging for humans.

After resolving some dependency hell aspects (e.g. How to use "libpcre" on the Pycom MicroPython runtime? | Pycom user forum) - which is just business as usual - we are now running the telemetry subsystem of the Hiveeyes MicroPython firmware on real hardware (the FiPy by Pycom) and it works pretty well already.

The foundation of the configuration system has been laid out recently (see settings.example.py), so we are tagging this with 0.1.0 now to signal official alpha quality.

@einsiedlerkrebs is already working on LoRaWAN/TTN telemetry while we are also taking considerations into account which have been discussed with @tonke recently. Thank you so much!

As all of this is in a very early state yet, we are looking forward to get more eyeballs to it. Please ask us anything, we will be happy to give any answers and appropriate onboarding assistance.

With kind regards,
Andreas.


References

Develop BOB on FiPy
#5

Status quo

Introduction

Together with @clemens, we have been able to confirm that code from the current development state of the Hiveeyes MicroPython Firmware works successfully with and without sensors attached and MQTT-over-WiFi telemetry enabled.

image

Pre-flight

Upgrade the Pycom device firmware to a recent version, see hiveeyes-micropython-firmware/pycom-firmware-upgrade.rst at master · hiveeyes/hiveeyes-micropython-firmware · GitHub.

Synopsis

# Find serial port.
make list-serials

# Configure serial port.
export MCU_SERIAL_PORT=/dev/ttyS16

# Pre-flight checks.
make list-boards

# Bootstrap dependencies once.
# Usage: After updating the list of dependencies, e.g. through "git pull".
make setup

# Upload firmware framework and sketch and trigger a cold start.
# Usage: Each time you modify code.
make recycle
1 Like
Erarbeitung eines kanonischen Datenschemas für imkerliche Meßdaten
Sending telemetry data to the Beep backend
#10

Plans for MicroTerkin 0.3.0

The Hiveeyes MicroPython Firmware release 0.3.0 is around the corner. Before cutting this release, we will try to improve some more aspects.

Pläne für MicroTerkin 0.4.0 ff.