This is kind of proof of concept project for IoT system without any security features.
- Install requirements
$ pip3 install -r requirements.txt
- Add database URI to environment (SQLAlchemy format)
$ export DATABASE_URI=postgresql+pypostgresql://localhost/cloudino
- Create database tables
$ python3 server.py -create
- Add dummy data (Optional)
$ python3 server.py -dummy
- Start server (server starts servering on port 8888)
$ python3 server.py
- Start connection to the server
$ wsdump.py ws://localhost:8888/api
- Write valid message:
{"AUTH": "secret", "name": "Cabin control 1", "measurements":[{"packet_id": 1, "type": "event", "time": "2015-01-01 11:11:12", "value": 1, "name": "Door sensor"},{"packet_id": 2, "type": "measurement", "time": "2015-01-01 11:11:14", "value": 12, "name": "Inside temp"},{"packet_id": 3, "type": "input", "time": "2015-01-01 11:11:15", "value": 0, "name": "Heating"}]}
Some of the arduino code is from https://github.com/brandenhall/Arduino-Websocket with unknown license. All python code is licenced under MIT license.