Integration of Shenzhen Concox Information Technology Tracker GT06 - integration

I am using OpenGTS for some time for my organization. I was using TK103 family tracker but now my company changed tracker and brought GT06 made by Shenzhen Concox Information Technology Co. Ltd. This tracker protocol is entirely different and I am unable to create its server. Can anyone help me for this tracker integration or let me know which already integrated tracker is somehow similar to this one. Just give me a tip and I will manage rest. I am copying some protocol for your reference.
5.1.3. Examples
Examples of the login message packet sent by the terminal to the server and the response packet sent by the server to the terminal are as follows: (in the examples the terminal ID is 123456789012345.
Example of data packet sent by the terminal 78 780 0D 01 01 23 45 67 89 01 23 45 00 01 8C DD 0D 0A
Example of response packet returned by the server
78 78 05 01 00 01 D9 DC 0D 0A
Shenzhen Concox Information Technology Co.,Ltd www.cothinking.net/
Copyright Reserved.
5.2. Location Data Packet (combined information package of GPS and LBS)
5.2.1. Terminal Sending Location Data Packet to Server
Format Length(Byte) Example
Start Bit 2 0x78 0x78
Packet Length 1 0x1F
Protocol Number 1 0x12
Date Time 6 0x0B 0x08 0x1D 0x11 0x2E 0x10
Quantity of
GPS
information
satellites
1 0xCF
Latitude 4 0x02 0x7A 0xC7 0xEB
Longitude 4 0x0C 0x46 0x58 0x49
Speed 1 0x00
GPS
Information
Course,
Status
2 0x14 0x8F
MCC 2 0x01 0xCC
MNC 1 0x00
LAC 2 0x28 0x7D
LBS
Information
Cell ID 3 0x00 0x1F 0xB8
Serial Number 2 0x00 0x03
Error Check 2 0x80 0x81
Information
Content
Stop Bit 2 0x0D 0x0A

You can use Traccar server to track GT06 devices. It can be used as stand alone tracking system or if you prefer OpenGTS you can easily integrate two systems (use OpenGTS web interface and Traccar for device communication). Configuration file for integrating Traccar and OpenGTS can be found here.

the GT06 protocol is different from the tk103.
the 4th byte (0x01) indicates a login protocol call for tracker with IMEI 01 23 45 67 89 01 23 45 (remove first zero).
it should be answered and the socket kept open. you will receiva a 0x13 or 0x12 message (probably).
a 0x12 message has GPS location data.
i expect that you are not doing this blindfolded. if needed, refer to coding protocol manual. please note that some discrepancies may appear between concox and robustel units, even though both are variants of the original GreenTel GT06.

Related

Reading OBD2 DTC codes procedure

I am trying to read dtc codes using following procedure:
1 - send 0101 which means get the number of the dtc codes
receive - 41 01 82 07 61 01 which means I have 2 trouble codes
2 - send 0x03 to receive codes and
receive - 43 01 33 03 01 00 00 which are the 2 codes : P0133 and P0301
Using a diagnostic service tester I get 5 codes on the same car: P0133, P0301 (the ones I get also) and P0303, P0300 and C1513
How can I see the other 3 codes using my OBD?
Here are pictures with the tester:
You might have multiple OBD2-conform ECUs in your car. To access these, use broadcast addressing or query each and every one separately by adjusting your arbitration ids.
That said, some readers may also show pending (0x07) or permanent (0x0A) DTCs.

Reverse engineer of APC UPS serial protocol

I have a APC SMC1000-2UC UPS device that has a serial port to connection. The serial port protocol seems that is based on microlink protocol which has not documented. I monitored the communication of the UPC and PC witch UPS deriver has been initialed. I want to detect command of UPS such as shutdown command by a microcontroller-based device. Some information of "https://sites.google.com/site/klaasdc/apc-smartups-decode" site is compatible with things I observed. but calculation of frame checksum and Challenge string calculation don't pass.
Data length of protocol has been set to 32 bytes, So each frame has 35 bytes.
[Msg ID | 32 byte data | 2 byte checksum]
Regarding calculation of challenge frame, the UPS send 0x65 frame ID then 0x68 frame ID, after that the PC response with 0x65 frame ID and UPS send confirmed frame by 0x65 frame ID. based on presented calculation, I think format or Position of Password_1, Header data and two bytes of that has been changed as the protocol has been configured to 32 bytes data. The following frame are a sample of this challenge:
Header frame: 0x00 0a206903fa27090001004000f802fe04fe0940fc1042fc1044fc20f80416fc10 32a6
UPS : 0x65 ffff00010000a0e80000 c0bbb4e1 000001040000001000000004000000000020 7350
UPS : 0x68 000000000000000000000008004c2943000000000966039a063b675601f30000 864f
PC : 0x65 0a 04 8afb65f1 bdf0
UPS : 0x65 ffff000100000eaf62d8 8afb65f1 000001040000001000000004000000000020 6227
How can I satisfy the challenge and checksum type? I try many type of checksum for that data but they not correct.
It may be a bit late, but have you looked at this:
https://github.com/klaasdc/apcups-serial-test
This looks like somebody got pretty far reverse engineering the MicroLink protocol, including the checksum part. The GitHub repo also contains a link to a web page with a protocol description.

How to get OBD2 Fuel Level reading from Wagon R 2010 model

I want to measure current fuel level inside my car's fuel tank using OBD2 bluetooth/USB adapter.
When i try to query that PID i got following data as "NO DATA" while at the same time i can check other PIDS like RPM and all data comes fine.
I have small python program which reads its but i am unable to get it.
import serial
#ser = serial.Serial('COM12',38400,timeout=1)
#ser.write("01 2F \r")
#speed_hex = ser.readline().split(' ')
#print speed_hex
#convert hex to decprint ("SpeedHex",speed_hex)
#speed = float(int('0x'+speed_hex[3],0))
#print ('Speed',speed,'Km/h')
ser1 = serial.Serial("COM12",38400,timeout=1)
#ser1.write("ATZ \r")
#ser1.write("ATE0 \r")
#ser1.write("ATL0 \r")
#ser1.write("ATH1 \r")
#ser1.write("ATSP 5 \r")
ser1.write("01 0C \r")
fuel_hex= ser1.readline()
print fuel_hex
#convert to hex to decprint ("FuelHex",fuel_hex)
#fuel = float(int('0x'+fuel_hex[3],0))
#print ("Fuel in Per",fuel)
Can any one suggest here how to get fuel level which is their inside in car at this current time. As i can see in my panel with bar sign.
In order to get all the available PIDs in a vehicle, you have to request the following PIDs at first exactly like you ask the rpm of the vehicle:
0x00, 0x20, 0x40, ....0x80 and so on.
For instance when you request PID 0x00 the ECU will return you 4 bytes which means if it supports PIDs from 0x01 - 0x20. Each byte has 8 bits in total of 32 bits which is exactly from PID 0x01 to PID 0x20. Now it is time to parse the data. If each bit is 1 it means the ECU will support and 0 no support. It is your duty to do some bitwise operations to translate these bits:
Also you can look out this Wikipedia link which shows in graphics!
byte 1 bit 1 : availability of PID 0x01
byte 1 bit 2 : availability of PID 0x02
byte 1 bit 3 : availability of PID ox03
....
byte 4 bit 7 : availability of PID 0x1F
byte 4 bit 8 : availability of PID 0x20 --> Here the ECU tells you if support any PIDs in next 32 PIDs. If it is 0, you do not need to check anymore!
After parsing and gathering all the supported PIDs, then you can have a roadmap to calculate or check each PIDs you want. Do not forget many of conversion rates a formulas in wikipedia is wrong due to the complexity of calculations. You have to read the ISO 15031 part 5 and do NOT forget ECU only gives you the emissions-related diagnostics and not all the data.

H.264 payload with no '0x00 0x00 0x00 0x01 0x65'

I'm trying to detect I-frames in TS by searching for the:
0x00 0x00 0x00 0x01 0x65
But, it doesn't work on some streams. In some streams this sequence occurs very rare. Is there any other way of detecting I-frames?
Edit:
I also tried saving TS to a file and then extracting H.264 payload. The extracted payload contains only a few 0x00 0x00 0x00 0x01 0x65 byte sequences.
What you are trying to do looks like a blind guess. H.264 specification is freely available. 00 00 00 01 is described in Annex B "Byte stream format" section. Then your 65 is what maps to section 7.3.1 "NAL unit syntax":
So you can split your byte stream into NAL units correctly and identify why your heuristic is not detecting I-Frames. Specifically, you are assuming two bit value to be equal to three exactly.
Also, slice types are defined as this:
See also:
Possible Locations for Sequence/Picture Parameter Set(s) for H.264 Stream
How to detect I/P/B frame from H264 RTP packet

Is it possible to program in binary?

Is it possible to program in binary?
A friend of mine told me he knows someone who can program in binary. I've never heard of someone programming in binary and a few quick Google searches didn't return anything useful. So I figured I'd turn to the SO community. Does anyone have any info on programming in binary and if possible maybe a quick Hello World example.
Of course. It's more commonly called machine code. It's basically assembly language without the mnemonic devices. Someone who knows assembly very well could program in machine code with additional effort, referring to opcode listings (e.g. x86) as needed.
Would I do it? No. Even assembly is only useful in rare circumstances, and there's no reason (beside demonstrating your skills) to reject the assembler's help.
Since you asked about hello world, you should check out this article. He shows how he wrote, then optimized, an x86 ELF program to output it. It was originally written in nasm then modified in a hex editor.
It's very much possible to memorize machine code equivalent of assembly instructions. Actually, when writing code in assembly language, one often happens to see hex code through machine code monitors, disassemblers, assembly listings, etc. As a result, over time some instructions can be memorized in their hex form without any extra effort.
In the picture an 6502 ROM monitor is seen, where hex code and assembly mnemonics are shown side by side.
Second skill you're going to need is to transform hex code into binary which is quite easy with a trick I'll explain in a bit.
Think of the following instructions:
OPCODE HEX
LDA #imm 0xA9 imm
STA adr 0x85 adr
STA (adr),Y 0x91 adr
LDY #imm 0xA0 imm
With above opcodes memorized only, we can write the following machine code using only pen and paper:
0xA9 0x00
0x85 0x01
0xA9 0x02
0x85 0x02
0xA0 0x00
0xA9 0x01
0x91 0x01
Actually the above is the following assembly code in mnemonic form:
LDA #00
STA $01
LDA #02
STA $02
LDY #00
LDA #01
STA ($01), Y
The above code puts a white pixel at the top-left corner of screen in 6502asm.com assembler/emulator, go ahead and try it out!
Now the trick for converting hexadecimals into binary and vice versa is to work it out only for nibbles (4-bit values).
First, remember how to convert binary into decimal. Every time you see 1, multiply that by its binary power. E.g. 101 would be 4 + 0 + 1 = 5. It can be visualized like this:
1 1 1 1 --> binary points
| | | |
v v v v
8 + 4 + 2 + 1
| | | +---> 2^0 * 1 Ex: 13 is 8 + 4 + 0 + 1
| | +-------> 2^1 * 1 1 1 0 1 -> 1101 (0xD)
| +-----------> 2^2 * 1 Ex: 7 is 0 + 4 + 2 + 1
+---------------> 2^3 * 1 0 1 1 1 -> 0111 (0x7)
With this in mind, and well practiced, the following should be possible:
LDA #00 -> 0xA9 0x00 -> 1010 1001 0000 0000
STA $01 -> 0x85 0x01 -> 1000 0101 0000 0001
LDA #02 -> 0xA9 0x02 -> 1010 1001 0000 0010
STA $02 -> 0x85 0x02 -> 1000 0101 0000 0010
LDY #00 -> 0xA0 0x00 -> 1010 0000 0000 0000
LDA #01 -> 0xA9 0x01 -> 1010 1001 0000 0001
STA ($01),Y -> 0x91 0x01 -> 1001 0001 0000 0001
With some retro computing spirit, motivation and fun, we could actually have written the entire code in binary without writing down the intermediate steps.
On a related note, Paul Allen coded a boot loader for Altair 8800 with pen and paper on an airplane, and possibly had to translate it to binary also with pen and paper: https://www.youtube.com/watch?v=2wEyqJnhec8
There isn't much call for it any more, but it has been done. There was a time when code could be entered into a system in binary from the front console. It was error prone.
I used to have a very short uudecoe program encoded in ASCII which could be prefixed to a UUEncoded file. The resulting file would be self-extracting and could be emailed around. I would expect the machine code was hand done. I can't find it, and don't have a use for it even if I could.
Well of course you can write the binary for the machine code and then enter the machine code via your hex key pad into your computer. I have put together a computer based on the TMS1100.
A simple program to display 5 on the hex LED would be 0001000 0000101 0000001 written in binary converted to machine code that would be 8 5 1 . This program would then run and display 5 on the LED.
You could follow this procedure for far more complex programs using the TMS1100 and I guess programming in binary.
Actually, I think this is very satisfying and rewarding if you are interested in mathematics and programming.
For the brave of heart: you can try getting a MikeOS floppy image and running the monitor.bin program. It allows you to enter hexadecimal opcodes by hand and execute them. For example (as stated on the docs), entering the following instructions:
BE0790 E8FD6F C3 4D00$ will produce a single M on the screen.
There are some esoteric programming languages. They are used as experiments, and are rather impractical, but one, called BrainF**k (yes, it is actually a real thing) uses eight different characters to modify byte values. Those kind of languages are about as close as you can get.