Getting data from LoRa - TTN network

Moderator: leecollings

Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Getting data from LoRa - TTN network

Post by Toulon7559 »

Jeroen,

Where is the tutorial mentioned under 1:?

MVG, Anton
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: Getting data from LoRa - TTN network

Post by jeroenkl »

Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Getting data from LoRa - TTN network

Post by Toulon7559 »

:cry: First need to find again an active TTN-Gateway:
the one within reach apparently has stopped ..........

Forces me, either to find an (interim?) solution with the KPN-Network, or to build/setup my own TTN-Gateway.
;-) The latter solution obviously would not be bad, as contribution to the Community.
Last edited by Toulon7559 on Thursday 30 March 2023 14:35, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: Getting data from LoRa - TTN network

Post by jeroenkl »

Toulon7559 wrote: Monday 28 January 2019 19:34 :cry: First need to find again an active TTN-Gateway:
the one within reach apparently has stopped ..........

Forces me, either to find an (interim?) solution with the KPN-Network, or to build my own TTN-Gateway.
;-) The latter solution obviously would not be bad, as contribution to the Community.
advise to get a RAK831, great gateway with an external antenna I've got a range of 20km.
Great stuff from TTGO and connections to domoticz.
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: Getting data from LoRa - TTN network

Post by jeroenkl »

gizmocuz wrote: Tuesday 01 January 2019 13:21 You need to use the same privilege settings as you would when using MQTT to connect to the TTN network.
Did you try using a MQTT client ?
Hi Gizmocuz,

Is it possible to implement GPS?

2019-02-10 19:36:50.529 TTN_MQTT: Topic: ttgo-beam/devices/ttgo_beam_ttnmapper/up
2019-02-10 19:36:50.534 (MQTT client gateway TTN) General/Percentage (ttgo_beam_ttnmapper Altitude)
2019-02-10 19:36:50.538 (MQTT client gateway TTN) Temp (ttgo_beam_ttnmapper)
2019-02-10 19:36:50.541 (MQTT client gateway TTN) General/Voltage (ttgo_beam_ttnmapper)
2019-02-10 19:36:50.531 Status: TTN_MQTT: GPS not implemented yet!

BR,

Jeroen
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Getting data from LoRa - TTN network

Post by Toulon7559 »

At this moment quite a lot of people try to find a functional connection for uplink from TTN to Domoticz:
example thread from another forum.

;-) Just try to understand how they do it, and then 'translate' for own application .........
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Getting data from LoRa - TTN network

Post by Toulon7559 »

Not yet getting data visible at TTN's Console.

;-) Then trying alternative approaches to get LoRa-message from an End-Device to an Endpoint-URL
Is somebody at this Forum familiar with Beeceptor?

With my Marvin>KPN DeveloperPortal>MendixDashboard I created a forward rule which uplinks messages to Beeceptor, but then obviously the question:
what next to get the message in the direction of MQTT-link to Domoticz? With the data in an appropriate format for 'easy transfer'?

In the perspective of KPN'S DeveloperPortal the following aspects seem of some importance:
Requirements of your Application Server
LoRa data is forwarded to an application server of your choice. The application server can be any public URL on the internet and can be your own server or somewhere in the cloud. In order for the application server to work properly below items are required:

Application Servers must have a valid SSL certificate
Receive, send and decode HTTPS POST messages from public internet
Check and generate SHA-256 hex signatures
In this 'picture' the MendixDashboard is such Application Server, and also Beeceptor could play that role.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
HeTi
Posts: 5
Joined: Saturday 11 January 2014 22:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Getting data from LoRa - TTN network

Post by HeTi »

I tried to get TTN LoRa hardware to work. Everything works except that Domoticz shows only one measurement of tree.
(Every six (Temp/Hum pairs) measurements shows ok in cayenne dashboard)

TTN console Application Data Fields:
{
"relative_humidity_3": 32,
"relative_humidity_4": 31,
"relative_humidity_5": 25.5,
"temperature_0": 22.1,
"temperature_1": 21.1,
"temperature_2": 20.6
}

Domoticz Console:
2019-04-19 08:58:25.666 TTN_MQTT: Topic: lopy4modulit/devices/lopyblu/up
2019-04-19 08:58:25.674 (TheThings) Temp (lopyblu)
2019-04-19 08:58:25.680 (TheThings) Humidity (lopyblu)
2019-04-19 08:58:25.690 (TheThings) Temp (lopyblu)
2019-04-19 08:58:25.695 (TheThings) Humidity (lopyblu)
2019-04-19 08:58:25.705 (TheThings) Temp (lopyblu)
2019-04-19 08:58:25.711 (TheThings) Humidity (lopyblu)

Devices list shows tree lines:
TheThings.png
TheThings.png (27.96 KiB) Viewed 4636 times
Seems that Domoticz shows only last received measurement.
wvries
Posts: 31
Joined: Sunday 05 March 2017 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Lo Santiago, Murcia, Spain
Contact:

Re: Getting data from LoRa - TTN network

Post by wvries »

