LoRa

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LoRa

Post 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!
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: LoRa

Post by Derik »

Can you please tell me how to install/activate a TTN lora bridge
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
kiddigital
Posts: 438
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: LoRa

Post 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.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LoRa

Post 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?
User avatar
kiddigital
Posts: 438
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: LoRa

Post 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.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: LoRa

Post 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...
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest