Traccar integration issues

157 views
Skip to first unread message

param...@gmail.com

unread,
Jul 30, 2022, 12:34:25 PM7/30/22
to Open Source CAD
Hi !

I run a fresh install of Tickets 3.4 on a Azure VM. I also run a Traccar instance. Everything works fine. If I log in the admin portal of traccar I see my units tracking. When I look at the Traccar MySQL tables, I saw all the position history. 

I checked in my Tickets configuration page and all the informations for the Traccar DB is accurate. DB name, username, password. I setup my units and use the callsign (device id) i gave in traccar (i.e. 16985_05) in the callsign field. The location never update. And if I clear the location field of the unit in the unit configuration page, it shows Invalid position data when I try to track it in Tickets.

Can anyone help me with that ?

Thanks !

David Russell

unread,
Aug 12, 2022, 11:32:44 AM8/12/22
to Open Source CAD
For starters you need to make a minor edit to 1 PHP page as follows. Traccar added a prefix to their table names, which isn't reflected in the PHP that comes with Tickets.

  • /incs/remotes.php on line 866 added tc_ to beginning of table name

    • $query = 'select uniqueid, positionid from tc_devices where uniqueid = "' . $row1['callsign'] . '" limit 1';

  • Same file on line 873 added tc_ to beginning of table name

$query = 'select latitude, longitude, speed, course, altitude, devicetime from tc_positions where id = "' . $positionid . '"';

Bonhomme Barbosue

unread,
Aug 12, 2022, 12:28:14 PM8/12/22
to open-so...@googlegroups.com
Works perfectly ! Thanks

--
You received this message because you are subscribed to the Google Groups "Open Source CAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-source-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-source-cad/888db247-8a18-4b6c-aff2-417034796cf6n%40googlegroups.com.

SO-CM

unread,
Oct 11, 2022, 1:45:04 PM10/11/22
to Open Source CAD
Ok, I did this and it still is not showing the information.

SO-CM

unread,
Oct 11, 2022, 1:56:53 PM10/11/22
to Open Source CAD
Screenshot 2022-10-11 10.55.09.png
This is what I am getting

mdtayl...@gmail.com

unread,
Oct 11, 2022, 2:18:21 PM10/11/22
to Open Source CAD
Don't use the Tracks pop up for testing. It takes a long time for data to create the tracks.

And I wouldn't blindly change php code unless you can determine for sure it is needed and why.

First are both Traccar and Tickets on the same server?
Is Traccar configured to use MySQL as required?
Are you using a user/password that can see the trackers you want to see? Don't use the admin default. It will not work.
Use phpMyAdmin to view the Traccar database. Look at the columns. Do you have a devices column or do you have a tc_devices column? Can you successfully run the query in the php code that you changed?  Anton has change the database tables in the past requiring code changes. I have not updated mine in a while so I have no idea if that is an issue now.
Remember that there are timers that do things. Both in Traccar and in Tickets.  It may take as long as the combined time of both timers plus a few seconds to start showing data.
I have ran into cases where some characters are not allowed in the tracker ids, but there is no error message displayed.  Use at least 6 alphanumeric characters with no special characters to start with.

Shared servers often put your username_ in front of your database name but don't show that to you.

Watch only the map on the Situation screen. The locations will change provided BOTH timers have elapsed and the position has changed.

You might show us a Unit Edit screen so we can verify with you that the setup is correct.


Mark

SO-CM

unread,
Oct 11, 2022, 2:49:29 PM10/11/22
to Open Source CAD
I have no clue on the MySQL use.  I am still learning Screenshot 2022-10-11 11.38.57.pngInkedScreenshot 2022-10-11 11.41.08.jpg

Mark Taylor

unread,
Oct 11, 2022, 2:55:08 PM10/11/22
to open-so...@googlegroups.com
The Traccar default is to use the embedded H2 database.  You MUST configure Traccar to use SQL database on the same server with tickets.

Use the Traccar documentation here to configure Traccar to use SQL Server instead of H2.  https://www.traccar.org/mysql/


--
You received this message because you are subscribed to the Google Groups "Open Source CAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-source-c...@googlegroups.com.

SO-CM

unread,
Oct 11, 2022, 4:09:58 PM10/11/22
to Open Source CAD
This is what I have.
    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost/traccar?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>pertemer</entry>
    <entry key='database.password'>**************</entry>

and this is what is lists in the MySQL directions

Configuration parameters for MySQL (replace [HOST], [DATABASE], [USER], [PASSWORD] with appropriate values; for local database use "localhost" as HOST):

<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry> <entry key='database.url'>jdbc:mysql://[HOST]:3306/[DATABASE]?serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry> <entry key='database.user'>[USER]</entry> <entry key='database.password'>[PASSWORD]</entry>

am I still missing something? I also censored our password on here

Mark Taylor

unread,
Oct 11, 2022, 4:18:22 PM10/11/22
to open-so...@googlegroups.com
Well, I'm no expert, but this:

<entry key='database.url'>jdbc:mysql://localhost/traccar?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;

Does not look like this:

<entry key='database.url'>jdbc:mysql://[HOST]:3306/[DATABASE]?serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>

Specifically:
jdbc:mysql://localhost/traccar
jdbc:mysql://[HOST]:3306/[DATABASE]

SO-CM

unread,
Oct 11, 2022, 4:50:54 PM10/11/22
to Open Source CAD
So should it be this then?

   <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost:3306/pertemer_traccar?serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>

<entry key='database.user'>pertemer</entry>
<entry key='database.password'>**********</entry>

the traccar login is located at http://www.pertdispatch.com:8082/login

Mark Taylor

unread,
Oct 11, 2022, 4:54:40 PM10/11/22
to open-so...@googlegroups.com
That looks a lot closer to what might work.  Each linux flavor, php version, mysql version, and connectors might require different values that I have.  Once you try it look for errors when you start traccar.

Do you have access to phpMyAdmin to look at the database?



Lee White

unread,
Oct 11, 2022, 4:57:43 PM10/11/22
to open-so...@googlegroups.com
Yes I can access our MySQL.   I am not seeing any errors

SO-CM

unread,
Oct 11, 2022, 5:00:34 PM10/11/22
to Open Source CAD
In the error log I see this:
 PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user 'pertemer'@'localhost' (using password: YES) in /home/pertemer/public_html/CAD/incs/mysql2i.class.php on line 43

Mark Taylor

unread,
Oct 11, 2022, 5:03:09 PM10/11/22
to open-so...@googlegroups.com
Using phpMyAdmin you chouls be able now to give permission to the user pertemer, on localhost, to access, use, add, etc to your traccar database.  It's now a permissions issue it looks like.

Lee White

unread,
Oct 11, 2022, 5:09:39 PM10/11/22
to open-so...@googlegroups.com
All permissions are enabled and no change 

Mark Taylor

unread,
Oct 11, 2022, 6:57:03 PM10/11/22
to open-so...@googlegroups.com
Lee, when you say 'no change' does that mean you are still seeing the error?

SO-CM

unread,
Oct 11, 2022, 7:08:26 PM10/11/22
to Open Source CAD
Yes, the error is still showing up

Mark Taylor

unread,
Oct 11, 2022, 7:11:19 PM10/11/22
to open-so...@googlegroups.com
Then you still have a permissions problem. Most likely you have not granted the user the access it needs to the database, or it is set up not @localhost but by another hostname.







SO-CM

unread,
Oct 11, 2022, 7:19:25 PM10/11/22
to Open Source CAD
I have no Idea, that is way over my knowledge.  I finally got that error code to stop but I still am not getting tracking information.  I checked the database permission and I have all enabled

Mark Taylor

unread,
Oct 11, 2022, 7:26:16 PM10/11/22
to open-so...@googlegroups.com
Ok then, using phpMyAdmin (do you know what that is?) access your traccar database.  Is it populated with tables? If so, are you still seeing your trackers move around in traccar?

If yes to all of that then leave tickers on the Situation screen for an half hour to see if anything moves.



Message has been deleted

SO-CM

unread,
Oct 11, 2022, 7:32:45 PM10/11/22
to Open Source CAD
Screenshot 2022-10-11 16.30.09.png

SO-CM

unread,
Oct 11, 2022, 7:33:45 PM10/11/22
to Open Source CAD
I am also getting this error:  PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/pertemer/public_html/CAD/incs/status_cats.inc.php on line 299

Mark Taylor

unread,
Oct 11, 2022, 7:43:11 PM10/11/22
to open-so...@googlegroups.com
Ok, now you know that traccar created all the tables you need. But you had to create the database yourself, right?  It should have been set up to use the InnoDB Engine as the instructions say.

" Note! Traccar will create tables for you, but you need to create database with selected name by yourself. Make sure you use InnoDB engine for the database.
Traccar uses constraints that are not supported by MyISAM engine."

You will have to change all the tables to the correct engine in the options for each table.  Not sure you can do them all at once. Maybe someone else can give you an easier way.





On Tue, Oct 11, 2022 at 6:30 PM SO-CM <adso...@gmail.com> wrote:
Screenshot 2022-10-11 16.30.09.png

On Tuesday, October 11, 2022 at 4:26:16 PM UTC-7 mdtayl...@gmail.com wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "Open Source CAD" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/open-source-cad/V7p-YJmTweU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to open-source-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-source-cad/01901c44-acff-493f-abe0-b5af54fb98c3n%40googlegroups.com.

SO-CM

unread,
Oct 11, 2022, 7:59:05 PM10/11/22
to Open Source CAD
I have no idea how to do that??  I am still learning all this

SO-CM

unread,
Oct 14, 2022, 4:44:53 PM10/14/22
to Open Source CAD
Ok I got Traccar working in CAD, the only issue is the map in the tracking window does not show the tracks, it does show the graph at the bottom of the screen.  the map shows but it does not show any track at all.
Reply all
Reply to author
Forward
0 new messages