Parsing "watch" protocol AMR sound file

Anton Tananaev8 years ago

I need to see documentation for the protocol.

Bob Giles8 years ago

dimonb, did you resolve the issue? I have the same problem - listen only scratches

pzuk7 years ago

I have the same problem ( hear scratches only ). Have you guys found the solution maybe?

dimonb7 years ago

Yes, I found a solution. File is "encoded" with something like this:

m = [
 ('7d01', '7d'),
 ('7d02', '5b'),
 ('7d03', '5d'),
 ('7d04', '2c'),
 ('7d05', '2a')]
for k, v in reversed(m):
    dd = dd.replace(k.decode('hex'), v.decode('hex'))

One week of brainstorm and we are there ;)

pzuk7 years ago

man, you are awesome! I owe you.

davina jony7 years ago

hi all,
well, actually, I have a different opinion, AMR cannot be read by some popular media players like Windows Media Player and QuickTime Player. So why not convert it to MP3 or WAV, more popular audio formats? I remembered that I saw a tutorial about AMR:http://www.videoconverterfactory.com/tips/amr-to-mp3.html I think it tells pretty useful....

Percy7 years ago

@dimonb,

I configured nginx to pass all traffic to their server and dump traffic from watches.

I want to be able to do what you did, to listen to the SeTracker server and watch traffic, if you could share your setup. I believe the protocol has evolved a bit.

On a device I have the reporting interval command is accepted by the device, but not followed. I set the reporting interval to 60 seconds, but even though the command is accepted by the device, it is not followed. The "link keep" is set to 5 minutes and that is used as the reporting interval, and there is no command to set the link keep timeout. Need to see this traffic to see if there is any undocumented command used.

Michael6 years ago

@dimonb can I write you? I can't do this AMR shit working... And you seems to be able to...

I create an experiment with PHP; I record AMR with an Android App and then my PHP server send the AMR through Traccar api.
The device receive a new message but no audio is reproduced.

I tried also to record an audio by device and resend it to the device. The device received the audio message but no audio is played.

dimonb6 years ago

Here is source of my telegram bot https://github.com/dimonb/gpswatch which done passing audio from and to watches.

Michael6 years ago

Thanks @dimonb I'm trying to understand your code but it's hard :)

I detected that my problem is when sending the binary data through JSON Traccar Webapi as custom command.
I'm trying to understand how to send binary data to the device.

Michael6 years ago

I shared an updated Watch protocol here: https://www.dropbox.com/s/3kqztvn5jcq0e8z/Setracker%20GPS%20tracker%20watch%20GPRS%20communication%20protocol.pdf?dl=0

This protocol define the TK command that require binary data to be sent, but the JSON API can't send these data.

Hi, for anyone interested, it's been refactored, fixed and is merged to master now.

pzuk6 years ago

@Michael

Your document is really good. Did you face with binary encoded watch protocol? Some devices like Garett kids 2 (Smartwatch Q90) send buffers like: [SOME BINARY DATA].
hex: ff41515348002b01000000d5c4130e82e684d85943ca35631aed4ce55318c271fe8ca49a2c4549d10e091f5c88cf84f0

Can you send a whole message as hex? Especially the beginning of it. This alone doesn't look like watch protocol

Alex Dan6 years ago

I have the same output from the Q90... still can't figure it out

This is how it looks like in the log, regardless of the port I use:

2019-06-23 17:27:53  INFO: [9c232aea: gt06 < 213.226.141.11] HEX: ff41515348002b0100000050c8d3fbb152075e0319fd8bbdabfb8b7606b51855478b3440242890e4a3ca3a5d0fa889b6

And decoded message looks like this

... binary data ...

There are several unanswered queries like this on the web...