This commit is contained in:
parent
42b307ff7b
commit
8dbef7c647
@ -1,9 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$ENCRYPTION_KEY" = "" ]; then
|
ENCRYPTION_KEY=`openssl rand -hex 32`
|
||||||
echo "ENCRYPTION_KEY not set"
|
echo $ENCRYPTION_KEY
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
SECRETS_PLAINTEXT_FILE=secrets.txt
|
SECRETS_PLAINTEXT_FILE=secrets.txt
|
||||||
SECRETS_CIPHERTEXT_FILE=secrets.enc
|
SECRETS_CIPHERTEXT_FILE=secrets.enc
|
||||||
|
22
deployment/instances/udi-saerbeck/default/config.json
Normal file
22
deployment/instances/udi-saerbeck/default/config.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"mqtt": {
|
||||||
|
"broker": "ssl://eu1.cloud.thethings.network:8883",
|
||||||
|
"username": "de-hottis-saerbeck-monitoring@ttn",
|
||||||
|
"password": "ENV",
|
||||||
|
"tlsEnable": "true"
|
||||||
|
},
|
||||||
|
"topicMappings": [
|
||||||
|
{
|
||||||
|
"topics": [ "v3/#" ],
|
||||||
|
"handler": "TTN",
|
||||||
|
"id": "TTN0",
|
||||||
|
"config": {
|
||||||
|
"attributes": {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"archiver": {
|
||||||
|
"dir": "/archive"
|
||||||
|
}
|
||||||
|
}
|
@ -1,32 +1,38 @@
|
|||||||
U2FsdGVkX1+DXC4uFXaRWr40xvTwUDMfmx3gZmixNJWP4djN5e5JZYmq2uWB/kQr
|
U2FsdGVkX1+v6L4gc+CbYCZyo/UVN7QfmEntIBpk+GAHGf3d7m/4hfcYd39Eh2td
|
||||||
0eCD4UM9cRnwyqCJudsOJnB8pT6XQgl/ZkSZavSOxG7r0uh90IqOe25nxWH3iiza
|
lXSmNdt1cdFw/UfZ1x1OlGm/fqLh/j/rWP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|
||||||
|
evO7IXe0RuvodQ3tB4LmeWoJB10G7Sko2EEfpFTDXke9Ak/5cGrpdPMtbXCAIm1o
|
||||||
|
B5UhrqNuUYSWdo0mGttbSjFR7pyLujsxLNnp8teBi33QOUhrSId5+mOvtFDGiZKa
|
||||||
|
QCC+W+BIh6IFIwnxH4dDxjz3M65NXzqNV+6mXEFU77cX+oTF4BRe0R/L4nPoaBAN
|
||||||
|
smRxtqBItpVFUdsOVb6bXg==
|
||||||
|
75
src/udi/handlers/ttn/models/draginoLsn50/draginoLsn50.go
Normal file
75
src/udi/handlers/ttn/models/draginoLsn50/draginoLsn50.go
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
package draginoLsn50
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
"encoding/json"
|
||||||
|
"udi/database"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
"decoded_payload": {
|
||||||
|
"ALARM_status": "FALSE",
|
||||||
|
"BatV": 3.659,
|
||||||
|
"Temp_Black": 3276.7,
|
||||||
|
"Temp_Red": 22.6,
|
||||||
|
"Temp_White": 3276.7,
|
||||||
|
"Work_mode": "DS18B20"
|
||||||
|
},
|
||||||
|
*/
|
||||||
|
type message struct {
|
||||||
|
ALARM_status string `json:"ALARM_status"`
|
||||||
|
Bat float32 `json:"BatV"`
|
||||||
|
Work_mode string `json:"Work_mode"`
|
||||||
|
Temp_Black string `json:"Temp_Black"`
|
||||||
|
Temp_Red string `json:"Temp_Red"`
|
||||||
|
Temp_White string `json:"Temp_White"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func Parse(fPort int, decodedPayload []byte, _ string, variables *map[string]database.VariableType, attributes *map[string]interface{}, device *database.Device) error {
|
||||||
|
if fPort != 2 {
|
||||||
|
return fmt.Errorf("Unexpected fPort %d", fPort)
|
||||||
|
}
|
||||||
|
var message message
|
||||||
|
err := json.Unmarshal(decodedPayload, &message)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Unable to parse payload, fPort %d, error %s", fPort, err)
|
||||||
|
}
|
||||||
|
(*variables)["Battery"] = database.VariableType {
|
||||||
|
Label: "Battery",
|
||||||
|
Variable: "Voltage",
|
||||||
|
Unit: "V",
|
||||||
|
Value: message.Bat,
|
||||||
|
}
|
||||||
|
(*variables)["Alarm"] = database.VariableType {
|
||||||
|
Label: "Alarm",
|
||||||
|
Variable: "Alarm",
|
||||||
|
Unit: "",
|
||||||
|
Value: message.ALARM_status,
|
||||||
|
}
|
||||||
|
(*variables)["Temp_Red"] = database.VariableType {
|
||||||
|
Label: "Temp_Red",
|
||||||
|
Variable: "Temperature",
|
||||||
|
Unit: "°C",
|
||||||
|
Value: message.Temp_Red,
|
||||||
|
}
|
||||||
|
(*variables)["Temp_Black"] = database.VariableType {
|
||||||
|
Label: "Temp_Black",
|
||||||
|
Variable: "Temperature",
|
||||||
|
Unit: "°C",
|
||||||
|
Value: message.Temp_Black,
|
||||||
|
}
|
||||||
|
(*variables)["Temp_White"] = database.VariableType {
|
||||||
|
Label: "Temp_White",
|
||||||
|
Variable: "Temperature",
|
||||||
|
Unit: "°C",
|
||||||
|
Value: message.Temp_White,
|
||||||
|
}
|
||||||
|
|
||||||
|
(*attributes)["Status"] = "Ok"
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -11,6 +11,7 @@ import (
|
|||||||
"udi/handlers/ttn/models/draginoLdds75"
|
"udi/handlers/ttn/models/draginoLdds75"
|
||||||
"udi/handlers/ttn/models/draginoLmds200"
|
"udi/handlers/ttn/models/draginoLmds200"
|
||||||
"udi/handlers/ttn/models/draginoLse01"
|
"udi/handlers/ttn/models/draginoLse01"
|
||||||
|
"udi/handlers/ttn/models/draginoLsn50"
|
||||||
"udi/handlers/ttn/models/rawPayloadPrinter"
|
"udi/handlers/ttn/models/rawPayloadPrinter"
|
||||||
"udi/handlers/ttn/models/hottisScd30"
|
"udi/handlers/ttn/models/hottisScd30"
|
||||||
"udi/database"
|
"udi/database"
|
||||||
@ -145,6 +146,8 @@ func (self *TTNHandler) Handle(message handler.MessageT) {
|
|||||||
parser = draginoLmds200.Parse
|
parser = draginoLmds200.Parse
|
||||||
case "dragino-lse01":
|
case "dragino-lse01":
|
||||||
parser = draginoLse01.Parse
|
parser = draginoLse01.Parse
|
||||||
|
case "dragino-lsn50":
|
||||||
|
parser = draginoLsn50.Parse
|
||||||
case "raw-payload-printer":
|
case "raw-payload-printer":
|
||||||
parser = rawPayloadPrinter.Parse
|
parser = rawPayloadPrinter.Parse
|
||||||
case "hottis-scd30":
|
case "hottis-scd30":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user