Skip to content
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

JSON to XML after installing traccar-web #433

Closed
mpele opened this issue Dec 30, 2015 · 3 comments
Closed

JSON to XML after installing traccar-web #433

mpele opened this issue Dec 30, 2015 · 3 comments

Comments

@mpele
Copy link
Contributor

mpele commented Dec 30, 2015

Hi Vitaly,
Do you have any idea why the data in the field others are stored in xml after changing traccar.xml according to the instructions http://traccar.litvak.su/installation.html ?
Within "original" traccar the other field is in JSON by default, but after installing traccar-web it is XML.
It happens with traccar 3.2 and, I think, with 3.1 - (I have no experience with 3.3).

@vitalidze
Copy link
Owner

I think this is because of this query:

<entry key='database.insertPosition'>
    INSERT INTO positions (device_id, protocol, serverTime, time, valid, latitude, longitude, altitude, speed, course, address, other)
    VALUES (:deviceId, :protocol, CURRENT_TIMESTAMP(), :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :other);
</entry>

From my last investigation in :other parameter of query traccar backend ALWAYS stores XML. Try to change :other to :attributes:

<entry key='database.insertPosition'>
    INSERT INTO positions (device_id, protocol, serverTime, time, valid, latitude, longitude, altitude, speed, course, address, other)
    VALUES (:deviceId, :protocol, CURRENT_TIMESTAMP(), :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes);
</entry>

AFAIK in 3.0 and 3.1 :other stored either JSON or XML according to the configuration file settings. This was changed only since 3.2.

@mpele
Copy link
Contributor Author

mpele commented Dec 30, 2015

According to traccar/traccar#1627 (comment) it should be the same.
But it is not!!!
It looks that you are more familiar with traccar than Anton ;)

@crarchile
Copy link

Also worked for me. Thanks

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

No branches or pull requests

3 participants