Traccar integration problem

132 views
Skip to first unread message

Darren Deakin (UKDeek)

unread,
Apr 29, 2023, 6:21:26 AM4/29/23
to Open Source CAD
Hi all.

I'm running into some serious headaches trying to get Traccar integrated into Tickets 3.4

I did get this all working several years ago for someone, but for the life of me I can't get it working now.

I have tried several options, but I am hitting a brick wall.

I have tried the instructions given by Roberto Sanglay, but I can't even get that to work, namely I am getting an error whey trying to insert the lines into phpMyAdmin (I get 'unexpected beginning of statement' when putting the queries in).

If anyone has any tips, hints, help, instructions or whatever it would be appreciated.

Many thanks in advance for any help.

Darren (UKDeek)


Darren Deakin (UKDeek)

unread,
Apr 29, 2023, 6:27:09 AM4/29/23
to Open Source CAD
Sorry, should have added that Traccar is installed on a different server to the Tickets install - couldn't get Tickets running on the same virtual machine as Traccar, so have it installed on a shared host. Both of them work fine, just can't get them to work together...

Darren Deakin (UKDeek)

unread,
Apr 30, 2023, 9:34:59 AM4/30/23
to Open Source CAD
I have tried a few more things; I have uploaded the traccar.php file supplied by Roberto, but this doesn't work. My first Traccar installation has been modified to accept a URL and a secure connection rather than a IP address, and I get the error Traccar Tracking Test Fail. So, I attempted to use the IP address and port, and get the following: "CURL Error: Failed to connect to 138.68.176.149 port 8082 after 1001 ms: Couldn't connect to server".

So, I did a clean install of Traccar and didn't add any of the Apache stuff to resolve a URL, and tried it again, and I am still getting the same error: "CURL Error: Failed to connect to 161.35.32.245 port 8082 after 1002 ms: Couldn't connect to server"

I know my email address and password are right as I can log in to the Traccar portal without an issue. My device connects to the Traccar installation without an issue and reports my location as it should. My first installation I can connect via the URL or by the IP address and port.

I will keep trying various options listed on here, but at the moment I still cannot connect.

Thanks

Darren (UKDeek)

Arnie Shore

unread,
Apr 30, 2023, 9:55:48 AM4/30/23
to open-so...@googlegroups.com
Pls keep us current on this.  I'm not much help on this, having ducked out of Tix maintenance for some time now, but maybe ...

AS









Mark Taylor

unread,
Apr 30, 2023, 10:49:46 AM4/30/23
to open-so...@googlegroups.com
Darren,

I don't know how much help I can be because I use the Traccar integration that ships with Tickets and requires everything to be on the same server. Since things are on different servers in your case it works quite differently.  As shipped with Tickets the traccar integration makes direct calls to the traccar database that is on the same server.  With Robert's version there is no requirement for them to be on the same server, and it uses API calls to the traccar database using standard html get functions.

I can give you a couple of things to try out.

Use a browser to access your traccar web interface and log in.
See what is returned to your browser.  It should most likely be a XML of all of the registered devices on your traccar install.  You may need to have at least one device on and reporting it's location.

A return to your browser other than an error most likely indicates that it will work once Tickets is properly configured.  If it does not then maybe traccar is not configured to allow api calls, but I thought it was by default.


In Tickets, Robert's version of traccar.php should probably replace the "traccar" function in the incs/remotes.php file in tickets.  You will have to find that function. It may not look like a function as much as it does just a branch of the code.  I don't remember without looking.  I have not even seen Robert's instructions but most likely this is described in the instructions.  Be sure that is what the instructions say before you do that though.

Your server where tickets is located must allow for the httpd process to make calls to another server, and receive the data from another server.  That is a function of permissions and firewalls.  If you are not totally in control of those things you may not be able to edit them.  But, this is most likely not the case as most hosting servers allow this by default.

I thought Robert also provided for a stand alone php file to test that the functions would work outside of running tickets.  Have you found that php file? It would need to be uploaded to the same directory structure as tickets and accessed with a browser directly, as in http://myticketsserver.com/test.php

Good luck with it...


The version of traccar integration shipped with tickets probably still would work but you need to enter the hostname or IP where traccar is located, enter the MySQL port number, which must be open to inbound traffic, and traccar must use the MySQL database and not the default database.  Hosting provider do not usually allow for inbound traffic to SQL installations by default so it does make it more difficult to configure.


You see?  Not much help and I might have confused you even more.
Good luck with it.  I hope Robert sees your posts and responds...


Mark






--
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/ea9ead12-a54d-4405-9b3b-06a4f0f50ec4n%40googlegroups.com.

Ken Land

unread,
Apr 30, 2023, 12:09:16 PM4/30/23
to open-so...@googlegroups.com
On Sat, Apr 29, 2023 at 6:21 AM Darren Deakin (UKDeek) <ukd...@gmail.com> wrote:
Hi all.

I'm running into some serious headaches trying to get Traccar integrated into Tickets 3.4

I found this copy on GitHub last year which works for me https://github.com/openises/tickets

That GitHub account also has a Docker setup which is very helpful. The day before I can quickly create a server, add my hams who are dispatching, add the rest of the volunteers into Traccar, and delete the server when the event is over.

I have tried the instructions given by Roberto Sanglay, but I can't even get that to work, namely I am getting an error whey trying to insert the lines into phpMyAdmin (I get 'unexpected beginning of statement' when putting the queries in).

Where are the instructions you are following so someone else can try?

On Sun, Apr 30, 2023 at 9:55 AM Arnie Shore <sho...@gmail.com> wrote:
Pls keep us current on this.  I'm not much help on this, having ducked out of Tix maintenance for some time now, but maybe ...

AS

Arnie, everything in Tickets, including updates and fixes, has to go through you - SourceForge does not have pull requests or issues, and talking in a Google Group about bugs makes it hard to keep track of them. At least start using a modern website like GitHub or GitLab where people can work on the code together.

If you are unable to continue maintenance, what are your plans to responsibly hand over the reins for Tix and OpenISES?

Open source is about a selfless team effort, not a one man show. I have not seen Andy Harvey pop up on the list in a while, or Bob in over a decade, and now you're the last one standing. What do you plan to do about it?

Ken

Arnie Shore

unread,
Apr 30, 2023, 12:12:26 PM4/30/23
to open-so...@googlegroups.com
Like some of you traccar users, I look forward to hearing from Robert.  My concern re internalizing traccar is from the thought that doing so makes Tix sensitive to any internal changes, whereas an API interface applies some insulation against this..

My concern is that from my reading, the Traccar API is based in part on websockets.  I've struggled with that in Tix, and I'm unsure that the existing implementation works.

So not much help here, but watching.








Arnie Shore

unread,
Apr 30, 2023, 12:26:19 PM4/30/23
to open-so...@googlegroups.com
All, esp Ken, I'm hugely in favor of getting Tix onto some repository system like those you name, and have someone else picking up maintenance responsibility.  Thank you, thank you, thank you, thank you, thank you - but you get the idea.  That's been needed from day one, IMO.

I'll post something to the group asking for volunteers.  Otherwise the subject line here might result in some candidates skipping this exchange.

AS

Darren Deakin (UKDeek)

unread,
May 1, 2023, 9:09:56 AM5/1/23
to Open Source CAD
Update on what I have done today.

I have done a clean install of Ubuntu onto a DigitialOcean droplet with MariaDB10.3 running PHP version 74

I have installed Fastpanel as the server management tool (as I am really useless with CLI working)
I have installed Traccar and this works with my test device - Traccar version 5.7
I have installed Tix and this works fine - Tix version 3.4

Again, I cannot get Tix to pull any info from Traccar. I have entered all the correct information for DB access into Tix. I know this is the correct info as it is the same info that I entered into the config for Traccar. I have tried both localhost and 127.0.0.1 for the Traccar Server input with and without the default port number of 3306, and again no info pulled into Tix.


Mark Taylor

unread,
May 1, 2023, 9:21:54 AM5/1/23
to open-so...@googlegroups.com
Darren are you using Roberts's code or the code that was in the tickets install?


Mark


--
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.

Arnie Shore

unread,
May 1, 2023, 10:06:24 AM5/1/23
to open-so...@googlegroups.com
All, I've gone one-on-one with Mark Taylor on this in order to avoid inbox cluttering re what many of you might not be interested in.

But to be included in that follow-up, reply to this.

AS

William Howell

unread,
May 1, 2023, 10:21:46 AM5/1/23
to open-so...@googlegroups.com
--
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.

Mark Taylor

unread,
May 1, 2023, 10:57:51 AM5/1/23
to open-so...@googlegroups.com
Arnie...

The Traccar function in the remotes.inc.php is code that I wrote and submitted back in 2017.  The first lines of code are:

function do_traccar() { // 5/30/17 - track responder locations with Traccar server - uses Traccar mysql DB. (Traccar must be configured to use MySQL and not its default database)
global $istest;
 // Do we want to create a unique error function for Traccar?
function log_traccar_err($message) { // error logger
@session_start();
if (!(array_key_exists ( "traccar_err", $_SESSION ))) { // limit to once per session
do_log($GLOBALS['LOG_ERROR'], 0, 0, $message);
$_SESSION['traccar_err'] = TRUE;
}
} // end function

My Tickets version is:
Tickets Version:3.31A Beta - 05/20/19
Server OS:Linux localhost.localdomain 3.10.0-1160.21.1.el7.x86_64 #1 SMP Tue Mar 16 18:28:22 UTC 2021 x86_64
PHP Version:7.4.16 under Apache/2.4.6 (CentOS) PHP/7.4.16
Database:tickets on localhost running mysql 5.5.68-MariaDB

I am still trying to determine what Traccar version I have.

Here are the update notes relevant to Traccar and JavAPRSSrvr
5/30/2017 - added Traccar and javAPRSSrvr server capabilities - see below
Traccar - Traccar server must use MySQL database and not the default database, and must be accessible from server Tickets is on.
          Client should use callsign in Device Identifier if a Ham. If not, it is recommended to use telephone number without any '-'
          Presently uses server, database, user, and password for xastir configuration.
          8/28/2018 Alter code for version 4 database tablenames. MT
javAPRSSrvr - javAPRSSrvr must be accessible from the server Tickets is on.
              javAPRSSrvr must use dbgate client of javAPRSSrvr
              Presently uses server, database, user, and password for xastir configuration.


Anyway, I modified the code in 2018  to accommodate a database schema change during a Traccar update, but that change did not make it into the base Tickets code for 3.4



I can probably help Darren get his install working for now, but it would be best if Robert's code using API calls were permanently incorporated into Tickets instead of mine.  His code would survive a database schema change by Traccar.  Once I do that I can give you the working code.  If we cannot get Robert to respond I'll try and find his code and see if I can give you what you need to permanently install his code into Tickets.



If Darren could contact me off-list I can check the Traccar database for schema changes and provide him with code that will likely work.  I'll get it working one wa8y or another...


Mark











Mark Taylor

unread,
May 1, 2023, 11:35:20 AM5/1/23
to open-so...@googlegroups.com
I email Darren direct and if he replies I will be able to help him, and in the process fix the traccar code in Tickets.

Mark

Darren Deakin (UKDeek)

unread,
May 1, 2023, 1:22:08 PM5/1/23
to Open Source CAD
Hi Mark

I've done both - I have a Traccar installation a server that I am trying to access remotely. Also, I have another server with Traccar and Tix installed if that helps?

Ken Land

unread,
May 1, 2023, 1:27:00 PM5/1/23
to open-so...@googlegroups.com
I read the code and it looks like this is what needs to change to make Traccar work.


Edit the remotes.inc.php file so it uses the tc names.

Ken

Darren Deakin (UKDeek)

unread,
May 3, 2023, 8:13:24 AM5/3/23
to Open Source CAD
I have edited the remotes.inc.php file with the tc_ prefixes, and I am happy to say this now works as intended.

Many thanks to all of you that have helped, especially to Mark and Ken - it really has been appreciated!

Darren

Ken Land

unread,
May 3, 2023, 10:41:28 AM5/3/23
to open-so...@googlegroups.com
Don't thank me, you should thank whoever updated the code, and whoever organized the fixes and uploaded them to GitHub.

Ken

Eric Osterberg

unread,
May 7, 2023, 1:34:12 AM5/7/23
to open-so...@googlegroups.com
I'd like to let everyone know this fix have been applied and the latest update is available in the usual place or https://sourceforge.net/projects/openises/files/tix3_4A.zip/download

I've also included a patch of my own that adds a user_agent string to the curl calls to fetch map tiles for Open Street Map servers that require a user agent string.

Please let me know if you have any additional patches you would like to see merged into the 'official releases'. I'm still investigating access to the GitHub accounts that appear to official. (but are not)
You can simply send me your installed system and I'll hunt the changes down if that's easier for you.

Thanks everyone,
 -Eric Osterberg
Your Tickets CAD project manager

Ken Land

unread,
May 7, 2023, 2:45:38 AM5/7/23
to open-so...@googlegroups.com
Great, now the official version matches the good GitHub one.

Kevin Hoegenauer's version used a tool called PHP-CS-Fixer which makes the code easier to read. This would make it easier to program. In the next release, can you use that tool or anything like it?

He also uses a tool called Travis-CI to make sure all the code is correct. I think GitHub has their own version called GitHub Actions to do the same thing.

A couple of new bugs to report for you to keep track of.
  1. Email formatting is all one line.
  2. The Traccar map updates instantly but the Tix map does not.
  3. Major incidents "forget" the attached incidents whenever you update the major incident.
Ken

Eric Osterberg

unread,
May 7, 2023, 3:01:52 AM5/7/23
to open-so...@googlegroups.com
I've added those to my issue tracker. At the moment, it's marked private. Once the Git hosting solution is in place, I'll open up the list of issues.
Number 3 on your list looks like the first priority.
Thanks for the submissions.


Mark Taylor

unread,
May 7, 2023, 7:35:06 AM5/7/23
to open-so...@googlegroups.com
(From memory...) Tickets does not update instantly.  There is a timer in the settings.

Of course there is a "Frequency" of update in the Traccar client also so the possible maximum update time per tracked asset would be [Traccar frequency of update] + [Tickets update timer] + [network delays] +1

I consider that a feature that we must understand and adjust according to individual hardware/network capabilities.


Mark





Arnie Shore

unread,
May 7, 2023, 10:57:34 AM5/7/23
to open-so...@googlegroups.com
Eric/all, some additional issue candidates:
  • Upgrade to accommodate current PHP and MySQL versions.  During 3.4's lifespan until the need for the two-line Traccar fix surfaced , the only problems brought to my attention were resolved by installing compatible but non-current versions of these two engines.  That is, it took no code, but it was problematic and a time-eater.
  • Another point is that there's some amount of dead code that should be excised in order to support maintainability..  Run orphan.php to see them identified. ( BUT some false drops do show up among the 411 in Tix 3.4, so please don't blindly remove these. Like all of the files in the tables directory; where the filenames are computed at run time for inclusion.  Those, plus some library component files, which should be retained for library integrity, IMO.)
