Page 2 of 2
Re: LoRa
Posted: Wednesday 08 December 2021 16:44
by Quax1507
I am playing around with Lorawan and TTN.
For that, I have ordered a Browan TBDW100 Door/Windows Sensor.
I have managed to include it to TTN and also have set up "The Things Network (MQTT/LPP)" in Domoticz.
When I trigger an event from the sensor, I receive " Error: TTN: Invalid data received! Unable to decode the raw payload and the decoded payload does not contain any (valid) data!"
I assume, I have to use a payload formatter in TTN or something else?
This is the payload in TTN
Code: Select all
"uplink_message": {
"session_key_id": "xxxxxxxxxxxxxxxxxxxxxx",
"f_port": 100,
"f_cnt": 8,
"frm_payload": "AQs5AQAMAAA=",
"decoded_payload": {
"battery": 3.6,
"count": 12,
"status": 1,
"temperatureBoard": 25,
"time": 1
},
Any help would be greatly appreciated!
Re: LoRa
Posted: Wednesday 08 December 2021 17:55
by Derik
Can you please tell me how to install/activate a TTN lora bridge
Re: LoRa
Posted: Wednesday 08 December 2021 18:48
by kiddigital
Quax1507 wrote:I am playing around with Lorawan and TTN.
For that, I have ordered a Browan TBDW100 Door/Windows Sensor.
I have managed to include it to TTN and also have set up "The Things Network (MQTT/LPP)" in Domoticz.
When I trigger an event from the sensor, I receive " Error: TTN: Invalid data received! Unable to decode the raw payload and the decoded payload does not contain any (valid) data!"
I assume, I have to use a payload formatter in TTN or something else?
This is the payload in TTN
Code: Select all
"uplink_message": {
"session_key_id": "xxxxxxxxxxxxxxxxxxxxxx",
"f_port": 100,
"f_cnt": 8,
"frm_payload": "AQs5AQAMAAA=",
"decoded_payload": {
"battery": 3.6,
"count": 12,
"status": 1,
"temperatureBoard": 25,
"time": 1
},
Any help would be greatly appreciated!
Look at the ttnmqtt_aliases file (see GitHub beta branch source tree), as the payload does not seem a valid LPP payload, but already a formatter is creating a decoded payload, using the aliases file you can map a decoded key/value onto a recognized input.
You can update the aliases file and after disabling and enabling the module, the file is read again.
This should work (in theory). Let us know how it goes.
Re: LoRa
Posted: Wednesday 08 December 2021 19:13
by Quax1507
I have downloaded the ttnmqtt_aliases file from which contains
Code: Select all
{
"temp": [
"temperature",
"ambient_temperature"
],
"humidity": [
"hum"
],
"baro": [
"barometer"
],
"batterylevel": [
"battery_level"
],
"gps": [],
"luminosity": [],
"presense": [],
"analog_input": [],
"analog_output": [],
"digital_output": [],
"digital_input": [],
"accel": [],
"gyro": [],
"unixtime": []
}
Now, the error is:
Error: TTN: Invalid data received! The payload_raw does not contain a payload that could be decoded (Port 100)!
Any Ideas?
How can I debug?
Re: LoRa
Posted: Thursday 09 December 2021 7:55
by kiddigital
@Quax1507 , the error message says that the received payload is not an LPP payload
but it also means that no 'decoded_payload' has been received.
In your previous post you showed info that a 'decoded_payload' was part of the message, but now it seems that it isn't anymore?
And the goal of the aliases file is that you add the 'keys' of the decoded payload to one of the know inputs, so the module nows how to map. Based on the decoded_payload you provided before, you should add for example the following:
Code: Select all
"temp": [
"temperature",
"ambient_temperature",
"temperatureBoard"
],
and/or
Code: Select all
"analog_input": [
"count"
],
"digital_input": [
"status"
],
The above tells the module how the decoded_payload fields 'temperatureBoard', 'count' and 'status' should be treated.
Re: LoRa
Posted: Thursday 09 December 2021 21:13
by Quax1507
@kiddigital
One step closer...
I have added
Code: Select all
"analog_input": [
"count"
],
"digital_input": [
"status"
],
"temp": [
"temperature",
"ambient_temperature",
"temperatureBoard"
],
It now reads the temperature, but not the state:
Status: TTN: Converted decoded_payload to regular payload for processing!
TTN: Temp (eui-xxxxxxxxxxxxx)
Device type "Temp" is created in Domoticz!
But I need the switch
Edit: Fixed it! I had the section "digital_input" twice in the "ttnmqtt_aliasses.json"

Stupid...