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

Raw data required #1914

Closed
vipinjacob opened this issue Apr 29, 2016 · 26 comments
Closed

Raw data required #1914

vipinjacob opened this issue Apr 29, 2016 · 26 comments

Comments

@vipinjacob
Copy link

My client want raw data, so how can i get the raw data in my mysql database

@vipinjacob
Copy link
Author

I am using traccar for only listening and inserting values to my server.

@tananaev
Copy link
Member

You can use database.saveOriginal config parameter to save original raw data.

@Raja-RN
Copy link

Raja-RN commented May 3, 2016

Entry key is database.saveOriginal Ok.
How i can identify the key name for raw data , and device id to insert database

@tananaev
Copy link
Member

tananaev commented May 3, 2016

Internal device id can be accessed using :deviceId parameter. Raw data is in JSON in :attributes parameter.

@Raja-RN
Copy link

Raja-RN commented May 3, 2016

i am storing attributes in positions table its like

{"alarm":true,"ignition":true,"status":0,"ip":"106.220.197.6"}

But i need actual value from device.

@tananaev
Copy link
Member

tananaev commented May 3, 2016

What version of Traccar are you using?

@Raja-RN
Copy link

Raja-RN commented May 5, 2016

I am using traccar-other-3.4

@tananaev
Copy link
Member

tananaev commented May 5, 2016

You need to update to the latest version.

@Raja-RN
Copy link

Raja-RN commented May 7, 2016

Hi , I have one doubt about traccar ., Did traccar implements
multithreading or asynchronous .,

@tananaev
Copy link
Member

tananaev commented May 7, 2016

I'm guessing that the question you are trying to ask is whether Traccar uses asynchronous or synchronous network calls. It uses asynchronous calls.

@Raja-RN
Copy link

Raja-RN commented May 9, 2016

Is multi threading different from asynchronous or same?

If yes ,
Why traccar not implemented by multi threading?

@tananaev
Copy link
Member

tananaev commented May 9, 2016

First you asking a question, and now you are asking what your own question means. It's two different things. Traccar uses both.

@Raja-RN
Copy link

Raja-RN commented May 26, 2016

Hi sir,

I have one query about traccar3.5

I downloaded traccar-other-3.5 and installed manually, In manual
installation, I created Mysql database as from the instructions, In manual
installation, traccar does not create tables automatically.

Log file shows :

2016-05-26 20:19:06 WARN: Table 'traccar.server' doesn't exist -
MySQLSyntaxErrorException (... < QueryBuilder:376 < *:275 < DataManager:457
< PermissionsManager:74 < ...)
2016-05-26 20:19:06 WARN: Table 'traccar.positions' doesn't exist -
MySQLSyntaxErrorException (... < QueryBuilder:376 < DataManager:452 <
ConnectionManager:55 < ...)
2016-05-26 20:19:07 INFO: Starting server...

Like this,

Whether traccar create tables automatically in MYSQL , Or we need to create
tables? If we need to create tables means where i will get the .sql file .

@tananaev
Copy link
Member

Traccar creates database tables automatically. I guess your config is incorrect if it doesn't.

@Raja-RN
Copy link

Raja-RN commented May 27, 2016

This is my Mysql config ,

com.mysql.jdbc.Driver
jdbc:mysql://[MYIP]:3306/[MYDB]
?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES
[MYUSERNAME]
[MYPASSWORD]

What i want to change , to create tables automatically

@tananaev
Copy link
Member

  1. It's not full config
  2. Instead of your ip address in the database URL, you should use localhost (unless database is on different server)
  3. Please answer through GitHub so config can be properly formatted

@Raja-RN
Copy link

Raja-RN commented May 27, 2016

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!-- SERVER CONFIG -->

    <entry key='web.enable'>true</entry>
    <entry key='web.port'>8082</entry>
    <entry key='web.path'>[WEB]</entry>

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>google</entry>

    <entry key='logger.enable'>true</entry>
    <entry key='logger.level'>all</entry>
    <entry key='logger.file'>[LOG]</entry>

    <!-- DATABASE CONFIG -->


<entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
<entry key='database.url'>jdbc:mysql://localhost:3306/traccar?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=ANSI_QUOTES</entry>
<entry key='database.user'>root</entry> 
<entry key='database.password'>password</entry>


    <!--<entry key='database.driver'>org.h2.Driver</entry>
    <entry key='database.url'>jdbc:h2:[DATABASE]</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'></entry> 
    <entry key='database.changelog'>[CHANGELOG]</entry>-->

    <entry key='database.selectServers'>
        SELECT * FROM server;
    </entry>

    <entry key='database.updateServer'>
        UPDATE server SET
        registration = :registration,
        readonly = :readonly,
        map = :map,
        bingKey = :bingKey,
        mapUrl = :mapUrl,
        distanceUnit = :distanceUnit,
        speedUnit = :speedUnit,
        latitude = :latitude,
        longitude = :longitude,
        zoom = :zoom,
        twelveHourFormat = :twelveHourFormat
        WHERE id = :id;
    </entry>

    <entry key='database.loginUser'>
        SELECT * FROM users
        WHERE email = :email;
    </entry>

    <entry key='database.selectUser'>
        SELECT * FROM users
        WHERE id = :id;
    </entry>

    <entry key='database.selectUsersAll'>
        SELECT * FROM users;
    </entry>

    <entry key='database.insertUser'>
        INSERT INTO users (name, email, hashedPassword, salt, admin, map, distanceUnit, speedUnit, latitude, longitude, zoom, twelveHourFormat)
        VALUES (:name, :email, :hashedPassword, :salt, :admin, :map, :distanceUnit, :speedUnit, :latitude, :longitude, :zoom, :twelveHourFormat);
    </entry>

    <entry key='database.updateUser'>
        UPDATE users SET
        name = :name,
        email = :email,
        admin = :admin,
        map = :map,
        distanceUnit = :distanceUnit,
        speedUnit = :speedUnit,
        latitude = :latitude,
        longitude = :longitude,
        zoom = :zoom,
        twelveHourFormat = :twelveHourFormat
        WHERE id = :id;
    </entry>

    <entry key='database.updateUserPassword'>
        UPDATE users SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id;
    </entry>

    <entry key='database.deleteUser'>
        DELETE FROM users WHERE id = :id;
    </entry>

    <entry key='database.selectDevicePermissions'>
        SELECT userId, deviceId FROM user_device;
    </entry>

    <entry key='database.selectGroupPermissions'>
        SELECT userId, groupId FROM user_group;
    </entry>

    <entry key='database.selectDevicesAll'>
        SELECT * FROM devices;
    </entry>

    <entry key='database.insertDevice'>
        INSERT INTO devices (name, uniqueId, groupId) VALUES (:name, :uniqueId, :groupId);
    </entry>

    <entry key='database.updateDevice'>
        UPDATE devices SET name = :name, uniqueId = :uniqueId, groupId = :groupId WHERE id = :id;
    </entry>

    <entry key='database.updateDeviceStatus'>
        UPDATE devices SET status = :status, lastUpdate = :lastUpdate WHERE id = :id;
    </entry>

    <entry key='database.deleteDevice'>
        DELETE FROM devices WHERE id = :id;
    </entry>

    <entry key='database.linkDevice'>
        INSERT INTO user_device (userId, deviceId) VALUES (:userId, :deviceId);
    </entry>

    <entry key='database.unlinkDevice'>
        DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId;
    </entry>

    <entry key='database.selectGroupsAll'>
        SELECT * FROM groups;
    </entry>

    <entry key='database.insertGroup'>
        INSERT INTO groups (name) VALUES (:name);
    </entry>

    <entry key='database.updateGroup'>
        UPDATE groups SET name = :name, groupId = :groupId WHERE id = :id;
    </entry>

    <entry key='database.deleteGroup'>
        DELETE FROM groups WHERE id = :id;
    </entry>

    <entry key='database.linkGroup'>
        INSERT INTO user_group (userId, groupId) VALUES (:userId, :groupId);
    </entry>

    <entry key='database.unlinkGroup'>
        DELETE FROM user_group WHERE userId = :userId AND groupId = :groupId;
    </entry>

    <entry key='database.selectPositions'>
        SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime;
    </entry>

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

    <entry key='database.selectLatestPositions'>
        SELECT * FROM positions WHERE id IN (SELECT positionId FROM devices);
    </entry>

    <entry key='database.updateLatestPosition'>
        UPDATE devices SET positionId = :id WHERE id = :deviceId;
    </entry>

    <!-- PROTOCOL CONFIG -->

    <!-- edited here -->
   <entry key='gt06.port'>22223</entry>

...

</properties>

This is my full config., And i have used localhost , But tables not created automatically..

@tananaev
Copy link
Member

Why have you commented out database.changelog parameter?

@Raja-RN
Copy link

Raja-RN commented May 28, 2016

Hi ,

Thanks for your response , It is very usefull for us ,

I found my mistake about create tables automatically ,

Now it create tables automatically ,

@Raja-RN
Copy link

Raja-RN commented May 28, 2016

Hi sir ,
I have another issue

Web ui not working , How to run it on my browsers ,

I am using centos 6 , and mysql database

Here i attached my we configuration text for web ,

<!-- SERVER CONFIG -->

<entry key='web.enable'>true</entry>
<entry key='web.port'>8082</entry>
<entry key='web.path'>/var/www/html/javaports3.5/web</entry>

<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.type'>google</entry>

<entry key='logger.enable'>true</entry>
<entry key='logger.level'>all</entry>
<entry key='logger.file'>[LOG]</entry>

I extracted *traccar-other-3.5.zip *, in inside the javaports3.5 folder ,

And how config my static IP , and run it using MY IP in browser

@tananaev
Copy link
Member

Why are you not using Linux installer? Also, please reply through GitHub.

@Raja-RN
Copy link

Raja-RN commented May 30, 2016

I need to customise the traccar , If i will use installer means how i will change . Manual installation means I can customise . So that i am using traccar-other-3.5.zip

@tananaev
Copy link
Member

What exactly do you need to customize? You can just replace files after installation same as with "other" version.

@Raja-RN
Copy link

Raja-RN commented Jun 4, 2016

Hi sir ,

Can you tell me what is the maximum number of vehicles i can connect to a
single port using TRACCAR.

@tananaev
Copy link
Member

tananaev commented Jun 5, 2016

There is no limit. Traccar has been tested with 100k devices and more.

@SebastEnn
Copy link

All questions answered. Issue can be closed.

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

No branches or pull requests

4 participants