odometer traccar.cfg (integration with opengts),

824 views
Skip to first unread message

jyotir bhandari

unread,
Mar 27, 2014, 2:10:03 AM3/27/14
to tracca...@googlegroups.com
Hi

I have integrated opengts with traccar to use traccar as dcs server for Noran device.

I need odometer values or distance travelled in opengts via traccar dcs.

I tried to modify traccar.cfg and here is what it looks like

<entry key='database.selectDevice'>
        SELECT deviceID AS id, uniqueID AS imei FROM Device;
    </entry>

    <entry key='database.insertPosition'>
        START TRANSACTION;
            UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:time), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = :device_id;
            SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = :device_id;
            INSERT INTO EventData (accountID, deviceID, timestamp, statusCode, latitude, longitude, speedKPH, odometerKM, heading, altitude, rawData, creationTime, address)
            VALUES (@accountID, @deviceID, UNIX_TIMESTAMP(:time), 0, :latitude, :longitude, :speed, :odometer, :course, :altitude, '', UNIX_TIMESTAMP(NOW()), :address);
        COMMIT;
    </entry>

    <entry key='database.updateLatestPosition'>
        DO 0;
    </entry>


Error in taccar :


==> /opt/traccar/logs/tracker-server.log <==
2014-03-27 11:38:29 DEBUG: [5053 <- 36.253.54.172] - HEX: 22000800010b080f00efa1aa42406cdd411862f6384e523039463034313437000000
2014-03-27 11:38:29  INFO: device: 869988010609887, time: Thu Mar 27 11:38:24 IST 2014, lat: 27.6778564453125, lon: 85.31627655029297
2014-03-27 11:38:29  WARN: No value specified for parameter 10 - java.sql.SQLException (SQLError.java:1075)

==> /opt/traccar/logs/wrapper.log.20140327 <==
INFO   | jvm 1    | 2014/03/27 11:38:29 | com.mysql.jdbc.JDBC4PreparedStatement@117c4779:
INFO   | jvm 1    | 2014/03/27 11:38:29 |         START TRANSACTION;
INFO   | jvm 1    | 2014/03/27 11:38:29 |             UPDATE Device SET lastValidLatitude = 27.6778564453125, lastValidLongitude = 85.31627655029297, lastGPSTimestamp = UNIX_TIMESTAMP('2014-03-27 11:38:24'), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = 869988010609887;
INFO   | jvm 1    | 2014/03/27 11:38:29 |             SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = 869988010609887;
INFO   | jvm 1    | 2014/03/27 11:38:29 |             INSERT INTO EventData (accountID, deviceID, timestamp, statusCode, latitude, longitude, speedKPH, odometerKM, heading, altitude, rawData, creationTime, address)
INFO   | jvm 1    | 2014/03/27 11:38:29 |             VALUES (@accountID, @deviceID, UNIX_TIMESTAMP('2014-03-27 11:38:24'), 0, 27.6778564453125, 85.31627655029297, 8.0, ** NOT SPECIFIED **, 15.0, 0.0, '', UNIX_TIMESTAMP(NOW()), null);
INFO   | jvm 1    | 2014/03/27 11:38:29 |         COMMIT;
INFO   | jvm 1    | 2014/03/27 11:38:29 |    


What do I need to do as I am not a java developer, please guide me changes I need to do in any file.

Regards
Jyotir





Maison K. Sakamoto

unread,
Mar 27, 2014, 7:59:47 AM3/27/14
to tracca...@googlegroups.com
Hi jyotir,
could be made ​​a calculation for the distance traveled through the Google Maps API, is attached an example.


Em 27/03/2014 03:10, jyotir bhandari escreveu:
Hi

I have integrated opengts with traccar to use traccar as dcs server for Noran device.

I need odometer values or distance travelled in opengts via traccar dcs.

I tried to modify traccar.cfg and here is what it looks like

--

att,
Maison Kendi Sakamoto
Tecnologia da Informação
Cel: 55 (45) 9118-1184 | Tel: 55 (45) 35263303
Email: maison....@gmail.com

Antes de imprimir, pense em sua responsabilidade e compromisso com o MEIO AMBIENTE.

AVISO LEGAL
As informações contidas nesta mensagem são confidenciais.
Caso você tenha recebido este e-mail por equívoco, favor descartá-lo do seu sistema e avisar imediatamente a este remetente.
O uso indevido do conteúdo de qualquer mensagem, total ou parcialmente, sem autorização prévia do autor é ilegal.

mapViajem.php

jyotir bhandari

unread,
Mar 27, 2014, 8:56:38 AM3/27/14
to tracca...@googlegroups.com
Hi Maison,

If you could help me with code in java to be changed as I am not a programmer.

Could you also tell me in which file to make the changes whether in opengts side or traccar side.

Regards
Jyotir

Iuri Pereira

unread,
Mar 27, 2014, 9:22:44 AM3/27/14
to tracca...@googlegroups.com
You'll need to put your hands on java code.

example:
add this above line 156: queryAddPosition.setDouble("odometer", position.getOdometer());

But, there is a question: How do you get odometer values from your gps?


Iuri Pereira


--
Site da Comunidade Brasileira do Traccar: http://www.traccar-br.org
---
Você recebeu essa mensagem porque está inscrito no grupo quot;Traccar Brasil" dos Grupos do Google.
Para cancelar inscrição nesse grupo e parar de receber e-mails dele, envie um e-mail para traccar-pt-b...@googlegroups.com.
Para postar nesse grupo, envie um e-mail para tracca...@googlegroups.com.
Acesse esse grupo em http://groups.google.com/group/traccar-pt-br.
Para mais opções, acesse https://groups.google.com/d/optout.

Roberto Almeida

unread,
Mar 27, 2014, 9:36:49 AM3/27/14
to tracca...@googlegroups.com
Jyotir,

Remember that only some devices report the value of the odometer.

Regards,

Roberto Almeida


Em 27/03/14 09:22, Iuri Pereira escreveu:

jyotir bhandari

unread,
Mar 27, 2014, 1:10:00 PM3/27/14
to tracca...@googlegroups.com
Thanks luri, that worked, Noran device support odometer. Thanks again.

Thanks everyone for cooperating.


Regards
Jyotir




On Thursday, 27 March 2014 11:40:03 UTC+5:30, jyotir bhandari wrote:
Reply all
Reply to author
Forward
0 new messages