Devices with protocol tk103 - sending commands to the device via TCP/IP

Michael2 years ago

Hi.

Is it possible to send commands to devices using the tk103 protocol via TCP/IP and not SMS?

Thanks,
Michael

Anton Tananaev2 years ago

Yes.

Michael2 years ago

Is there a troubleshooting "how-to" for sending commands via TCP/IP?
What requirements need to be met for sending commands?

I am trying the send command "GetDeviceStatus" and "DeviceIdentification" for testing to a tk103 device, but commands are not sent.
Device is connected and sending GPS position

2023-01-04 09:41:47  INFO: [T3c3c5c16] id: xxx, time: 2023-01-03 13:56:13, lat: xx.xxx, lon: x.xxxxx, speed: 0.4, course: 0.0
2023-01-04 09:44:31  INFO: [T3c3c5c16] id: xxx, command type: deviceIdentification not sent
2023-01-04 09:45:30  INFO: [T3c3c5c16] id: xxx, command type: getDeviceStatus not sent
2023-01-04 09:45:42  INFO: [T3c3c5c16] id: xxx, command type: deviceIdentification not sent
Anton Tananaev2 years ago

You can only send commands that are supported. Are you using the web app or the API? The web app will tell you which ones are supported.

Michael2 years ago

Using web app and I selected a suggested one

Anton Tananaev2 years ago

Can you provide a full log fragment?

Michael2 years ago

Is this helpful?

2023-01-05 14:16:31  INFO: Operating system name: Windows 10 version: 10.0 architecture: amd64
2023-01-05 14:16:31  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Eclipse Adoptium version: 17.0.4+8
2023-01-05 14:16:31  INFO: Memory limit heap: 2048mb non-heap: 0mb
2023-01-05 14:16:31  INFO: Character encoding: Cp1252 charset: windows-1252
2023-01-05 14:16:31  INFO: Version: 5.5
2023-01-05 14:16:31  INFO: Starting server...
2023-01-05 14:16:31  INFO: HikariPool-1 - Starting...
2023-01-05 14:16:32  INFO: HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@2c232796
2023-01-05 14:16:32  INFO: HikariPool-1 - Start completed.
2023-01-05 14:16:32  INFO: Clearing database change log checksums
2023-01-05 14:16:33  INFO: Successfully acquired change log lock
2023-01-05 14:16:33  INFO: Successfully released change log lock
2023-01-05 14:16:33  INFO: Successfully acquired change log lock
2023-01-05 14:16:35  INFO: Reading from TRACCAR.DATABASECHANGELOG
2023-01-05 14:16:36  INFO: Reading from TRACCAR.DATABASECHANGELOG
2023-01-05 14:16:36  INFO: Successfully released change log lock
2023-01-05 14:16:36  INFO: Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
2023-01-05 14:16:38  WARN: Port disabled due to conflict - Address already in use: bind - BindException (...)
2023-01-05 14:16:38  INFO: jetty-10.0.12; built: 2022-09-14T01:54:40.076Z; git: 408d0139887e27a57b54ed52e2d92a36731a7e88; jvm 17.0.4+8
2023-01-05 14:16:38  INFO: Started o.t.w.@747a40e5{/,null,AVAILABLE}
2023-01-05 14:16:38  INFO: Session workerName=node0
2023-01-05 14:16:39  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2023-01-05 14:16:40  INFO: Started o.e.j.s.ServletContextHandler@2ee3a6c8{/,null,AVAILABLE}
2023-01-05 14:16:40  INFO: Started ServerConnector@3c386c2a{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2023-01-05 14:16:40  INFO: Started Server@6768318e{STARTING}[10.0.12,sto=0] @12390ms
2023-01-05 14:16:43  INFO: [T03259ebc] connected
2023-01-05 14:16:52  INFO: [T03259ebc] disconnected
2023-01-05 14:17:29  INFO: [T8102b601] connected
2023-01-05 14:17:30  INFO: [T8102b601: tk103 < w.x.y.z] xxx
2023-01-05 14:17:33  INFO: [T8102b601] id: 0xxxxxxxxxxx, time: 2023-01-05 13:26:13, lat: 5x.xxxxx, lon: 9.xxxxx, speed: 0.9, course: 0.0
2023-01-05 14:17:33  INFO: [T8102b601: tk103 < w.x.y.z] xxx
2023-01-05 14:17:33  INFO: [T8102b601: tk103 > w.x.y.z] xxx
2023-01-05 14:18:42  INFO: user: 2, action: login, from: w.x.y.z
2023-01-05 14:19:04  INFO: [T8102b601] id: 0xxxxxxxxxxx, command type: getDeviceStatus not sent
2023-01-05 14:21:16  INFO: [T8102b601: tk103 < w.x.y.z] xxx
2023-01-05 14:21:16  INFO: [T8102b601] id: 0xxxxxxxxxxx, time: 2023-01-05 14:21:13, lat: 5x, lon: 9.x, speed: 1.2, course: 0.0
2023-01-05 14:22:30  INFO: [T8102b601: tk103 < w.x.y.z] xxx
2023-01-05 14:22:30  INFO: [T8102b601: tk103 > w.x.y.z] xxx
2023-01-05 14:24:53  INFO: [T8102b601] id: 0xxxxxxxxxxx, command type: getVersion sent
2023-01-05 14:24:53  INFO: [T8102b601: tk103 > w.x.y.z] xxx
2023-01-05 14:24:55  INFO: [T8102b601: tk103 < w.x.y.z] xxx
2023-01-05 14:26:02  INFO: [T8102b601] id: 0xxxxxxxxxxx, command type: powerOff not sent
Anton Tananaev2 years ago

Looks like some of the commands are only available for the alternative variation of the protocol when you have tk103.alternative enabled in the config.

Michael2 years ago

I added now <entry key='tk103.alternative'>true</entry>

Commands are sent now, but nothing happens

2023-01-10 12:02:33  INFO: [Ta51069dc] id: 0xxxxxxxxxxx, command type: deviceIdentification sent
2023-01-10 12:02:33  INFO: [Ta51069dc: tk103 > w.x.y.z] 5b626567696e5d736d73322c3939393939392c5b656e645d
2023-01-10 12:02:39  INFO: [Ta51069dc] id: 0xxxxxxxxxxx, command type: powerOff sent
2023-01-10 12:02:39  INFO: [Ta51069dc: tk103 > w.x.y.z] 5b626567696e5d736d73322c2a7475726e6f66662a2c5b656e645d

Maybe this chinese GPS clone does not support these commands?

Anton Tananaev2 years ago

It's possible that the format is different or maybe those commands are not available at all.