Events and Maintenance

MiroMiro3 years ago

As it was not clear to me how to configure Maintenance and Events, I am putting it in here.
Maybe someone else will benefit, as documentation is scarce.
I can fully understand that the developer of Traccar is programmer, likes to focus on coding , and probably hates writing documentation.

  1. had to add this in my traccar.xml
<entry key='notificator.types'>web,mail</entry>

.. for mail config, check the official documentation, it's in there with good example

<entry key='event.enable'>true</entry>
<entry key='filter.skipAttributes.enable'>true</entry>
<entry key='filter.skipAttributes'>alarm,event,status</entry>
  1. Maintenance /Event
  • first, you need to configure the maintenance in configs in the Main config in Gui (the gears sign in the Map part of GUI)
  • then, you can assign these defined Maintenances to specific devices
    this was not clear to me, I thought you configure maintenance per device, and not just assign it to specific device
  • the logic for maintenance was also not clear to me
    the Start is just a logical start for the maintenance. NO MAINTENANCE EVENT will come when this value is reached (for example 50k km)
    the Interval is the value at which intervals the MAINTENANCE EVENT fires, and you get a notification.
    so, lets say I want to get ;Oil change; event on first 50k, and then every 10k
    Start - 40k
    Interval - 10k
    then, with config like this, I get the Event and email on 50k. And then every 10k.
Anton Tananaev3 years ago
  1. None of this is required for maintenance events and notifications to work.

  2. There's documentation here:

https://www.traccar.org/documentation/events/

In you example with start 40k and interval 10k, you get notifications at 40k, 50k, 60k etc.

this was not clear to me, I thought you configure maintenance per device, and not just assign it to specific device

Not sure I understand the confusion here. You can make it per device or you can assign same maintenance schedule for multiple devices. That's up to you.

MiroMiro3 years ago
  1. I had no events generated without those lines
  2. documentation, yes. it was not clear to me that the Start does not generate event

yes, you can assign to devices the maintenances you defined before
there is no + sign to define a new maintenance for a device. that I did not understand.

Anton Tananaev3 years ago

There are two main types of screens:

  1. Screen for managing entities (e.g. Maintenances, Geofences, Groups, Calendars etc). These screens are usually accessible from the main menu at the top right corner of the map panel.
  2. Screens to link devices (or groups or users) to other entities. For devices these are accessible from the device panel menu. You cannot create/edit/delete entities from here. Only link.

This is a standard pattern we can across pretty much all features, not just maintenance.

MiroMiro3 years ago

yah, agree. I am not arguing with you. define entities, assign / link.

next challenge - obd2. I bought the freematics one + - recommended by you - in the expectation to at least get the basic OBD2 pids. but no luck for now. I see (some) with the hub.freematics server, but none of those in traccar. And yes, using 5170 UDP freematics protocol.

step by step :)

Anton Tananaev3 years ago

It should be supported:

https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/protocol/FreematicsProtocolDecoder.java#L147-L174

At the very least you should get attributes as generic "IO" values.

MiroMiro3 years ago

thanks. I will investigate. All cars are 'running' productive, so not much time to tinker with the units.
See for example one car reports some PIDs, while other, newer, does not show even the generic PIDs. With same firmware (visual studio as recommended).
I will come back to you when I have more information and some hex.
MercBenz - last years model, no pids in gui

4130484e384a333923303a31333834372c32343a313238312c32303a302e30343b2d302e30393b302e30322c38323a34352c31313a37303332322c31303a3233303632302c413a382e3534383632302c423a2d37392e3837313034382c433a32332e3530303030302c443a31342e3830303030302c453a3238382c463a31322c31323a362c2a41

Older Ford - some Pids in GUI visible

4130484e5a534a3223303a3839343130312c3132463a302c3133313a33333338312c3130443a302c3130433a302c3131313a39332c3130343a302c32343a313233322c32303a302e30303b2d302e30303b2d302e30312c31313a37303332322c31303a32323239323835302c413a392e3036373233342c423a2d37392e3338373935352c433a35322e3530303030302c443a302e3030303030302c453a32372c463a31322c31323a31302c2a4337
Anton Tananaev3 years ago

You can use HEX decoder to see what your device is reporting in more human readable form:

https://www.traccar.org/hex-decoder/

MiroMiro3 years ago

MB ( a newer car)

A0HN8J39#0:13847,24:1281,20:0.04;-0.09;0.02,82:45,11:70322,10:230620,A:8.548620,B:-79.871048,C:23.500000,D:14.800000,E:288,F:12,12:6,*A

Ford (an older car)

A0HNZSJ2#0:894101,12F:0,131:33381,10D:0,10C:0,111:93,104:0,24:1232,20:0.00;-0.00;-0.01,11:70322,10:22292850,A:9.067234,B:-79.387955,C:52.500000,D:0.000000,E:27,F:12,12:10,*C7

maybe I need to play with PIDs and add more to read in the telelogger.ino of freematics ( if I understand it correctly, the 'number' in the names declaration is Data bytes returned (according to https://en.wikipedia.org/wiki/OBD-II_PIDs)
sorry, I am not a programmer, so just putting pieces together :)

PID_POLLING_INFO obdData[]= {
  {PID_FUEL_LEVEL, 1},
  {PID_ENGINE_OIL_TEMP, 1},
  {PID_ODOMETER, 4},
  {PID_SPEED, 1},
  {PID_RPM, 1},
  {PID_THROTTLE, 1},
  {PID_ENGINE_LOAD, 1},
  {PID_FUEL_PRESSURE, 2},
  {PID_TIMING_ADVANCE, 2},
  {PID_COOLANT_TEMP, 3},
  {PID_INTAKE_TEMP, 3},
};
Anton Tananaev3 years ago

I think this is the relevant documentation on the format:

https://freematics.com/pages/hub/freematics-data-logging-format/

MiroMiro3 years ago

thanks.
will be driving tomorrow, so let's see what data I get :)
thanks

MiroMiro3 years ago

.. you are right

<entry key='filter.skipAttributes.enable'>true</entry>
<entry key='filter.skipAttributes'>alarm,event,status</entry>

is not needed
I found it in some of your older posts, so I thought it is this what I was missing.

works without it too. (can you maybe explain what the parameters do please - I know it's in the config documentation, but at least for me, is not really clear without and example :)

I also added

<entry key='event.overspeed.notRepeat'>true</entry>

otherwise the alerts fired every time the measurement was still over the trigger value (speed in this case).