How to know which port to use?

imhugo9 years ago

Hello!

I did install Traccar on my CentOS 6.6 64bits today, but my TK102C device is not saving nothing on mysql database.
I guess all ok with installation, because I was able to send data to database, after execute the command via ssh (suggestion obtained on https://github.com/tananaev/traccar/blob/master/tools/hex.sh ):

echo 3e52505631393535352b343533383431382d303733393531383530303032303231323b49443d393939393b2a37423c0d0a | perl -ne 's/([0-9a-f]{2})/print chr hex $1/gie' > /dev/udp/localhost/5057

Below, I put some output log from traccar:

2015-04-23 12:37:40 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78780a13c00064000100089f530d0a
2015-04-23 12:37:46 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78780d0103554883399118210009f3950d0a
2015-04-23 12:38:09 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78781f120f04170c2608c7023a522c055549460038df02d4030c2d00691f0009115c0d0a
2015-04-23 12:38:39 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78781f120f04170c2626c6023a522c055549460038df02d4030c2d00691f000a78320d0a
2015-04-23 12:39:09 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78781f120f04170c2708c6023a522c055549460038df02d4030c2d00691f000bc0570d0a
2015-04-23 12:39:39 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78781f120f04170c2726c6023a522c055549460038df02d4030c2d00691f000c46400d0a
2015-04-23 12:40:09 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78781f120f04170c2808c6023a522c055549460038df02d4030c2d00691f000de7ae0d0a
2015-04-23 12:40:10 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78780a13c000640001000efa650d0a
2015-04-23 12:40:16 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78780d010355488339911821000f96a30d0a
2015-04-23 12:40:39 DEBUG: [F0A2C41F: 5006 <- 177.28.88.156] - HEX: 78781f120f04170c2826c6023a522c055549460038df02d4030c2d00691f000f36140d0a

I also added my device using IMEI 355488339911821

Any suggestion?

Thanks in advance.

Hugo

Anton Tananaev9 years ago

It is GT06 protocol, so you should use port 5023 for your device.

imhugo9 years ago

WOW!!!! It worked like a charm! Thank you very very much...
Nice job Anton. I really appreciated your job
best regards!
Hugo

gabrielcz9 years ago

take a look at: https://www.traccar.org/devices/
It says devices and ports, and also says if it supported, or not...

halshehri6 years ago

Hello,

May you explain how did you figure out the port? I had the same problem and this port worked for me. I tried the Hex decoder and all what I got was garbage. see below:

78780d010352887076539901002176580d0a
78780a134405040000002217880d0a
78781f12110b110e1427c502a9ec700500c3a201140001a40100360071a10023f3130d0a
78781f12110b110e141dc502a9ec6a0500c37000140001a40100360071a10020c33e0d0a
78781f12110b110e1431c502a9ec5e0500c39a01140001a40100360071a10024f30a0d0a
78781f12110b110e143bc502a9ec7c0500c38701140001a40100360071a100253f3b0d0a
78781f12110b110e1509c502a9ec4f0500c34900140001a40100360071a1002612f40d0a
78780a134405040000002740250d0a
78781f12110b110e1513c502a9ec220500c2fe01140001a40100360071a1002841ac0d0a
78781f12110b110e151dc502a9ebef0500c2c201140001a40100360071a100292fd50d0a
78781f12110b110e1527c502a9ebbc0500c27901140001a40100360071a1002aa8ab0d0a

here the hex

[removed unnecessary binary data]

Anton Tananaev6 years ago

Port for your device is 5023.

halshehri6 years ago

Thank you Anton,

Yes, as I said it worked for me. My question How can I know from the data itself?

Anton Tananaev6 years ago

I know because it starts with 7878.