Watch protocol data not getting processed

skyking5 years ago

I went into WatchProtocolDecoder.java and in:

    private static final Pattern PATTERN_POSITION = new PatternBuilder()
            .expression("(.*)")                  // comm type
            .number("(dd)(dd)(dd),")             // date (ddmmyy)

I added the .expression() to get the comm type (first data element and data element before date in comma delimited string) but mavin didn't like that. It is UC_WCDMA above but could be a different expression depending on if there is a good GPRS signal. Isn't that throwing off the position of data it gets from the string without accounting for it?

mavin threw a test error:

testDecode(org.traccar.protocol.WatchProtocolDecoderTest): For input string: "A"

..so obviously I'm a java noob

skyking5 years ago

Was missing comma in .expression("(.*)") changed to .expression("(.*),")

But mavin still not happy:

Failed tests:   testDecode(org.traccar.protocol.WatchProtocolDecoderTest): position is null
skyking5 years ago

Never mind, I see farther down in code you are testing for UD (or AL) in that position.

SO back to still not getting data string into server database or server display (obviously from database)

skyking5 years ago

Anton, let me know if there is anything I can do to help resolve this issue. It frustrates me that I don't know enough java to be able to look at the code and see something that is causing the problem. I can follow the basics of the code in the file but get lost in the details. I spent an hour going through the code and am just as lost now as I was when I started although I understand the basics of processing (parsing) the incoming data, just not how each piece is analyzed and processed.

Xtreme003 years ago

Hello to all.

@skyking, did you solve the problem?

My TKSTAR TK-905 uses watch protocol and I have the same issue.

If I do a tcpdump in the port that uses traccar in my server, I can see this after decode the HEX:

[SG*9053579651*00AD*UD,230322,093135,A,40.133786,N,3.670640,W,0.0000,000,0,12,30,100,0,50,00000000,6,1,214,7,2841,1161,121,2841,4231,120,2841,6033,120,2841,6323,120,2841,4232,118,4561,2803,118,,00]

The device is added in the web interface with its unique ID 9053579651 but I am unable to see any status or location updates.

I have done a lot of research with no luck, any ideas?

Thank you.

Xtreme003 years ago

Ok, nevermind.

I was putting the port of the web interface in the SMS configuration.

The port has to be the specific device port, in this case, 5093.

So...

adminip123456 MYTRACCARSERVERIP 5093

Did the trick.

Thank you anyways.