Manish Pareek
Manish Pareek

Reputation: 69

How to send LoRaWAN device data to FIWARE LoRaWAN IoT Agent from postman or MQTT Publisher client

I have created an application in Things Network for LoRaWAN. Also registered a device within that application.

  1. Already register a service in LoRaWAN IoT Agent and provisioned a device with provider as TTN in LoRaWAN IoT Agent.
  2. Created a HTTP integration in Things Network Stack for my IoT Agent.
  3. I also received data sent from Things Network Uplink client in my registered IoT agent.

Uplink payload from Things Network 01 67 00 FF

Now i want to send uplink message from postman or MQTT publisher client.

I tried to create a payload for postman i.e. Url : http://MyMachineIP:4061/iot/json?=MyDeviceId&k=APIKEY

JSON PAYLOAD

{
  "app_id": "MyApplicationID",
  "dev_id": "MyDeviceId",
  "hardware_serial": "AAAAAAAAAAAAAAAA",
  "payload_raw": "AWcA/w==",
  "metadata": {
    "gateways": [
      {
        "gtw_id": "TEST_1",
        "rssi": 0,
        "snr": 0
      }
    ]
  }
}

but got error Cannot POST /iot/json.

I also tried using MQTT Publisher Client:

  1. Installed Eclipse Mosquitto providers a CLI to subscribe and to publish messages.

  2. Start Mosquitto Service.

  3. MQTT command to publish uplink measure:

    mosquitto_pub -h eu.thethings.network -p 1883 -u applicationid-P ttn-account-v2.xXXXXXXXXXXXXXXXXXXXXXXXXX -t applicationid/devices/deviceid/up -m '{"port":1,"payload_raw":"AWcAuw=="}' -d
    
  4. MQTT command to subscribe uplink measure:

    mosquitto_sub -h eu.thethings.network -p 1883 -u applicationid -P ttn-account-v2.x2Q20IXXXXX
    

Upvotes: 2

Views: 424

Answers (1)

RobMBSos
RobMBSos

Reputation: 55

I recommend you reading this IoT Agent LoRaWAN guide https://fiware-lorawan.readthedocs.io/en/latest/users_manual/index.html Device provisioning, config and read this part: In this case, the IoTA will subscribe to any observation coming from the LoRaWAN application server. Whenever a new update arrives, it will create the corresponding device internally and also in the Context Broker using the pre-provisioned configuration. Finally, it will forward appropriate context update requests to the Context Broker to update the attributes' values.

Regards!

Upvotes: 1

Related Questions