- Install Docker, ngrok.
- Run
ngrok http 5487
to create tunnel for notifications to localhost. 5487 is port of webapp already configured in Docker. cp ./config.sample.js ./src/config.js
. Configure your credentials and host for notifications. TakeaccessKey
andaccessSecret
from CreatorDev Console (API Keys).host
is displayed after startingngrok
in previous step.- Start webapp:
docker-compose build && docker-compose up
. - Configure Grafana:
- For testing purposes you could start local AwaLWM2M client, which will connect to Device Server. See instructions in prj5HeatingControl_awa_client.sh.
/temperature/name
,/presence/name
,/heater/name
- PUT Content-Type: application/json
- GET Accept: application/json
- HTTP Body:
{"name": "NEW_NAME"}
/temperature/delta
- PUT Content-Type: application/json
- GET Accept: application/json
- HTTP Body:
{"delta": "DELTA_FLOAT_VALUE"}
/schedule
- PUT Content-Type: application/json
- GET Accept: application/json
- HTTP Body:
{"schedule": "SCHEDULE"}
You could test configuration endpoints with following curl commands:
curl -i -X PUT -H "Content-Type: application/json" -d '{"name":"NewTemperatureName"}' http://127.0.0.1:5487/temperature/name
curl -i http://127.0.0.1:5487/temperature/name
curl -i -X PUT -H "Content-Type: application/json" -d '{"name":"NewPresenceName"}' http://127.0.0.1:5487/presence/name
curl -i http://127.0.0.1:5487/presence/name
curl -i -X PUT -H "Content-Type: application/json" -d '{"name":"NewHeaterName"}' http://127.0.0.1:5487/heater/name
curl -i http://127.0.0.1:5487/heater/name
curl -i -X PUT -H "Content-Type: application/json" -d '{"delta":"23.86"}' http://127.0.0.1:5487/temperature/delta
curl -i http://127.0.0.1:5487/temperature/delta
curl -i -X PUT -H "Content-Type: application/json" -d '{"schedule":"some schedule"}' http://127.0.0.1:5487/schedule
curl -i http://127.0.0.1:5487/schedule