You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
clerie f60e3a3f89 Let data get expired. 1 month ago
iot_data Let data get expired. 1 month ago
LICENSE Initial commit 1 month ago
README.md Let data get expired. 1 month ago
requirements.txt Initial commit 1 month ago
setup.py Initial commit 1 month ago

README.md

IOT Data

Just a tiny service for posting small datasets to a server which can get fetched by other services afterwards.

It just keeps the data in RAM so it is definetely not for big stuff and log term storages.

Usage

Read data:

curl http://iot-data.clerie.de/data/sensor1/

Write data:

curl -X POST -d 'hello world!'' -H 'Content-Type: text/plain' http://iot-data.clerie.de/ingress/asdf1234/

Content type is considered too:

curl -X POST -d '{"key": "value"}' -H 'Content-Type: application/json' http://iot-data.clerie.de/ingress/asdf1234/

Check for the last data input with the Last-Modified header.

Deployment

Init codebase

git clone https://github.com/clerie/iot-data.git
cd iot-data/
virtualenv -p python3 ENV
cd ..

Create config.json with the following contents and edit values for your needs:

{
  "sensor1": {
    "key": "asdf1234"
  },
  "sensor2": {
    "key": "supersecret",
    "delete-after": 60
  },
}

delete-after: Specifies the seconds after which the data gets discarded and no data is returned.

Starten und updaten lässt sich die Flask-App folgendermaßen:

cd iot-data/
git pull
source ENV/bin/activate
pip install -r requirements.txt
IOT_DATA_CONFIG=/path/to/config.json gunicorn iot_data:app
deactivate