iot_data | ||
LICENSE | ||
README.md | ||
requirements.txt | ||
setup.py |
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/
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"
},
}
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