cosmicpi-rpi_V1.5/frontend
2018-03-22 00:07:52 +00:00
..
static initial commit 2017-10-12 14:12:03 +02:00
templates Addresses #11 2018-02-07 11:08:03 +01:00
__init__.py initial commit 2017-10-12 14:12:03 +02:00
app.py Add CORS 2018-03-21 21:42:19 +00:00
config.py Add histogram and data export REST API 2018-03-14 22:17:06 +01:00
data.py Add limit and since param 2018-03-22 00:07:52 +00:00
histogram.py Add histogram and data export REST API 2018-03-14 22:17:06 +01:00
params.py Add sensor data and WiFi support in REST API 2018-03-14 00:20:46 +01:00
README.md Add histogram and data export REST API 2018-03-14 22:17:06 +01:00
requirements.txt Add CORS 2018-03-21 21:42:19 +00:00
wifi.py Add histogram and data export REST API 2018-03-14 22:17:06 +01:00

CosmicPi REST API

Development

Make sure that CosmicPi UI service does not run (sudo systemctl stop CosmicPi-UI), navigate to /frontend and run:

FLASK_DEBUG=1 FLASK_APP=${PWD}/app.py python -m flask run --host=0.0.0.0

API

  • GET /histogram.png?start_time=0&end_time=1521059693&bin_size_seconds=1
  • GET /params
  • GET /wifi
  • PUT /wifi?ssid=CosmicPi&pass=12345678
  • GET /data?format=csv