Device Protocol (High School Student project)

Capper5 years ago

My High School students have designed have a droid based device that uses an onboard service to send relevant GPS information using a software that has been coded independently by another group that we no longer have contact with. We are now trying to build a back-end server (hence Traccar - thank you for letting me use it to educate!!)

We tried utilizing the Osmand (5055) port to check, it gets heartbeat, but the log shows the following Hex/decoded snippets. Can someone help me point my team in the right direction, our end coding skills are average-good, but building a protocol from scratch might be too much time for them with this project. Any guidance or help would be greatly appreciated!

Best
Oz

Hex:

2019-02-12 01:00:45  INFO: [0323dda6] connected
2019-02-12 01:00:45  INFO: [0323dda6: 5055 < 176.83.139.161] HEX: 474554202f3f69643d3335393333393037353830303030312674696d657374616d703d31353439393239373235266c61743d32302e3837343637266c6f6e3d2d3135362e343732312673706565643d342662656172696e673d313135267361743d3626616c7469747564653d36266c61633d3530393936266d63633d333130266d6e633d3431302663656c6c69643d353932363731393226616c61726d3d3026626174743d31303020485454502f312e310d0a486f73743a203230372e3234362e3130302e3232313a353035350d0a0d0a
2019-02-12 01:00:45  INFO: [0323dda6: 5055 > 176.83.139.161] HEX: 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2019-02-12 01:00:45  WARN: Geocoding failed - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure - ProcessingException (...)
2019-02-12 01:00:45  WARN: [0323dda6] error - class java.lang.Double cannot be cast to class java.lang.String (java.lang.Double and java.lang.String are in module java.base of loader 'bootstrap') - ClassCastException (AlertEventHandler:49 < BaseEventHandler:27 < BaseDataHandler:27 < ...)
2019-02-12 01:00:45  INFO: [0323dda6] disconnected

Which decoded is correct:

GET /?id=359339075800001&timestamp=1549929725&lat=20.87467&lon=-156.4721&speed=4&bearing=115&sat=6&altitude=6&lac=50996&mcc=310&mnc=410&cellid=59267192&alarm=0&batt=100 HTTP/1.1
Host: 207.246.100.221:5055
Anton Tananaev5 years ago

Disable geocoding and remove alarm.

Capper5 years ago

Anton,
Thanks for the quick advice, my students followed you advice and disabled the geocode, although we can't remove the alarm as that is sent by app that we don't have source for (and it already undertakes other processes for our overall project that we can't unfortunately change the app). The log is much cleaner now. We can actually see the osmand protocol doesn't quite work, but appears to be close - looks like a single datatype issue. New logs/decode are posted below. I can set the project of having them dig and find the error, but wondering if you had any additional direction I can give them (they have about 5 weeks to finalize the device and give a complete write up with any code they use, but of course this is not a full time job for them , it's one class :) )

Thanks again for the awesome quick response yesterday.

Oz

2019-02-12 18:02:58  INFO: [6ff676eb] connected
2019-02-12 18:02:59  INFO: [6ff676eb: 5055 < 176.83.139.4] HEX: 474554202f3f69643d3335393333393037353830303030312674696d657374616d703d31353439393934353538266c61743d32302e3837343537266c6f6e3d2d3135362e343732362673706565643d352662656172696e673d323531267361743d3626616c7469747564653d3432266c61633d3530393936266d63633d333130266d6e633d3431302663656c6c69643d353932363731383626616c61726d3d3026626174743d3620485454502f312e310d0a486f73743a203230372e3234362e3130302e3232313a353035350d0a0d0a
2019-02-12 18:02:59  INFO: [6ff676eb: 5055 > 176.83.139.4] HEX: 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2019-02-12 18:02:59  WARN: [6ff676eb] error - class java.lang.Double cannot be cast to class java.lang.String (java.lang.Double and java.lang.String are in module java.base of loader 'bootstrap') - ClassCastException (AlertEventHandler:49 < BaseEventHandler:27 < BaseDataHandler:27 < ...)
2019-02-12 18:02:59  INFO: [6ff676eb] disconnected
2019-02-12 18:03:08  INFO: [a3eca21c] connected
2019-02-12 18:03:08  INFO: [a3eca21c: 5055 < 176.83.139.4] HEX: 474554202f3f69643d3335393333393037353830303030312674696d657374616d703d31353439393934353438266c61743d32302e3837343536266c6f6e3d2d3135362e343732342673706565643d31302662656172696e673d323139267361743d3626616c7469747564653d3432266c61633d3530393936266d63633d333130266d6e633d3431302663656c6c69643d353932363731383626616c61726d3d3026626174743d3520485454502f312e310d0a486f73743a203230372e3234362e3130302e3232313a353035350d0a0d0a
2019-02-12 18:03:08  INFO: [a3eca21c: 5055 > 176.83.139.4] HEX: 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2019-02-12 18:03:08  WARN: [a3eca21c] error - class java.lang.Double cannot be cast to class java.lang.String (java.lang.Double and java.lang.String are in module java.base of loader 'bootstrap') - ClassCastException (AlertEventHandler:49 < BaseEventHandler:27 < BaseDataHandler:27 < ...)
2019-02-12 18:03:08  INFO: [a3eca21c] disconnected

Decoded (first line)

GET /?id=359339075800001×tamp=1549994558&lat=20.87457&lon=-156.4726&speed=5&bearing=251&sat=6&altitude=42&lac=50996&mcc=310&mnc=410&cellid=59267186&alarm=0&batt=6 HTTP/1.1
Host: 207.246.100.221:5055
Anton Tananaev5 years ago

You can clearly see that they have not followed it:

... alarm=0 ...
Capper5 years ago

I know, that part they can't remove as it is sent by the app and we don't have the source code. The data is sent even if the alarm is turned off and they don't have the source code for the app used. Is that the item that's causing the difficulty? Would be a shame if that is all it is to be able to use a predefined decode protocol.

Anton Tananaev5 years ago

Are you seriously asking this question after I pointed to it twice?