As an extension to the LoraWan, the “MQTT 2 Converter Bridge” can also be set up to ensure an even simpler connection to external applications
Communication then takes place via MQTT clients, which can handle the entire communication via two interfaces alone.
This would be the [1] interface "up" through which all information coming from the LoraWan adapter is handled:
{
"deviceEUI":"294cf585f55fa497",
"received_UP":{
"humidity":82,
"temperature":11.52,
"batteryVoltage":3.676,
"pressure":1006.28,
"batteryLevel":0
}
}
Arriving here is the (unique) device address and the relevant user data.
The MQTT input “down” offers the option of sending commands to the devices. Example:
{
"deviceEUI":"A84041162183F8FB",
"function":"RO1_target",
"value":true
}
The structure of the control command is deviceEUI, (configured) control command, value.
The value must be sent in the correct format (bool, number, string). When you send a “down” command, there is an “up” response. Example response if successful:
{
"deviceEUI":"A84041162183F8FB",
"respone_Down":{
"applicationId":"hafi-ttn-lorawan",
"deviceEUI":"A84041162183F8FB",
"deviceId":"eui-a84041162183f8fb",
"deviceType":"LT22222",
"downlink":"RO1_target",
"value":true,
"received":{
"deviceEUI":"A84041162183F8FB",
"downlink":"RO1_target",
"value":true
}
}
Example response in case of failure:
{
"deviceEUI":"A84041162183F8FB",
"respone_Down_ERROR":"downlink is type boolean, but received string",
"received":{
"deviceEUI":"A84041162183F8FB",
"downlink":"RO1_target",
"value":"false"
}
}