Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kaiterra Air Quality monitor cannot connect to nanomq #1152

Open
hrbonz opened this issue Feb 5, 2025 · 2 comments
Open

Kaiterra Air Quality monitor cannot connect to nanomq #1152

hrbonz opened this issue Feb 5, 2025 · 2 comments

Comments

@hrbonz
Copy link

hrbonz commented Feb 5, 2025

Describe the bug
When configuring a Kaiterra Mini air quality monitor (https://www.kaiterra.com/sensedge-mini-indoor-air-quality-monitor) to connect to a nanomq service, the monitor cannot finish the connection. The server with debug log level throws the following:

2025-02-05 15:19:10 [2211] INFO  /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:412 tcptran_pipe_nego_cb: Disconnect Client due to 153 parse CONNECT failed
2025-02-05 15:19:10 [2211] ERROR /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:465 tcptran_pipe_nego_cb: connect nego error rv:(13)

The monitor works perfectly when connecting to mosquitto.
Kaiterra monitors are deployed all over the world (this model and others).

Expected behavior
The monitor should be able to initiate a connection and send data.

Actual Behavior
The connection doesn't complete and the monitor goes into a retry loop.

To Reproduce
N/A

** Environment Details **

  • NanoMQ version: NanoMQ Messaging Engine for Edge Computing & Messaging bus v0.23.2-2
  • Operating system and version: debian 12 bookworm
  • Compiler and language used
  • testing scenario

Client SDK
No idea as this is what comes from the monitor

Additional context
I used tcpdump to make a network capture during the connection, maybe that can help.

# tcpdump -i ens18 -n "tcp and port 1883" -XX -w kaiterra_mini_nanomq.pcap
# tcpdump -r kaiterra_mini_nanomq.pcap -XX
reading from file kaiterra_mini_nanomq.pcap, link-type EN10MB (Ethernet), snapshot length 262144
17:53:08.467785 IP Kaiterra-SE-200-08CE06.54983 > cleverhub.1883: Flags [F.], seq 1053186, ack 4196577692, win 13999, length 0
        0x0000:  bc24 11ab 6794 44ef bf08 ce06 0800 4500  .$..g.D.......E.
        0x0010:  0028 0369 0000 ff06 d145 c0a8 32da c0a8  .(.i.....E..2...
        0x0020:  32f6 d6c7 075b 0010 1202 fa22 b19c 5011  2....[....."..P.
        0x0030:  36af f60e 0000 0000 0000 0000            6...........
17:53:08.467806 IP cleverhub.1883 > Kaiterra-SE-200-08CE06.54983: Flags [.], ack 1, win 64200, length 0
        0x0000:  44ef bf08 ce06 bc24 11ab 6794 0800 4500  D......$..g...E.
        0x0010:  0028 0000 4000 4006 53af c0a8 32f6 c0a8  .(..@[email protected]...
        0x0020:  32da 075b d6c7 fa22 b19c 0010 1203 5010  2..[..."......P.
        0x0030:  fac8 31f5 0000                           ..1...
17:53:09.468014 IP Kaiterra-SE-200-08CE06.54984 > cleverhub.1883: Flags [S], seq 1074299, win 14000, options [mss 1400], length 0
        0x0000:  bc24 11ab 6794 44ef bf08 ce06 0800 4500  .$..g.D.......E.
        0x0010:  002c 036a 0000 ff06 d140 c0a8 32da c0a8  .,[email protected]...
        0x0020:  32f6 d6c8 075b 0010 647b 0000 0000 6002  2....[..d{....`.
        0x0030:  36b0 37e2 0000 0204 0578 0000            6.7......x..
17:53:09.468039 IP cleverhub.1883 > Kaiterra-SE-200-08CE06.54984: Flags [S.], seq 536526330, ack 1074300, win 64240, options [mss 1460], length 0
        0x0000:  44ef bf08 ce06 bc24 11ab 6794 0800 4500  D......$..g...E.
        0x0010:  002c 0000 4000 4006 53ab c0a8 32f6 c0a8  .,..@[email protected]...
        0x0020:  32da 075b d6c8 1ffa bdfa 0010 647c 6012  2..[........d|`.
        0x0030:  faf0 e73f 0000 0204 05b4                 ...?......
17:53:09.470308 IP Kaiterra-SE-200-08CE06.54984 > cleverhub.1883: Flags [.], ack 1, win 14000, length 0
        0x0000:  bc24 11ab 6794 44ef bf08 ce06 0800 4500  .$..g.D.......E.
        0x0010:  0028 036b 0000 ff06 d143 c0a8 32da c0a8  .(.k.....C..2...
        0x0020:  32f6 d6c8 075b 0010 647c 1ffa bdfb 5010  2....[..d|....P.
        0x0030:  36b0 715d 0000 0000 0000 0000            6.q]........
17:53:09.470431 IP Kaiterra-SE-200-08CE06.54984 > cleverhub.1883: Flags [P.], seq 1:41, ack 1, win 14000, length 40
        0x0000:  bc24 11ab 6794 44ef bf08 ce06 0800 4500  .$..g.D.......E.
        0x0010:  0050 036c 0000 ff06 d11a c0a8 32da c0a8  .P.l........2...
        0x0020:  32f6 d6c8 075b 0010 647c 1ffa bdfb 5018  2....[..d|....P.
        0x0030:  36b0 94f0 0000 1026 0004 4d51 5454 04c0  6......&..MQTT..
        0x0040:  003c 0016 4b61 6974 6572 7261 2d53 452d  .<..Kaiterra-SE-
        0x0050:  3230 302d 3038 6365 3036 0000 0000       200-08ce06....
17:53:09.470447 IP cleverhub.1883 > Kaiterra-SE-200-08CE06.54984: Flags [.], ack 41, win 64200, length 0
        0x0000:  44ef bf08 ce06 bc24 11ab 6794 0800 4500  D......$..g...E.
        0x0010:  0028 9ebc 4000 4006 b4f2 c0a8 32f6 c0a8  .(..@[email protected]...
        0x0020:  32da 075b d6c8 1ffa bdfb 0010 64a4 5010  2..[........d.P.
        0x0030:  fac8 e73b 0000                           ...;..
17:53:09.470622 IP cleverhub.1883 > Kaiterra-SE-200-08CE06.54984: Flags [F.], seq 1, ack 41, win 64200, length 0
        0x0000:  44ef bf08 ce06 bc24 11ab 6794 0800 4500  D......$..g...E.
        0x0010:  0028 9ebd 4000 4006 b4f1 c0a8 32f6 c0a8  .(..@[email protected]...
        0x0020:  32da 075b d6c8 1ffa bdfb 0010 64a4 5011  2..[........d.P.
        0x0030:  fac8 e73b 0000                           ...;..
17:53:09.472573 IP Kaiterra-SE-200-08CE06.54984 > cleverhub.1883: Flags [.], ack 2, win 13999, length 0
        0x0000:  bc24 11ab 6794 44ef bf08 ce06 0800 4500  .$..g.D.......E.
        0x0010:  0028 036d 0000 ff06 d141 c0a8 32da c0a8  .(.m.....A..2...
        0x0020:  32f6 d6c8 075b 0010 64a4 1ffa bdfc 5010  2....[..d.....P.
        0x0030:  36af 7135 0000 0000 0000 0000            6.q5........

I attached the pcap file here, it can be opened in tcpdump or wireshark (had to add a txt extension)

kaiterra_mini_nanomq.pcap.txt

@JaylinYu
Copy link
Member

Sorry about this, this is a frequently asked question.
NanoMQ has a more strict rules upon user name and password. It doesnt allows null username & password because they are not valid UTF-8 format. and some SDK ignore such restriction.
You can try add random password and username, then the issue shall gone.

@hrbonz
Copy link
Author

hrbonz commented Feb 10, 2025

That's good to know, would it make sense to add this to the nanomq docs? I'm not sure which section it should live in but it could help for first timers. I don't mind sending a PR to nanomq if you point me in the right direction.
I installed mosquitto because I needed something to work for tests but wanted to use nanomq as the bridge behaviour in case of connection loss is better IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants