[Fiware-tech-help] iotagent-json [IMPACT Growth]

Ignacio Gomez Maqueda imaqueda at sensowave.com
Sun May 13 10:21:53 CEST 2018


To whom it may concern,

We are trying to use the iotagent-json to connect the messages coming from
our devices to the Context Broker.
We have created a simple device for testing using curl. The object is:

curl -X POST -H "Fiware-Service: myHome" -H "Fiware-ServicePath:
/environment" -H "Content-Type: application/json" -H "Cache-Control:
no-cache" -d '{
    "devices": [
        {
            "device_id": "zz153",
            "entity_name": "zz153",
            "entity_type": "collar",
            "attributes": [
                  { "object_id": "f_activity", "name": "f_activity",
"type": "int" },
                  { "object_id": "la", "name": "latitude", "type":
"String"},
                  { "object_id": "lo", "name": "longitude", "type":
"String"},
                  { "name": "location", "type": "geo:point",  "expression":
"${latitude}, ${longitude}"}
            ]
        }
    ]
}

To publish a message we use the following call:
mosquitto_pub -t /1234/zz153/attrs -m
'{"f_activity":0,"la":"40.4","lo":"-3.4"}'

The problem arises when we get the information from the Context Broker
where fields are empty.

{
    "id": "zz153",
    "type": "collar",
    "TimeInstant": {
        "type": "ISO8601",
        "value": " ",
        "metadata": {}
    },
    "f_activity": {
        "type": "int",
        "value": " ",
        "metadata": {}
    },
    "latitude": {
        "type": "String",
        "value": " ",
        "metadata": {}
    },
    "location": {
        "type": "geo:point",
        "value": "0, 0",
        "metadata": {}
    },
    "longitude": {
        "type": "String",
        "value": " ",
        "metadata": {}
    }
}

We think the issue is in the type of the attributes because if we follow
the sample from the tutorial, it works. However, we have tried several
combinations with no success.

Thanks

Un saludo / Best Regards

Ignacio Gómez Maqueda

Director Técnico / CTO


Calle Federico Cantero Villamil 2-B, Desp. 6.

28935 Móstoles. Madrid
Tel.: +34 644 35 06 13
www.digitanimal.com  <http://www.digitanimal.com/>

AVISO LEGAL
Esta información es privada y confidencial y está dirigida únicamente a su
destinatario. Si usted no es el destinatario original de este mensaje y por
este medio pudo acceder a dicha información por favor elimine el mensaje.
La distribución o copia de este mensaje está estrictamente prohibida. La
transmisión de e-mails no garantiza que el correo electrónico sea seguro o
libre de error. Por consiguiente, no manifestamos que esta información sea
completa o precisa. Toda información está sujeta a alterarse sin previo
aviso.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20180513/7feafb09/attachment.html>


More information about the Fiware-tech-help mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy