Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-15863

FIWARE.Question.Tech.What's the right way to create a mosquitto subscription with a device and IoTAgent-UL.

    Details

    • Type: Monitor
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:

      Description

      Created question in FIWARE Q/A platform on 29-05-2019 at 21:05
      Please, ANSWER this question AT https://stackoverflow.com/questions/56367445/whats-the-right-way-to-create-a-mosquitto-subscription-with-a-device-and-iotage

      Question:
      What's the right way to create a mosquitto subscription with a device and IoTAgent-UL

      Description:
      I'm currently developing a Fiware based network, in which I have devices that report via HTTP and JSON over MQTT and work fine. The network has increased and now I need to attach some devices that use the UltraLight protocol. Doing so, I encountered some troubles.

      I followed (to the best of my knowledge) the official documentation provided by the FIWARE Foundation in different sites (the official github repo, readthedocs, and so on). I tried installing the new agent on the same machine as the JSON agent, and it didn't work more on that later. In order to discard any conflicts, I used another VM in which over Docker this time I deployed a new instance of Orion CB, Mosquitto CB, mongo and the agent; a new complete stack of Fiware, basically.

      After everything was deployed, I created a new service group on the agent via the rest API (POST /iot/devices), gave it an api key and the CB address. In this step I left the resource field empty, because I donĀ“t really know what role does it play in the whole system. The response was 201, as expected.
      The next step was to provision a device, which I did by POSTing to agent/iot/devices with the attributes I wanted, and the api key mentioned in last paragraph. Once again, the response was 201.

      The problem arises when I try to publish a new measurement using mosquitto_pub. The command runs smoothly but the entity in Orion does not get updated. Accessing Orions DB (mongo) I can check that the entity was created successfully but it has an empty value. Moreover, checking the logs yields the following:

      mosquitto | 1559157902: New connection from 10.150.150.173 on port 1883.
      mosquitto | 1559157902: New client connected from 10.150.150.173 as mosqpub|28750-mqtt (p1, c1, k60).
      fiware-iot-agent | time=2019-05-29T19:25:02.374Z | lvl=DEBUG | corr=2c8aa6e3-faab-4166-9e20-0b362c165939 | trans=2c8aa6e3-faab-4166-9e20-0b362c165939 | op=IoTAgentNGSI.MongoDBGroupRegister arams ["resource","apikey"] with queryObj

      {"resource":"/iot/d","apikey":"apikeymia"}

      | comp=IoTAgent
      fiware-iot-agent | time=2019-05-29T19:25:02.381Z | lvl=DEBUG | corr=2c8aa6e3-faab-4166-9e20-0b362c165939 | trans=2c8aa6e3-faab-4166-9e20-0b362c165939 | op=IoTAgentNGSI.MongoDBGroupRegister elds [["resource","apikey"]] not found: [

      {"resource":"/iot/d","apikey":"apikeymia"}

      ] | comp=IoTAgent
      fiware-iot-agent | time=2019-05-29T19:25:02.382Z | lvl=ERROR | corr=2c8aa6e3-faab-4166-9e20-0b362c165939 | trans=2c8aa6e3-faab-4166-9e20-0b362c165939 | op=IOTAUL.Common.Binding | srv=n/a | essing device measures [/apikeymia/motion003/attrs] | comp=IoTAgent
      mosquitto | 1559157902: Client mosqpub|28750-mqtt disconnected.

      (sorry about the format, first time asking and I couldn't find how to format the code section)

      after each try of publishing a new meassurment.

      Any help would be appreciated

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2019-05-30 00:06|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-05-30 00:06|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-05-30 12:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-05-30 12:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-05-30 15:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-05-30 15:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-05-30 21:06|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2019-05-30 21:06|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            josegato Jose Gato Luis
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: