Extracting Data from TTN to my Server

Hi,

Try this: Ic880a concentrator with Raspberry pi Gateway

Regards,
Celia

@celiagarridoh

Hi,

Can we change the operational frequency of RN2903 Lora Module?
As of now its being operated on 868 Mhz and in India this band is not licence free. TTN says it works on 865-867 Mhz but my module frequency does not change?
Any help

I’ve never used this module, but as far as I know it operates in the 915 MHz frequency band, doesn’t it?

http://ww1.microchip.com/downloads/en/DeviceDoc/50002390B.pdf

I’m sorry that I can’t help you.

Regards,
Celia

Hi Celiagarridoh ,

Any idea if TTN supports 2 different Ports for uplink and downlink?
Currently it allows 1700 port on the Gateway to uplink and downlink. Can we change downlink port other than 1700?

What is the benefit of separating these function to different ports?

Andrei

I don’t believe you can.Review: RN2903 AU firmware

Andrei

Hi celiagarridoh ,

Is there any issue with Data Packets logs on the TTN console, my gateway and devices are working fine but no data on the console since 3-4 days,

Kindly advice,
Zaheen

Hi,
I am able to receving the uplink messages in Node.js(on console). Now i want to send those received uplink messages to my server(local host:xxxx) please tell me the procedure how to do this.

your help is most valuable to me.
please give me reply
Thank you
Regards,
prakash

Hi,

I am so sorry that it’s been such a long time since you asked me, but I was finishing my exams at university. I’ve been a time disconnected, my apologies.

In response to @LoraWANSMARU, I cannot confirm that, I would also like to know the answer.

In response to @saiprakash, I think I used the “socket-io” client on Node.js:

require('socket.io-client')
io.connect('http://localhost:xxxx', { reconnect: true, query: "var=abc" })
socket.emit('abc', ...)
[…]

I send the data using the emit function, you can take a look while I update my nodes and, in case you need further information, don’t hesitate to ask.

My apologies one more time for being away such a long time, now I came back to stay :wink:

Best Regards,
Celia

1 Like

The data stream is like that : Lora Node -> LoraGateway -> TTN ->myAPIserver.
We still cannot analysis the specific data on TTN, we only can read the data on our server, is that right ?
What is the advantage of this ?
Instead we can use thingspeak server directly and the LoraGateway sends the package from lora Nodes to thingspeak directly, so that we can read specific data with thingspeak api interface. This is so convenient and we only need one server.

If you only want your nodes to be able to connect to your LoRa Gateway and you only want your nodes to be able to connect, you indeed don’t need the TTN backend.
With TTN, your node could also connect to my Gateway (and all the others out there) and other nodes can use your Gateway to connect.
It is the difference between a private network and a public one.

Also, the (TTN) LoRaWAN network servers provide downlinks, OTAA, ADR and later on class B and C. It’s not an easy task to do all that yourself.

Yes, this is right. I remember if I use thingspeak API interface, I do not have these functions to setup, Thanks

Your mean my lora node is connected to your (or others) gateway. Yes, that seems to be more public.

Yes, the idea is that if you would want to use the node while it is not within reach of your Gateway, but it can reach mine (or anyone others) Gateway, it can still send its data. And you (and only you) would still be able to retrieve it.
It might not be an issue for you if your nodes don’t move, are always in the same place, but the idea is to build a distributed network eventually covering the whole planet (or at least large parts of it), with not just one person / party / company being responsible for the gateways. So if you need coverage somewhere, you simply can decide to put a gateway there (without having to ask TTN to put it there) and while doing that not only helping yourself but anyone else in that area.

1 Like

Right now, I have CRC_FAIL 100% errors on the Lora gateway.
06

Here is the updated link for inspecting HTTP requests:
https://requestbin.fullcontact.com

Note that Requestbin has been taken offline due to abuse: https://github.com/Runscope/requestbin

https://requestbin.fullcontact.com is hosted on the Dating-Site https://www.fullcontact.com/

Alternative to RequestBin is Request Baskets: https://rbaskets.in/web

In all cases your TTN data goes to a 3rd party

Both Bin and Baskets are on GitHub, so you can install it on your own server

1 Like

Hi,
I would like to know how I could extract specific fields from the JSON received in MQTT please. I’m using this code :

var ttn = require(‘ttn’);
var appId = ‘id’;
var accessKey = ‘mykey’;
ttn.data(appId, accessKey)
.then(function (client) {
client.on(‘uplink’, function (devId, payload) {
console.log(payload)
})
})
.catch(function (error) {
console.error(error)
process.exit(1)
})

and I receive this :

{ app_id: ‘id’,
dev_id: ‘da5a56d070000007’,
hardware_serial: ‘DA5A56D070000007’,
port: 1,
counter: 267,
payload_raw:
<Buffer … >,
payload_fields:
{ analog_in_1: 4,
analog_in_2: 0,
analog_in_3: 59,
digital_in_7: 1,
luminosity_6: 247,
relative_humidity_5: 78.5,
temperature_4: 26.4 },
metadata:
{ time: ‘2019-05-31T03:16:32.248557222Z’,
frequency: 868.1,
modulation: ‘LORA’,
data_rate: ‘SF10BW125’,
airtime: 493568000,
coding_rate: ‘4/5’,
gateways: [ [Object] ] } }

For instance, I would only like to extract the luminosity_6 field please.

Hi @abdelrazak, you can feed the JSON into the jq utility. To extract the luminosity_6 field you could use your existing code and pipe the output into jq and use it to extract only the fields that you want:

your-existing-code | jq ‘.payload_fields.luminosity_6’