Kontron TRACe-LP1 Gateway User Guide – SD.DT.G74.7e
www.kontron.com
// 25
elif payload[0:2]== "03":
message= Button Pushed;Low Battery; "
else:
return " "
val=int(payload[2:6],16)
message=str(val)
return message
else:
return " "
A string must be returned to the lora-agent. This string must contain the topic with the corresponding message to
send over MQTT.
The character «|» is the separator between the topic and the message.
It is possible to return to the lora-agent more than one topic/message pair, and consequently send 2, 3 ... MQTT
messages for 1 LoRaWAN™ frame received.
Example:
"Event|Button Pushed|NbTimesPushed|1070"
2 MQTT messages sent:
1.
Topic:
"/Kontron/TRACe/123456789/LoRa/PB868LRH/e7e34643330602/Event "
Message:
"Button Pushed"
2.
Topic:
"/Kontron/TRACe/123456789/LoRa/PB868LRH/e7e34643330602/NbTimesPushed "
Message: "1070"
Topics can be on multiple levels:
"Event/Type|Button Pushed"
1.
Topic:
"/Kontron/TRACe/123456789/LoRa/PB868LRH/e7e34643330602/Event/Type
"
Message:
"Button Pushed"
If there is something wrong (the process for this device type is not implemented, the payload
is not right, the process for the corresponding port is not implemented...), a blank space string
shall be returned like in the example. Indeed, if the lora-agent receives a string with a blank
space or an empty string, it will publish nothing over MQTT. If more python packages are
needed for the processing, it is possible to import them at the beginning of the python file. It is
also possible to install new packages using the pip tool (pip install package_name).
Содержание Kontron TRACe-LP1
Страница 1: ...USER GUIDE www kontron com Kontron TRACe LP1 Gateway SD DT G74 7e February 2019 ...
Страница 6: ...Kontron TRACe LP1 Gateway User Guide SD DT G74 7e www kontron com 6 ...
Страница 21: ...Kontron TRACe LP1 Gateway User Guide SD DT G74 7e www kontron com 21 ...
Страница 29: ...Kontron TRACe LP1 Gateway User Guide SD DT G74 7e www kontron com 29 ...