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

FIWARE.Question.Tech.IoTAgent (JSON) over MQTT doesn't receive measurements from mosquitto.

    Details

      Description

      Created question in FIWARE Q/A platform on 18-12-2022 at 16:12
      Please, ANSWER this question AT https://stackoverflow.com/questions/74842815/iotagent-json-over-mqtt-doesnt-receive-measurements-from-mosquitto

      Question:
      IoTAgent (JSON) over MQTT doesn't receive measurements from mosquitto

      Description:
      Goal: to use the IoTAgent (JSON) provided by FIWARE with the MQTT transport protocol. In particular, I would like to provision a service group rather than individual devices, such that anonymous devices can send their measurements to the IoTAgent via the Mosquitto Broker.
      Problem: Mosquitto Broker receives messages (sent by an MQTT publisher) but IoTAgent does not. Both are on the same network (I used docker compose), so ruled out this could be the reason of the problem.
      The docker-compose.yaml file looks like this:
      version: "3.5"
      services:
      mosquitto:
      image: eclipse-mosquitto:1.6.14
      hostname: mosquitto
      container_name: mosquitto
      expose:

      • "1883"
      • "9001"
        ports:
      • "1883:1883"
      • "9001:9001"
        networks:
      • default

      iot-agent:
      image: fiware/iotagent-json:latest
      hostname: iot-agent
      container_name: fiware-iot-agent
      depends_on:

      • mongo-db
      • mosquitto
        networks:
      • default
        expose:
      • "4041"
        ports:
      • "4041:4041"
        environment:
      • IOTA_CB_HOST=orion
      • IOTA_CB_PORT=1026
      • IOTA_CB_NGSI_VERSION=ld
      • IOTA_JSON_LD_CONTEXT=http://context/ngsi-context.jsonld
      • IOTA_NORTH_PORT=4041
      • IOTA_MQTT_HOST=mosquitto
      • IOTA_MQTT_PORT=1883
      • IOTA_MQTT_QOS=1
      • IOTA_MQTT_KEEPALIVE=60
      • IOTA_DEFAULT_RESOURCE= # Default is blank. I'm using MQTT so I don't need a resource
      • IOTA_REGISTRY_TYPE=mongodb
      • IOTA_MONGO_HOST=mongo-db
      • IOTA_MONGO_PORT=27017
      • IOTA_MONGO_DB=iotagentjson
      • IOTA_LOG_LEVEL=DEBUG
      • IOTA_TIMESTAMP=true
      • IOTA_AUTOCAST=true
      • IOTA_FALLBACK_TENANT=openiot

      The full docker-compose.yaml is available on GitLab repository.
      The service group provisioning is shown below:
      {
      "services": [
      {
      "apikey": "4jggokgpepnvsb2uv4s40d59ov",
      "entity_type": "TrafficFlowObserved",
      "resource": "",
      "expressionLanguage": "jexl",
      "attributes": [

      {"name": "id", "type": "Text", "expression": "'urn:ngsi-ld:TrafficFlowObserved:'+idelem"}

      ,

      {"name": "dateObserved", "type": "Text", "expression": "fecha_hora_inicio|toisodate+'/'+fecha_hora_finalizacion|toisodate"}

      ,

      {"object_id": "intensidad", "name": "intensity", "type": "Number"}

      ]
      }
      ]
      }

      I expect the IoTAgent to receive measurements from anonymous devices as well as mosquitto. Instead, currently, the IoTAgent does not receive the measurements and gives the following error when I provision the service group: DEVICE_GROUP_NOT_FOUND.
      The logs are shown on GitLab repository
      I can't figure out the problem.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2023-01-12 05:33|CREATED monitor | # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2023-01-12 05:33|CREATED monitor | # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2023-01-18 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2023-01-18 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            jason.fox Jason Fox
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: