Receiving (decrypted) device data / FRMPayload


#1

Hello again!

Hope everyone is ok.

I configured the lora server and logged-in the API by localhost. I wait for a mbus device to make my first test.

I would like to know,if the usage of API (in the browser) creates a new connection with a gateway and m-bus devices, and if i will be able to read a value or a telegram by the m-bus device.

I mean that,after the connection i will receive a value (13 Celcius degrees for a temperature device, for example) or a telegram packet which i have to make a new API (in Java for example) to decode it, in a number (integer or float)?

Excuse me, but i don’t have in my mind the exactly usage of the API.

Thanks in advance,
Nikos.


How to decrypt payload FRMPayload on app-server
How to decode payload
Application payload in mqtt
Decoding Data from RN2483
Join OTAA denied (RN2483)
Semtech-mote application details
Decrypting FRMPayload
How to encode data from uplink?
#2

To receive data, you need to subscribe to the MQTT, see: https://docs.loraserver.io/lora-app-server/integrate/data/.

An other option is to setup a HTTP integration (this is a per application setting). In this case LoRa App Server will make a POST request to an endpoint that you have configured. The JSON payload is exactly the same as the JSON over MQTT payload. For integrations, see: https://docs.loraserver.io/lora-app-server/integrate/integrations/


Decoding Data from RN2483
Get sensor data from the REST API
API REST problem with device GET frames
#3

Thanks for the reply @brocaar!

As i understand, using the API in browser i can just establish the connection and take raw data right?

To decode this raw data in understandable (received) format data i have to use the subscription on the MQTT, as the doc refers to?


#4

Hey Orne!
My question concerns docker image of the server. I try to subscribe my mqtt client to the semtech-mote application which is a part of default installation. Tell me please some details about this application: what is the port for mqtt if it is a mqtt server, which topics it uses…or maybe it’s a ws related app.


#5

Need more details about the instalation. But for MQTT integration you must read this:

https://docs.loraserver.io/lora-app-server/integrate/data/

Mosquitto does not have websocket active by default

If you are using docker you should see something like this executing $ docker ps:


#6

Hey! Thanks for info but I need something different. Trying to say that docker image of the server (compact edition, not this one that you have pointed on the screen) has 1 builtin application for Handlers. It is called semtech-mote. So I just want to know how this application works.


#7

That doesn’t look like the LoRa (App) Server interface, so I’m not sure if you’re asking your question at the right place.


#8

@lance Probably you should contact Petr Gotthard at https://github.com/gotthardp/lorawan-server , because this is the image of his loraserver software…


#9

LOL! Guess what? I thought that Orne and Peter is the same man with the same server but one of the releases is for full installations and the other is for lightweight.)))))) My baaaaaad guys, sorry…


#10

Hello.
I installed the server, app-server and so on and subscribed to MQTT with Node.red. I can see all fields but “data” field is encrypted, like this:

{“applicationID”:“1”,“applicationName”:“test_ds18b20”,“deviceName”:“arduino_uno”,“devEUI”:“1234567890123456”,“rxInfo”:[{“mac”:“aa755a0048050130”,“rssi”:-57,“loRaSNR”:10,“name”:“raspberry_pi”,“latitude”:48.466860686785175,“longitude”:1.019478797912605,“altitude”:0}],“txInfo”:{“frequency”:868100000,“dataRate”:{“modulation”:“LORA”,“bandwidth”:125,“spreadFactor”:7},“adr”:true,“codeRate”:“4/5”},“fCnt”:9,“fPort”:1,“data”:“Z29vZGJ5ZQ==”,“object”:{}}

I cant decrypt this on Node.red side.
On app-server i found this setting “Payload codec”.
and it gives me some choices: Caayenne LPP - didnt work and gives me same encrypted data, and Custom JavaScript codec functions:
9
but i dont know what i must change on this function. Should i paste here my fPort number? If yes what about bytes, where i must get it?

Basically i want to recieve in node.red something like this (data with object):

“fCnt”: 10, // frame-counter
"fPort": 5, // FPort
"data": “…”, // base64 encoded payload (decrypted)
“object”: { // decoded object (when application coded has been configured)
“temperatureSensor”: {“1”: 25},
“humiditySensor”: {“1”: 32}
}
}
as mentioned here - https://docs.loraserver.io/lora-app-server/integrate/data/
Also i saw this - https://godoc.org/github.com/brocaar/lorawan#EncryptFRMPayload but i dont know what to do exactley, should i just paste code from this link to Custom JavaScript codec functions in app-server or what?
Can @brocaar please guide me how to do this and if possible with some examples
Thanks alot


#11

As node im using arduino uno+dragino shield (RFM95) http://wiki.dragino.com/index.php?title=Lora_Shield with LMIC library for LoRaWAN.
As gateway im using raspberry pi+sx1301 with semteh packet_forwarder.


#12

Please note that the data is not encrypted but base64 encoded. As the payload is basically an array of bytes, you either make sure that on the device you encode the data using the Cayenne LPP encoding, or you need to define your own decoder function to decode your data from an array of bytes to a JSON object.


#13

Hi @trt_rtrt,

For just an example, I am sending an Hex payload over the node. So at mosquitto subscribing I will receive encode in base 64. So I used some libraries that take the data, decode64 and encode16. That returns my original data sent by node.


#14

Which library did you use?


#15

Hi @trt_rtrt!

For each application you can use owns called encripted/decrypted libraries.

For example if use Node-RED you can install encrypt library search n the Manage Palletes


#16

Thanks for answering!


#17

Since LoRa App Server 0.19.0 you will also be able to see the live event logs for a given device. This will show the join, ack, error and uplink events and contain exactly the same data as the MQTT of HTTP integration messages. This is for debugging only, and is not a replacement for building integrations.


#18

FYI, I am not seeing the downlink messages in the Live Event Log. I see the ack from a confirmed downlink, but not the downlink itself.


#19

you can use this:

credits to @RussNelson


Payload not decoding properly from App Server
#20

i’m try to send data from node to server, now it success but i can’t decode payloads. i’m not understand data format. someone explain for me.

note: i used to send this data to ttn then i’m modify that code for send to loraserver, in ttn payloads are hex ascii format it easy to decode.
.
.
.
this is data format that i can see

30

please help me !!!