Closed jelalanne closed 4 years ago
Hi,
Pls Attach the log of GW.
Here you can see 2 cases: the first message is correctly received, with PUBLISH being received by the broker, but not in second message. Whole thing with this error on disconnect ACK.
`
20190528 113022.587 PahoGateway-01 has been started.
ConfigFile: ./gateway.conf ClientList: ./clients.conf PreDefFile: ./predefinedTopic.conf SensorN/W: Gateway Port: 10000 Broadcast Address: ff32:40:fd5a:b03d:7f78::1 Interface: wpan0 Broker: 192.168.43.218 : 1883, 4321 RootCApath: /home/pi/SSL/ RootCAfile: /home/pi/SSL/ca.crt CertKey: (null) PrivateKey: (null)
20190528 113028.339 [0m[0;33mCONNECT [0m[0;32m<--- Client2 [0m[0;34m 0D 04 04 01 00 0A 43 6C 69 65 6E 74 32[0m[0;37m
20190528 113028.435 [0m[0;33mCONNECT ===> [0m[0;37mClient2 [0m[0;34m 10 13 00 04 4D 51 54 54 04 02 00 0A 00 07 43 6C 69 65 6E 74 32[0m[0;37m
20190528 113028.589 [0m[0;33mCONNACK <=== [0m[0;37mClient2 [0m[0;34m 20 02 00 00[0m[0;37m
20190528 113028.589 [0m[0;33mCONNACK [0m[0;37m---> [0m[0;32mClient2 [0m[0;34m 03 05 00[0m[0;37m unicast sendto fd5a:b03d:7f78:0:efd:4aca:49a9:e0ff%wpan0, port: 44861 length = 3
20190528 113028.641 [0m[0;32mREGISTER 0001 <--- Client2 [0m[0;34m 1A 0A 00 00 00 01 2F 43 6C 69 65 6E 74 32 2F 74 65 6D 70 65 72 61 74 75 72 65[0m[0;37m
20190528 113028.641 REGACK 0001 ---> [0m[0;32mClient2 [0m[0;34m 07 0B 00 01 00 01 00[0m[0;37m unicast sendto fd5a:b03d:7f78:0:efd:4aca:49a9:e0ff%wpan0, port: 44861 length = 7
20190528 113028.692 [0m[0;32mPUBLISH 0002 <--- Client2 [0m[0;34m 91 0C 20 00 01 00 02 7B 22 4D 61 63 68 69 6E 65 22 3A 7B 22 49 64 22 3A 22 43 6C 69 65 6E 74 32 22 2C 22 54 65 6D 70 65 72 61 74 75 72 65 22 3A 35 32 2E 30 37 2C 22 50 72 65 73 73 75 72 65 22 3A 30 7D 2C 22 41 6D 62 69 65 6E 74 22 3A 7B 22 54 65 6D 70 65 72 61 74 75 72 65 22 3A 30 2C 22 48 75 6D 69 64 69 74 79 22 3A 30 7D 2C 22 54 69 6D 65 43 72 65 61 74 65 64 22 3A 22 32 30 31 39 2D 30 31 2D 30 31 54 30 30 3A 30 31 3A 31 39 22 7D[0m[0;37m
20190528 113028.692 PUBLISH 0002 [0m[0;33m===> [0m[0;37mClient2 [0m[0;34m 32 A2 01 00 14 2F 43 6C 69 65 6E 74 32 2F 74 65 6D 70 65 72 61 74 75 72 65 00 02 7B 22 4D 61 63 68 69 6E 65 22 3A 7B 22 49 64 22 3A 22 43 6C 69 65 6E 74 32 22 2C 22 54 65 6D 70 65 72 61 74 75 72 65 22 3A 35 32 2E 30 37 2C 22 50 72 65 73 73 75 72 65 22 3A 30 7D 2C 22 41 6D 62 69 65 6E 74 22 3A 7B 22 54 65 6D 70 65 72 61 74 75 72 65 22 3A 30 2C 22 48 75 6D 69 64 69 74 79 22 3A 30 7D 2C 22 54 69 6D 65 43 72 65 61 74 65 64 22 3A 22 32 30 31 39 2D 30 31 2D 30 31 54 30 30 3A 30 31 3A 31 39 22 7D[0m[0;37m
20190528 113028.693 PUBACK 0002 [0m[0;33m<=== [0m[0;37mClient2 [0m[0;34m 40 02 00 02[0m[0;37m 20190528 113028.693 PUBACK 0002 ---> [0m[0;32mClient2 [0m[0;34m 07 0D 00 01 00 02 00[0m[0;37m unicast sendto fd5a:b03d:7f78:0:efd:4aca:49a9:e0ff%wpan0, port: 44861 length = 7 20190528 113028.722 [0m[0;33mDISCONNECT [0m[0;32m<--- Client2 [0m[0;34m 02 18[0m[0;37m
20190528 113028.722 [0m[0;33mDISCONNECT [0m[0;37m---> [0m[0;32mClient2 [0m[0;34m 02 18[0m[0;37m unicast sendto fd5a:b03d:7f78:0:efd:4aca:49a9:e0ff%wpan0, port: 44861 length = 2 20190528 113028.722 [0m[0;33mDISCONNECT ===> [0m[0;37mClient2 [0m[0;34m E0 00[0m[0;37m
[0m[0;31mError: BrokerRecvTask can't receive a packet from the broker errno=0 Client2[0m[0;37m
20190528 113038.750 [0m[0;33mCONNECT [0m[0;32m<--- Client2 [0m[0;34m 0D 04 04 01 00 0A 43 6C 69 65 6E 74 32[0m[0;37m
20190528 113038.833 [0m[0;33mCONNECT ===> [0m[0;37mClient2 [0m[0;34m 10 13 00 04 4D 51 54 54 04 02 00 0A 00 07 43 6C 69 65 6E 74 32[0m[0;37m
20190528 113039.225 [0m[0;33mCONNACK <=== [0m[0;37mClient2 [0m[0;34m 20 02 00 00[0m[0;37m
20190528 113039.225 [0m[0;33mCONNACK [0m[0;37m---> [0m[0;32mClient2 [0m[0;34m 03 05 00[0m[0;37m unicast sendto fd5a:b03d:7f78:0:efd:4aca:49a9:e0ff%wpan0, port: 38693 length = 3
20190528 113039.274 [0m[0;32mPUBLISH 0003 <--- Client2 [0m[0;34m 91 0C 21 00 01 00 03 7B 22 4D 61 63 68 69 6E 65 22 3A 7B 22 49 64 22 3A 22 43 6C 69 65 6E 74 32 22 2C 22 54 65 6D 70 65 72 61 74 75 72 65 22 3A 35 32 2E 30 37 2C 22 50 72 65 73 73 75 72 65 22 3A 30 7D 2C 22 41 6D 62 69 65 6E 74 22 3A 7B 22 54 65 6D 70 65 72 61 74 75 72 65 22 3A 30 2C 22 48 75 6D 69 64 69 74 79 22 3A 30 7D 2C 22 54 69 6D 65 43 72 65 61 74 65 64 22 3A 22 32 30 31 39 2D 30 31 2D 30 31 54 30 30 3A 30 31 3A 31 39 22 7D[0m[0;37m
20190528 113039.274 PUBACK 0003 ---> [0m[0;32mClient2 [0m[0;34m 07 0D 00 01 00 03 02[0m[0;37m unicast sendto fd5a:b03d:7f78:0:efd:4aca:49a9:e0ff%wpan0, port: 38693 length = 7 20190528 113039.298 [0m[0;33mDISCONNECT [0m[0;32m<--- Client2 [0m[0;34m 02 18[0m[0;37m
20190528 113039.298 [0m[0;33mDISCONNECT [0m[0;37m---> [0m[0;32mClient2 [0m[0;34m 02 18[0m[0;37m unicast sendto fd5a:b03d:7f78:0:efd:4aca:49a9:e0ff%wpan0, port: 38693 length = 2 20190528 113039.299 [0m[0;33mDISCONNECT ===> [0m[0;37mClient2 [0m[0;34m E0 00[0m[0;37m
[0m[0;31mError: BrokerRecvTask can't receive a packet from the broker errno=0 Client2[0m[0;37m `
Sorry for text quality
Hi,
Why broker returns DISCONNECT?
Specification 3.1.1 defines DISCONNECT as follows: 3.14 DISCONNECT – Disconnect notification The DISCONNECT Packet is the final Control Packet sent from the Client to the Server. It indicates that 1 the Client is disconnecting cleanly.
The GW cannot recieve the out of sequence DISCONNECT message.
So, nothing wrong about the GW.
Do you have any clue about how to avoid this step?
which broker you are using?
Mosquitto TLS v1.2
This GW doesn't support MQTT V.5 yet. Could you use the V3.1.1 broker?
Ok i'll downgrade it and update you afterward
I just saw that we are using v3.1 (using command mosquitto -V)
Hi,
Could you try to use iot.eclipse.org broker ?
Set line17-18 in gateway.conf as follows and rerun.
BrokerName=iot.eclipse.org
BrokerPortNo=1883
If the same error occurs, it's better to ask the mosquitto project.
Hi, It works perfectly with the default broker, but not with mosquitto.
Thanks for your help I will try to see with them.
Hi @ty4tw , I'm coming back to you. It seems that the Disconnect ACK is sent to the client before being sent to the Broker (I don't know why, but it does send it to the Broker), so when the program tries to send the disconnect ack to the broker, the response is not received because the client does not exist anymore, so it gives me an error with code 0. Do you have any idea on how to repare that? Thanks a lot for your time
Hi, DISCONNECT ACK is not defined by MQTT specification 3.1.1.
I don't know why it's happening on both online broker and local one. Only local broker reports an error. I can't find any answer on mosquitto forums.
I'm using NJH library binaries for the clients' side, may this be linked? (https://github.com/njh/mqtt-sn-tools)
Same issue here. I used docker to test different version of mosquitto. The gateway does not work with all version after 1.4.12. (AggregatingGateway=YES)
PUBLISH message you sent is invalid. MsgId od QoS0 should be 0, not 00 02. Gateway of latest develop branch rejects such wrong PUBLISH message.
Hi,
I am having some troubles using the Gateway. In fact when I'm using TLS connection, I have this error everytime the gateway receives a message from client and tries to send a disconnect ACK to the client. Then, program continues but next messages are received but not transmitted to the broker. @ty4tw Thanks for helping (again, sorry)