Atos-Research-and-Innovation / IoTagent-LoRaWAN

FIWARE IoT Agent for LoRaWAN protocol (with CayenneLpp and CBOR data models)
https://fiware-lorawan.readthedocs.io/en/latest/
Other
34 stars 40 forks source link

No response if TTN credentials are not valid #68

Closed filgiuff closed 3 years ago

filgiuff commented 5 years ago

If I provision a TTN device with not valid credentials on application_server -->username, password, the agent doesn't send any response.

Example of payload

{
    "devices": [{
        "device_id": "TEST1",
        "entity_name": "LORA-DEVICE14",
        "entity_type": "LoraDevice",
        "timezone": "America/Santiago",
        "attributes": [{
                   "object_id": "t1",
                   "name": "temperature_1",
                   "type": "number"
                  }],
        "internal_attributes": {
            "lorawan": {
                "application_server": {
                    "host": "eu.thethings.network",
                    "username": "aaa",
                                    "password": "ttn-account-v2.AAAAAAAA",
                    "provider": "TTN"
                },
                "app_eui": "111",
                "application_id": "22",
                "application_key": "33",
                "data_model": "cayennelpp",
                "dev_eui": "44444"
            }
        }
    }]
}

The agent continues to print these messages on the log..

....

.... iotstack_iotagent-lora.1.2d2gt8esim02@xerus-1 | {"timestamp":"2019-05-17T08:33:13.067Z","level":"error","message":"Error connecting to MQTT server:{\"code\":5}"} iotstack_iotagent-lora.1.2d2gt8esim02@xerus-1 | {"timestamp":"2019-05-17T08:33:13.083Z","level":"error","message":"Error connecting to MQTT server:{\"code\":5}"} iotstack_iotagent-lora.1.2d2gt8esim02@xerus-1 | {"timestamp":"2019-05-17T08:33:19.188Z","level":"error","message":"Error connecting to MQTT server:{\"code\":5}"} iotstack_iotagent-lora.1.2d2gt8esim02@xerus-1 | {"timestamp":"2019-05-17T08:33:19.191Z","level":"error","message":"Error connecting to MQTT server:{\"code\":5}"} iotstack_iotagent-lora.1.2d2gt8esim02@xerus-1 | {"timestamp":"2019-05-17T08:33:25.305Z","level":"error","message":"Error connecting to MQTT server:{\"code\":5}"} iotstack_iotagent-lora.1.2d2gt8esim02@xerus-1 | {"timestamp":"2019-05-17T08:33:25.310Z","level":"error","message":"Error connecting to MQTT server:{\"code\":5}"} iotstack_iotagent-lora.1.2d2gt8esim02@xerus-1 | {"timestamp":"2019-05-17T08:33:31.414Z","level":"error","message":"Error connecting to MQTT server:{\"code\":5}"}....

This loop can only be stopped by restarting the agent.

We expect the agent to send an error message after 1-2 connection attempts.

sromerotech commented 4 years ago

It would be great if the agent will try to reconnect from time to time and send some sort of event

cpezuela commented 3 years ago

Thanks !!