This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

POLLNVAL simple MQTT re-connection problem

Hi, 

I have managed to send data to a dedicated server, but I have a problem with reconnection. After re-connection, this is what I get as an output.
In the log, there are two disconnect events. First re-connected successfully, and second, did not. I am not sure what event occurs and I get POLLNVAL. What does this mean?

first disconnect:

5801519 - sens1: 227, sens2: 61 
5801522 - {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 227, "light2": 61}, "t": ["tunnel_light"]} 
5801533 - Publishing: {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 227, "light2": 61}, "t": ["tunnel_light"]}
5801545 - to topic: dev/data len: 8
5801547 - [mqtt_evt_handler:220] MQTT client disconnected -57
5801552 - pub err: -57
5802408 - Publishing: {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 227, "light2": 61}, "t": ["tunnel_light"]}
5802420 - to topic: dev/data len: 8
5802423 - pub err (after reconnect): -57
5802425 - Elapsed time: 85
5802928 - [mqtt_evt_handler:208] MQTT client connected!
5802933 - Subscribing to: my/subscribe/topic len 18
5802937 - Publishing: {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 227, "light2": 61}, "t": ["tunnel_light"]}
5802950 - to topic: dev/data len: 8
5802952 - pub err: 0
5803128 - [mqtt_evt_handler:264] SUBACK packet id: 1234
5803526 - [mqtt_evt_handler:254] PUBACK packet id: 63111


Second disconnect:

14440890 - Elapsed time: 229
14500883 - sens1: 226, sens2: 60 
14500886 - {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 226, "light2": 60}, "t": ["tunnel_light"]} 
14500897 - Publishing: {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 226, "light2": 60}, "t": ["tunnel_light"]}
14500909 - to topic: dev/data len: 8
14500911 - pub err: 0
14500913 - Elapsed time: 230
14560878 - sens1: 226, sens2: 60 
14560881 - Elapsed time: 231
14560902 - [mqtt_evt_handler:220] MQTT client disconnected -57
14560907 - POLLNVAL
14560908 - Disconnecting MQTT client...
14560911 - Could not disconnect MQTT client. Error: -57
14620874 - sens1: 225, sens2: 60 
14620877 - Elapsed time: 232
14680870 - sens1: 226, sens2: 60 
14680873 - Elapsed time: 233
14740865 - sens1: 226, sens2: 60 
14740868 - Elapsed time: 234
14800861 - sens1: 226, sens2: 60 
14800864 - {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 226, "light2": 60}, "t": ["tunnel_light"]} 
14800875 - Publishing: {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 226, "light2": 60}, "t": ["tunnel_light"]}
14800887 - to topic: dev/data len: 8
14800889 - pub err: -57
14801634 - Publishing: {"s": "mydevice!light", "m": "tempV1", "loc": [45.4535, 4.5032], "v": {"light1": 226, "light2": 60}, "t": ["tunnel_light"]}
14801647 - to topic: dev/data len: 8
14801649 - pub err (after reconnect): -57
14801652 - Elapsed time: 235
14860857 - sens1: 226, sens2: 60 
14860860 - Elapsed time: 236
14920852 - sens1: 226, sens2: 60 
14920855 - Elapsed time: 237

Than you,
Voja. 

Related