AS

Eric Osterberg

unread,
May 7, 2023, 1:30:07 PM5/7/23
to open-so...@googlegroups.com
Thanks Arnie,

I'm starting a new thread for this discussion.
I've added #71 on my ongoing list for the dead code search with the orphan.php and other tools.
PHP version is issue # 7
And MySQL/MariaDB updates is issue #20 and #23

Unfortunately, I don't see a way to export my issues/project list and I have not exposed the location of the list yet as I'm already a bit concerned about brand dilution.
I would really like to gain control of the https://github.com/openises/tickets repo as that's become a goto for many people over the last 8 months.
For example, we have the names:
 - tickets
 - tickets CAD
 - Open Source CAD
 - ISES CAD
 - ISES Tickets
 - Open ISES CAD
 - OpenISES tickets
 - Open CAD

I spent a few hours last night reading the last ~3 years of the mailing list and collecting ideas for the project into a project feature list which can be transferred into a project roadmap.
There's a fair amount of documentation, followed by cleanup and fixes, followed by new features.

I'll post those ideas here if I locate an export feature.

In the meantime, if you have ideas or any customized code, I'd love to hear from you about incorporating those ideas into a future release.

Thank you everyone.
  -Eric Osterberg

Roberto Sanglay

unread,
Jun 2, 2023, 4:37:17 AM6/2/23
to Open Source CAD
Hello everyone.  

This is my first post after nearly 3 years.  I was just wondering if my name was the one mentioned in the thread.  
I was able to play with traccar integration with Tix ver 3.1 a few years back.  I hope that the files that I uploaded got into the repo and all the way to 3.4.  I am glad that the traccar problem was resolved and the php file on the repo is up to date.  

I have been away from coding for a while and cant even remember what I did with the traccar testing, but glad to see the group is active and headed by a new lead Eric!   As we say in the Philippines "Mabuhay"!

Best

Robert

Eric Osterberg

unread,
Jun 2, 2023, 12:19:36 PM6/2/23
to open-so...@googlegroups.com
Thank you Robert,

This is truly a community project and we're counting on each other. I may have the title of lead, but I'm hardly the most knowledgeable about the project. I'll get there but there are so many in our community with the skills to help each other out.

--
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.
Reply all
Reply to author
Forward
0 new messages