Send LoRa measures to Fiware IOT agent via MQTT

0 votes

I have LoRa sensors which send measures with Cayenne LPP format payload. My Gateway(LOrank8v1) catches these packets and converts them to UDP. In the gateway there is a service(lora-gateway-bridge) which converts the packets from UDP to TCP/MQTT.

Then the MQTT packets are published to the mosquitto MQTT broker in the cloud. Then i run lora-server and lora-app-server services in order to decrypt,decode and deduplicate the packets.

Then i publish the decrypted information to the MQTT broker again. Here is an example of a publication after all these operations: application/1/node/0000000000000000/rx

{
 "applicationID":"1",
  "applicationName":"Temperature-Humidity",
  "deviceName":"Temperature-Humidity",
  "devEUI":"0000000000000  000",
  "rxInfo":[
    {
      "mac":"1dee18c14948a955",
      "rssi":-27,
      "loRaSNR":9.5,
      "name":"1dee18  c14948a955",
      "latitude":0,
      "longitude":0,
      "altitude":0
    }
  ],
  "txInfo": {
    "frequency":8685  00000,
    "dataRate": {
      "modulation":"LORA",
      "bandwidth":125,
      "spreadFactor":9
    },
    "adr":false,
    "codeRate":"4/5"
  },
  "fCnt":2,
  "fPort":1,
  "data":"AGcAxQFojA==",
  "object": {
    "temperatureSensor": {
      "0":19.7
    },
    "humiditySensor": {
      "1":70
    }
  }
}

Now i want to use Fiware's JSON/MQTT IOT agent to convert MQTT to NGSI in order to publish data to the Context Broker.

The data should be publised like this to be readable :

$ mosquitto_pub -h $HOST_IOTAGENT_MQTT -u theUser -P thePassword -t /myapikey/mydevicemqtt/attrs -m '{ "t": 19,7, "h": 70}'

Has anyone the same problem? Should i make a JSON parser and republish the data to another format into the MQTT Broker? How could i deal with this problem?

Jul 13, 2018 in IoT (Internet of Things) by Matt
• 2,270 points
1,452 views

1 answer to this question.

0 votes

I dont know if I understood correctly your problem. Your steps are ok, you need something to translate from Cayenne LPP to the JSON format expected by you selected agent. Of course, you first need to register your device through the agent, and in this step, you define the different parameters that would be provided by your device (this will configure how you will have to send your json message).

https://github.com/telefonicaid/iotagent-json/blob/master/docs/stepbystep.md#provisioning-the-device

This translation from Cayene to the "special-json-expected-by-the-agent" is a "non-desirable" step. Because you are doing cayene->json->NGSI (but I am not sure if there are other options). We are studying the possibility of creating a new agent capable of understanding Cayene format, but it is still very early, and I am not sure if MQTT will be the selected transport protocol. Also, the lora-networ-server would also related to the composed JSON based on Cayene, so... this would make the task more complicated... lets see...

answered Jul 13, 2018 by anonymous2
• 4,280 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

MQTT pubish is slow to send with ESP8266 & NodeMCU

I think you're almost correct and on ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
2,851 views
0 votes
1 answer

Using FIWARE to start Cygnus as a Service in IoT Solution

Cygnus is supposed to create /var/run/cygnus/ when started. You ...READ MORE

answered Aug 13, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
761 views
0 votes
1 answer

Integrate IoT device to Azure using MQTT

Today there isn't an official support for ...READ MORE

answered Sep 24, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
2,155 views
0 votes
1 answer

How to get Unicast, Dns and Gateway Address in UWP?

Try this code Snippet I found here: https://social.msdn.microsoft.com/Forums/en-US/27a8b7a8-8071-4bc1-bbd4-e7c1fc2bd8d7/windows-10-iot-core-how-do-you-create-a-tcp-server-and-client?forum=WindowsIoT ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
986 views
0 votes
0 answers

Mosquitto Secure MQTT connection

My Question is regarding TLS/SSL MQTT connection. ...READ MORE

Jul 23, 2018 in IoT (Internet of Things) by Matt
• 2,270 points
451 views
0 votes
1 answer

MQTT connection consumes less power

HTTP(S) doesn't keep a connection open - ...READ MORE

answered Jul 24, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
647 views
0 votes
1 answer

Decryption Technique of LORA IOT AES-128

It's not clear what you are using ...READ MORE

answered Sep 4, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
1,248 views
0 votes
1 answer

Publishing commands to device in IBM IoT using MQTT in Java

If you are publishing from an application, ...READ MORE

answered Jul 27, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
1,325 views
0 votes
1 answer

Send data from cloud to aws iot thing

Your solution is not recommend because there ...READ MORE

answered Aug 2, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
1,177 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP