New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New protocol decoder for OwnTracks #3242

Merged
merged 5 commits into from Jun 14, 2017

Conversation

Projects
None yet
2 participants
@jpmens
Contributor

jpmens commented Jun 13, 2017

This pull request implements a new protocol called owntracks which decodes JSON publishes by the OwnTracks apps running on iOS or Android. These open source apps originally did MQTT (and still do of course), but a while ago we added HTTP POST which posts JSON payloads such as

{"cog":271,"lon":2.29513,"acc":5,"vel":61,"vac":21,"lat":48.85833,"tst":1497350249,"alt":167,"_type":"location","tid":"JJ"}

Traccar's deviceId is gleaned from OwnTracks' tid (tracker ID) which is a 2-character code. The other elements ought to be self-explanatory and are all mapped onto appropriate Traccar parameters.

We (i.e. the OwnTracks team) hope this is a valuable contribution to the excellent Traccar project and would like to see this in Traccar to enhance interoperability.

@tananaev

I have added some comments that need fixing before this can be merged into Traccar.

Is there any official documentation on the JSON format that app sends?

@jpmens

This comment has been minimized.

Show comment
Hide comment
@jpmens

jpmens Jun 13, 2017

Contributor

Documentation of OwnTracks payloads is available.

Contributor

jpmens commented Jun 13, 2017

Documentation of OwnTracks payloads is available.

@jpmens

This comment has been minimized.

Show comment
Hide comment
@jpmens

jpmens Jun 13, 2017

Contributor

@tananaev changes as per your review requests completed.

Contributor

jpmens commented Jun 13, 2017

@tananaev changes as per your review requests completed.

@tananaev

This comment has been minimized.

Show comment
Hide comment
@tananaev

tananaev Jun 13, 2017

Member

You still have problem with indentation in a few places. Please make sure that you are using the same style as existing code.

Member

tananaev commented Jun 13, 2017

You still have problem with indentation in a few places. Please make sure that you are using the same style as existing code.

@jpmens

This comment has been minimized.

Show comment
Hide comment
@jpmens

jpmens Jun 13, 2017

Contributor

Now I saw them (indent=4). Apart from json.createreader() which is just too long, I think I've got them. :)

Contributor

jpmens commented Jun 13, 2017

Now I saw them (indent=4). Apart from json.createreader() which is just too long, I think I've got them. :)

@tananaev

This comment has been minimized.

Show comment
Hide comment
@tananaev

tananaev Jun 13, 2017

Member

You still have problems with indentation in multiple places. Indentation for wrapped lines should be 8 spaces. Make sure you check test class as well.

Member

tananaev commented Jun 13, 2017

You still have problems with indentation in multiple places. Indentation for wrapped lines should be 8 spaces. Make sure you check test class as well.

Jan-Piet Mens added some commits Jun 13, 2017

@tananaev tananaev merged commit e4262bd into traccar:master Jun 14, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tananaev

This comment has been minimized.

Show comment
Hide comment
@tananaev

tananaev Jun 14, 2017

Member

Merged, thanks.

Member

tananaev commented Jun 14, 2017

Merged, thanks.

@jpmens

This comment has been minimized.

Show comment
Hide comment
@jpmens

jpmens Jun 14, 2017

Contributor

Thank you for your patience. :-)

Contributor

jpmens commented Jun 14, 2017

Thank you for your patience. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment