nrf9160 MQTT error -53 (ENOANO)

Hi,

We have a problem with a nrf9160 connected in NB-IOT with a bad signal.

During the debugging session to try to figure out what happen, we saw that the mqtt_evt_handler was throwing the MQTT_EVT_DISCONNECT event with error -53 (ENOANO) What is the meaning of the error?

Thanks for your help.

Parents
  • Hello!

    Are you running your own program or a sample project?

    If it is a sample, which one is it?

    I'd like to know exactly what function is returning the error code.

    Best regards,

    Einar

  • Hi,

    own program but based on the mqtt_sample from sdk 1.5.0

    the error is returned in the mqtt_evt_handler in case MQTT_EVT_DISCONNECT.
    evt->result indicates -53

    We are not calling 
    mqtt_disconnect().
    Seems to happen only when connectivity is bad. 

    /**@brief MQTT client event handler
     */
    void mqtt_evt_handler(struct mqtt_client *const c,
    		      const struct mqtt_evt *evt)
    {
    	int err;
    
    	switch (evt->type) {
    	case MQTT_EVT_CONNACK:
    		if (evt->result != 0) {
    			LOG_ERR("MQTT connect failed: %d", evt->result);
    			break;
    		}
    
    		LOG_INF("MQTT client connected");
    		subscribe();
    		break;
    
    	case MQTT_EVT_DISCONNECT:
    		LOG_INF("MQTT client disconnected: %d", evt->result);
    		break;
    		
    		
    	//....
    }

Reply
  • Hi,

    own program but based on the mqtt_sample from sdk 1.5.0

    the error is returned in the mqtt_evt_handler in case MQTT_EVT_DISCONNECT.
    evt->result indicates -53

    We are not calling 
    mqtt_disconnect().
    Seems to happen only when connectivity is bad. 

    /**@brief MQTT client event handler
     */
    void mqtt_evt_handler(struct mqtt_client *const c,
    		      const struct mqtt_evt *evt)
    {
    	int err;
    
    	switch (evt->type) {
    	case MQTT_EVT_CONNACK:
    		if (evt->result != 0) {
    			LOG_ERR("MQTT connect failed: %d", evt->result);
    			break;
    		}
    
    		LOG_INF("MQTT client connected");
    		subscribe();
    		break;
    
    	case MQTT_EVT_DISCONNECT:
    		LOG_INF("MQTT client disconnected: %d", evt->result);
    		break;
    		
    		
    	//....
    }

Children
  • Ok, thank you.

    According to errno.h error code 53 seems to mean "Software caused connection abort", but this error is named ECONNABORTED where I looked it up.

    Where did you get the ENOANO name from? Was it printed with your error code?

    Have you tried running the MQTT sample without your modifications? Do you still get the same behavior?

    -Einar

  • oh okay thank you, make more sense.

    I was looking in sys/errno.h

    #define EBADE 50	/* Invalid exchange */
    #define EBADR 51	/* Invalid request descriptor */
    #define EXFULL 52	/* Exchange full */
    #define ENOANO 53	/* No anode */
    #define EBADRQC 54	/* Invalid request code */
    #define EBADSLT 55	/* Invalid slot */
    #define EDEADLOCK 56	/* File locking deadlock error */
    #define EBFONT 57	/* Bad font file fmt */



    Unfortunately, we did these tests in another country. We will try to reproduce it at our office.

    Our mqtt client is receiving ~500byte/s, so "Software caused connection abort" could correspond to a buffer/memory behavior due to limited connectivity? or do you have any idea what could generate this error?

  • Since you say you have a bad signal I would suspect this event to be triggered by losing your connection?

    As I said, I would recommend debugging further by trying the standard MQTT sample to see if this behavior is caused by your modifications or not.

    -Einar

Related