Using traccar server with own front end

Quade dennis7 years ago

Hi Anton

I've been reading lots on this site over the past couple of days and have installed the source code to have a play around

I have 2 questions

  1. Is there a front end available that connects to the server service to see stuff like total connected devices etc (not so important)

  2. I would like to use the server to connect to my existing front end, and don't need the mobile or web apps, I've read this is possible on a different thread

I assume traccar converts each message from all the different devices into one common format which is then inserted to the database

I would not need the data inserted to the db, but would need to push the 'common' formatted message to my own app and process it from there

Which file would I look at to intercept this common message before it hits the database?

I would also need some devices integrated in future and happy to pay for that work

Thanks for your time
Quade

Anton Tananaev7 years ago
  1. Obviously there is both web app and mobile apps.
  2. You can either use HTTP forwarding or web API.
Quade dennis7 years ago

Thanks Anton

In your opinion which is the most robust that can handle a larger number of devices
Web api or Http forwarding

Anton Tananaev7 years ago

Both should be able to handle large number of devices.

Quade dennis7 years ago

Thanks

As I understand it (please correct me if i'm wrong)

  1. Web Api requires the web app to be installed (hence the word web)
  2. HTTP Forwarding will work without the web app
  3. HTTP forwarding will not work with random devices, the deviceId needs to be added to traccar in order for it to forward

Does web api also require the deviceId to be added to the system? (will any solution work with random devices, or do they need to be added?)

Anton Tananaev7 years ago
  1. No, it does not.
  2. Yes.
  3. Both need devices to be registered, but Traccar can register new devices automatically.
Quade dennis7 years ago

Hi Anton

Thank you for you help, I got quite far, but just stuck on the last hurdle.

I wrote a HTTP app to accept the data from forwarded URL on traccar

Here are my settings

<entry key='event.forward.enable'>true</entry>
<entry key='event.forward.url'>http://127.0.0.1:8080/?id={uniqueId}&attributes={attributes}</entry>

This kinda works, my http app is seeing the forwarded data, however, its reading this:

POST request: /?id=%7BuniqueId%7D&attributes=%7Battributes%7D

I would appear the url parameters are not being appended properly
Am I missing a config setting?

To confirm, its a fresh install of the published exe on win 2016 server
i've opened the ports and see the device reporting on Web app
its a concox gt06
I've registered the device in the web app, and added the 2 keys to traccar.xml in C:\Program Files\Traccar\conf

Anton Tananaev7 years ago

Where did you get those parameters from? It seems like have mixed up event forwarding and location forwarding together. It's not going to work like that. Carefully read official documentation.

Quade dennis7 years ago

Bugger I just noticed and was about to delete my last reply!
You beat me too it

Was hoping you would not notice and be in bed with a sore head!

Quade dennis7 years ago

After editing the xml file, and restarting the service, i'm now getting this error when logging in as admin/admin

Account is disabled - SecurityException (PermissionsManager:237 < *:414 < SessionResource:103 < ...)

I've searched the forum but cannot find anything about fixing it
I've restarted the service several times but same issue.
I've also tried restoring the xml to before but no luck
any ideas?

Anton Tananaev7 years ago

Error message is pretty clear. Your user account is disabled.

Quade dennis7 years ago

:)

I guess the question for the dev's is why would this happen after editing config and restarting service

Problem for me is it was my only login, so i'm now not able to login
Do i need to manually edit the DB or Reinstall?

Anton Tananaev7 years ago

It has nothing to do with editing config and restarting. You do either.

Quade dennis7 years ago

ok, its the only thing i did though between it working and breaking

If you want any more info how it happened then i'll be happy to provide it
Unless you already know why it happened.

Anton Tananaev7 years ago

Data is cached in Traccar, so if you manually disable user in the database it will still work until you restart service. But either way, you disabled the user one way or another.