Hello,
I have this device TK428 from topten and i used port 5009. The manufacturer said they used the same protocol as TK228 but when checked on the server logs, i have this
2023-11-16 01:01:56 INFO: [T5e122eff: meiligao < 172.56.177.241] 2424006d6973105131347699553031303230302c562c333235302e373938362c4e2c31313533342e313735352c572c302e302c302e302c3136313132332c2c2c417c302e307c302e307c303230317c303030302c303237387c3030303030303030307c3030303030301b4c0d0a
2023-11-16 01:01:56 INFO: [T5e122eff] id: 6973134545443, time: 2023-11-16 01:02:00, lat: 32.84652, lon: -115.56953, course: 0.0
I have tried their platform and there, the OBD2 data are read by their platform, maybe there are some commands that is needed to be sent to the device such that it will respond with OBD2 data?
I checked on the source code for sending the command and I can't see the TK428?
private ByteBuf encodeOutputCommand(long deviceId, int index, int value) {
int outputCount;
int outputType;
String model = getCacheManager().getObject(Device.class, deviceId).getModel();
if (model != null && Set.of("TK510", "GT08", "TK208", "TK228", "MT05").contains(model)) {
outputCount = 5;
outputType = MeiligaoProtocolDecoder.MSG_OUTPUT_CONTROL_1;
} else {
outputCount = 1;
boolean alternative = AttributeUtil.lookup(
getCacheManager(), Keys.PROTOCOL_ALTERNATIVE.withPrefix(getProtocolName()), deviceId);
outputType = alternative
? MeiligaoProtocolDecoder.MSG_OUTPUT_CONTROL_1
: MeiligaoProtocolDecoder.MSG_OUTPUT_CONTROL_2;
}
ByteBuf content = Unpooled.buffer();
for (int i = 1; i <= outputCount; i++) {
content.writeByte(i == index ? value : 2);
}
return encodeContent(deviceId, outputType, content);
}
You have to check the protocol documentation.
Please don't duplicate your posts next time.
Hello,
I have this device TK428 from topten and i used port 5009. The manufacturer said they used the same protocol as TK228 but when checked on the server logs, i have this
I have tried their platform and there, the OBD2 data are read by their platform, maybe there are some commands that is needed to be sent to the device such that it will respond with OBD2 data?
I checked on the source code for sending the command and I can't see the TK428?
private ByteBuf encodeOutputCommand(long deviceId, int index, int value) { int outputCount; int outputType; String model = getCacheManager().getObject(Device.class, deviceId).getModel(); if (model != null && Set.of("TK510", "GT08", "TK208", "TK228", "MT05").contains(model)) { outputCount = 5; outputType = MeiligaoProtocolDecoder.MSG_OUTPUT_CONTROL_1; } else { outputCount = 1; boolean alternative = AttributeUtil.lookup( getCacheManager(), Keys.PROTOCOL_ALTERNATIVE.withPrefix(getProtocolName()), deviceId); outputType = alternative ? MeiligaoProtocolDecoder.MSG_OUTPUT_CONTROL_1 : MeiligaoProtocolDecoder.MSG_OUTPUT_CONTROL_2; } ByteBuf content = Unpooled.buffer(); for (int i = 1; i <= outputCount; i++) { content.writeByte(i == index ? value : 2); } return encodeContent(deviceId, outputType, content); }