Another possibility is to use one of the standard integrations in TTN, "HTTP Integration" (https://www.thethingsnetwork.org/docs/a ... ions/http/).

This will send the whole payload of the Lora Device as a json message to a website you define.
I use a simple PHP server where I created a php page, that captures the json message and using some json decoding getting access to the entire payload with all information in it.

When you have found the actual variable you need, just use the DZ json option to send this to DZ. (http://IP:PORT/json.htm?type=command&param=updateuservariable&.....)

Advantage of this is, you have full control over all information send from the TTN Lora device and the php file gets triggered automatically when the device sends something.
Then it is up to you if you want to send it to DZ or first check if the device was changed and then send it.
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Getting data from LoRa - TTN network

Post by Derik »

What can i do with lora network ??
Only weather sensors?
Or also a motion?

or?



Some have a hardware setup?
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
HeTi
Posts: 5
Joined: Saturday 11 January 2014 22:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Getting data from LoRa - TTN network

Post by HeTi »

Now using mosquitto_sub it's easy get one measurement out in ttn-mqtt server:

Code: Select all

]mosquitto_sub -h eu.thethings.network -t '+/devices/+/up/temperature_1' -u 'eka' -P 'ttn-account-v2.isz' -C 1
Just look your access-key in your application page in ttn-console.
Simply use inside script to but http --> Domoticz.

Still waiting Domoticz own hardware implementation reconize different measurements in CayenneLPP messages.
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: Getting data from LoRa - TTN network

Post by jeroenkl »

HeTi wrote: Sunday 05 May 2019 17:54 Now using mosquitto_sub it's easy get one measurement out in ttn-mqtt server:

Code: Select all

]mosquitto_sub -h eu.thethings.network -t '+/devices/+/up/temperature_1' -u 'eka' -P 'ttn-account-v2.isz' -C 1
Just look your access-key in your application page in ttn-console.
Simply use inside script to but http --> Domoticz.

Still waiting Domoticz own hardware implementation reconize different measurements in CayenneLPP messages.
Can you provide a demo of the script we can use with mosquitto included?
Need some help ;-)
User avatar
kiddigital
Posts: 438
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Getting data from LoRa - TTN network

Post by kiddigital »

From Domoticz 2020.2 the TTNMQTT module is greatly improved and it is now easy to get your Lora TTN data into Domoticz.

See this Wiki page for more details.
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
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Getting data from LoRa - TTN network

Post by Derik »

Hi

Old topic...
Only i will give lora a try..
Some advice for a good working gateway?
Diy or buy?
What type?
Where do i llok foor the special differents?
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: Getting data from LoRa - TTN network

Post by kiddigital »

Buy a good outdoor gateway and you can cover a large area.

Sensors can be anything and DIY.

Good luck and have fun building…
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
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Getting data from LoRa - TTN network

Post by Toulon7559 »

Rainy day (and more rain promised) is good argument to revisit Lora.

Check before trying experiments:
has the Domoticz-implementation for TNNMQTT been upgraded for TNN_V3?
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
kiddigital
Posts: 438
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Getting data from LoRa - TTN network

Post by kiddigital »

Toulon7559 wrote: Monday 17 May 2021 11:45 Rainy day (and more rain promised) is good argument to revisit Lora.

Check before trying experiments:
has the Domoticz-implementation for TNNMQTT been upgraded for TNN_V3?
Good point... I will have a look how easy/hard it is to switch from v2 (supported till end 2021) to v3... looks doable :)
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
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Getting data from LoRa - TTN network

Post by Derik »

V3 is the new so a must for the new gateway...
Only what hardware do you have?
Is there a good DIY option?
Or better to buy a good brand?
Why multichannel?
Why webui? or do all the gateways needed a webui?

Hope you will help a noob in lora


Edit...
Are all the ttn devices supported bij Domoticz
So a ttn motion is a motion in domoticz, etc etc?
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: Getting data from LoRa - TTN network

Post by kiddigital »

Derik wrote: Monday 17 May 2021 19:20 V3 is the new so a must for the new gateway...
Only what hardware do you have?
Is there a good DIY option?
Or better to buy a good brand?
Why multichannel?
Why webui? or do all the gateways needed a webui?

Hope you will help a noob in lora


Edit...
Are all the ttn devices supported bij Domoticz
So a ttn motion is a motion in domoticz, etc etc?
Best/easiest is to buy a ready to use LoRa gateway, one that supports TTN (which most do), and Sensor wise you probably look at something either out-of-the-box or DIY (or combined).

Domoticz supports retrieving data from TTN and therefor does not have/need direct hardware support for LoRa. The TTN takes care of all the hardware/messaging/etc. and makes the data available through standarized MQTT messages. The TTNMQTT module 'connects' your Domoticz instance to these MQTT message and retrieves them for you. Depending of the details available in the data the module will try to determine what type of Sensor the data is coming from (temp, rain, etc.) and otherwise put the data into a 'generic' sensor.

Hopefully that clarifies things. (btw, you can start with some simple equipment you can buy from The Things Network like a gateway and simple node or arduino-type dev board).
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
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Getting data from LoRa - TTN network

Post by Derik »

Thanks

I read a lot.
When i have time i buy a gateway.

Do you have some advice? gateway and interen or extern antenna?
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest