Closed Vitaliy69 closed 4 years ago
Hi, The GW can run on a RaspberryPi 3B+. So, it's not a problem of ARM64. what kind of client did you use?
Hm, may be problen in Odroid N2? I can provide SSH for debugging if needed.
I send data from https://github.com/eclipse/paho.mqtt-sn.embedded-c/tree/master/MQTTSNPacket library and gei in on Node.red. But it's not a client problem, because Gateway output window is empty.
Could you monitor UDP packets with a Wireshark or any other network monitor ? I'd like to know the Gateway receives packets or not.
Hello! Yes, gateway receives packets fine, but no any reaction.
root@odroid:~# tcpdump udp port 10000 -vv -X -n
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
17:12:36.000531 IP (tos 0x0, ttl 128, id 11019, offset 0, flags [none], proto UDP (17), length 50)
192.168.1.250.52665 > 192.168.1.100.10000: [udp sum ok] UDP, length 22
0x0000: 4500 0032 2b0b 0000 8011 8b01 c0a8 01fa E..2+...........
0x0010: c0a8 0164 cdb9 2710 001e 600d 1604 0401 ...d..'...`.....
0x0020: 000a 4e56 4744 6576 3633 3737 3837 3437 ..NVGDev63778747
0x0030: 3733 73
17:12:37.464435 IP (tos 0x0, ttl 128, id 11020, offset 0, flags [none], proto UDP (17), length 138)
192.168.1.250.52665 > 192.168.1.100.10000: [udp sum ok] UDP, length 110
0x0000: 4500 008a 2b0c 0000 8011 8aa8 c0a8 01fa E...+...........
0x0010: c0a8 0164 cdb9 2710 0076 a733 6e0c 0273 ...d..'..v.3n..s
0x0020: 6400 007b 2249 4422 3a22 3633 3737 3837 d..{"ID":"637787
0x0030: 3437 3733 222c 2254 5322 3a22 3135 3831 4773","TS":"1581
0x0040: 3037 3530 3633 222c 224d 4422 3a22 3022 075063","MD":"0"
0x0050: 2c22 4254 223a 2236 322e 3339 222c 2242 ,"BT":"62.39","B
0x0060: 5222 3a22 3338 3236 3122 2c22 5254 223a R":"38261","RT":
0x0070: 2231 3632 222c 2253 5322 3a22 2d37 3522 "162","SS":"-75"
0x0080: 2c22 4e4d 223a 2232 227d ,"NM":"2"}
Hi, I understand that UDP port 10000 is receiving CONNECT messages starting with 0x001e.
However, I do not know why the GW can not receive it. Could you try again with the latest version of GW ?
Compiled the latest version from develop branch:
git rev-list --count HEAD
216
But the same behavior:
root@odroid:/home/src# ./MQTT-SNGateway
ClientList can not open the Predefined Topic List. NO
***************************************************************************
* MQTT-SN Transparent Gateway
* Part of Project Paho in Eclipse
* (http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt-sn.embedded-c.git/)
*
* Author : Tomoaki YAMAGUCHI
* Version: 1.3.2
***************************************************************************
20200222 185220.305 PahoGateway-01 has been started.
ConfigFile: ./gateway.conf
ClientList: ./clients.conf
PreDefFile: ./predefinedTopic.conf
SensorN/W: UDP Multicast 225.1.1.1:1883 Gateway Port 10000 TTL: 1
Broker: 127.0.0.1 : 1883, 8883
RootCApath: (null)
RootCAfile: (null)
CertKey: (null)
PrivateKey: (null)
MQTT Connect playload: 16 04 04 01 00 0A 4E 56 47 44 65 76 36 33 37 37 38 37 34 37 37 33, it's work fine on desktop PC with Fedora, but nothing on Odroid. (((
Ok. Will you make a debug version for me with the collection of additional logs in a separate git branch? I will attach all the necessary logs. TIA!
I fixed the bug of "ClientList can not open the Predefined Topic List. " I can't solve this issue because I don't have Odroid or I don't know anything about it.
My Rasbian was 32 bit. So, I checked GW with ubuntu 64-bit version and the bug was reproduced.
This is not a problem of Odroid.
The GW can send ADVERTISE message.
And a client can receive ADVERTISE from the GW.
This issue might be a UDP receive problem.
It must be a ARM64 compiler related problem.
Hello! I corrected the bug title description.
I checked the latest version on Odroid N2 (Ubuntu 18.04 x86_64):
git rev-list --count HEAD
218
When I send via console:
echo -n -e "\x016\x004\x004\x001\x000\x00A\x04E\x056\x047\x044\x065\x076\x036\x033\x037\x037\x038\x037\x034\x037\x037\x033" | nc -u 192.168.1.100 10000
I got the error:
20200225 134710.069 UNKNOWN <--- Unknown Client ! 01 36 00 34 00 34 00 31 00 30 00 41 04 45 05 36 04 37 04 34 06 35 07 36 03 36 03 33 03 37 03 37 03 38 03 37 03 34 03 37 03 37 03 33
Error: MQTTSNGWClientRecvTask Client(192.168.1.10:53839) is not connecting. message has been discarded.
But I tested on the real NB IoT device (GPS tracker with data send via MQTT SN on MTS RUS) and seems it works fine (checked CONNECT, CONACK, PUBLISH, SUBSCRIBE, SUBAC):
Suppose bug is fixed. Thank you!
Thank you for your contribution.
I compiled the MQTTSNGateway from the develop branch (7 Feb 2020). It's work fine on Fedora 29, but doesn't work on ARM64 (Odroid N2 with Ubuntu x64).
I used default config file (with change Broker Name to 127.0.0.1, used Mosquitto as broker).
Starting log:
Any ideas how to fix it? Some platform dependent code? Or network interface error?
I use only network messaging (tested with CONNECT and PUBLISH).
Also I have 100% CPU usage with MQTTSNGateway on Ondroid N2.