Last active
October 19, 2018 07:13
-
-
Save rafcio2k/c6f8b10298a53b51c9e8ddf847ea1a61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script prepare AwaLWM2M tools and start AWALWM2M client, which connects to CreatorDev Device Server. | |
# Client is already configured for Prj5_HeatingController project. | |
# PREREQUISITES: | |
# Go to https://docs.creatordev.io/ci40/guides/creating-applications/#method-2-creatordev-vm and install virtualbox, virtualbox extension pack and vagrant. Then: | |
# $ mkdir creatordev-sdk | |
# $ cd creatordev-sdk | |
# $ vagrant init CreatorDev/creatordev-vm | |
# $ vagrant up | |
# Download Device Server Certificate from https://console.creatordev.io/#/identities and put it in ./creatordev-sdk/myworkspace/deviceserver_cert | |
# $ vagrant ssh | |
./daemon/src/client/awa_clientd -b coaps://deviceserver.creatordev.io:15684 -e ClimateMasterController -i 12345 -c ~/myworkspace/deviceserver_cert1 -l ~/myworkspace/awa_clientd_climateMasterController.log -d | |
./daemon/src/client/awa_clientd -b coaps://deviceserver.creatordev.io:15684 -e ClimateTemperature -i 12346 -c ~/myworkspace/deviceserver_cert2 -l ~/myworkspace/awa_clientd_climateTemperature.log -d | |
./daemon/src/client/awa_clientd -b coaps://deviceserver.creatordev.io:15684 -e ClimatePresence -i 12347 -c ~/myworkspace/deviceserver_cert3 -l ~/myworkspace/awa_clientd_climatePresence.log -d | |
./daemon/src/client/awa_clientd -b coaps://deviceserver.creatordev.io:15684 -e ClimateHeater -i 12348 -c ~/myworkspace/deviceserver_cert4 -l ~/myworkspace/awa_clientd_climateHeater.log -d | |
ps -ef | grep awa | grep -v grep | |
sleep 5 | |
./tools/awa-client-define -p 12345 -o 20010 -j CustomConfig -m -y multiple -r 3500 -n TimeSchedule -t string -u single -q mandatory -k rw \ | |
-r 3501 -n SensorID -t string -u single -q mandatory -k rw | |
./tools/awa-client-define -p 12346 -o 3303 -j Temperature -m -y single -r 5700 -n SensorValue -t float -u single -q mandatory -k r | |
./tools/awa-client-define -p 12346 -o 3308 -j TemperatureDelta -m -y single -r 5900 -n SetPointValue -t float -u single -q mandatory -k rw | |
./tools/awa-client-define -p 12347 -o 3302 -j Motion -m -y single -r 5500 -n DigitalInputState -t boolean -u single -q mandatory -k r | |
./tools/awa-client-define -p 12348 -o 3201 -j HeaterState -m -y single -r 5550 -n DigitalOutputState -t boolean -u single -q mandatory -k rw | |
# temperature | |
./tools/awa-client-set -p 12346 -c /3303/0 | |
./tools/awa-client-set -p 12346 /3303/0/5700=23.4 | |
./tools/awa-client-get -p 12346 /3303/0/5700 | |
#presence | |
./tools/awa-client-set -p 12347 -c /3302/0 | |
./tools/awa-client-set -p 12347 /3302/0/5500=true | |
./tools/awa-client-get -p 12347 /3302/0/5500 | |
#heater state | |
./tools/awa-client-set -p 12348 -c /3201/0 | |
./tools/awa-client-set -p 12348 /3201/0/5550=true | |
./tools/awa-client-get -p 12348 /3201/0/5550 | |
#custom config (names, schedule) | |
./tools/awa-client-set -c /20010/0 | |
./tools/awa-client-set -c /20010/1 | |
./tools/awa-client-set -c /20010/2 | |
./tools/awa-client-set /20010/0/3501="ClimateTemperature" | |
./tools/awa-client-set /20010/1/3501="ClimatePresence" | |
./tools/awa-client-set /20010/2/3501="ClimateHeater" | |
./tools/awa-client-set /20010/0/3500="{}" | |
./tools/awa-client-get /20010/0/3501 | |
./tools/awa-client-get /20010/1/3501 | |
./tools/awa-client-get /20010/2/3501 | |
./tools/awa-client-get /20010/0/3500 | |
#custom config (delta) | |
./tools/awa-client-set -p 12346 -c /3308/0 | |
./tools/awa-client-set -p 12346 /3308/0/5900=0.25 | |
./tools/awa-client-get -p 12346 /3308/0/5900 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment