Closed fm500 closed 9 years ago
Probably there is some API you need to call to send notifications, but because Traccar works with OpenGTS system through database only, there is no way to do it.
You can try to ask on OpenGTS forums to explain how this feature works.
http://sourceforge.net/p/opengts/discussion/579835/thread/e51238ef/
I posted it here, no reply.
The problem is it's handled at the DCS server level, the "receiver" invokes the event rules when it detects that the position update moves in/out of a Geozone. With Traccar, we're bypassing the DCS server and hitting the DB server directly. Hypothetically, if traccar impersonated a tk102b and submitted it via TCP to opengts using tk102b instead of hitting the DB, it would work fine.
I'm thinking the only way to actually do this reliably is for someone to code a stand alone module that just reads the Geozones out of the DB, and as a once a minute cronjob just sees what in its records has moved in/out of such a zone. Not very scalable I guess, but should work fine for a few hundred devices anyways.
I'm open for any last ditch ideas and certainly appreciate all your input. However at this point, I think it's beyond my capabilities.
Does OpenGTS support any HTTP-based protocol?
There appears to be one called "gprmc". I know the formatting here is bad, so please see the top of page 36 here: http://opengts.sourceforge.net/OpenGTS_Config.pdf
9.1.2) Default "gprmc" Configuration: The default "gprmc" cofiguration (with no special configuration changes made in the "webapp.conf" file) expects a http-based URL formatted as follows: (the URL below displays the various fields on separate lines, but is normally sent to the server as a single URL all on a single line): http://example.com:8080/gprmc/Data? id=123456789012345& code=0xF020& gprmc=$GPRMC,080701.00,A,3128.7540,N,14257.6714,W,000.0,000.0,180707,,,A_1C Where http://example.com:8080/gprmc/Data? Represents the host:port ("example.com:8080") and "gprmc.war" servlet location ("/gprmc/Data?") 123456789012345 Represents the unique mobile ID of the device (such as the IMEI#). (This value should be entered into the "Device Admin" page "Unique ID" field in the format "gprmc_123456789012345"). 0xF020 Represents the status code used for identifying the reason for the event. The status code used here should match the hex, or decimal value of a status code listed in the "Status Codes and Descriptions" manual at the following location: http://www.geotelematic.com/docs/StatusCodes.pdf In addition to one of the above hex/decimal status codes, any of the following text code names may also be used, which will automatically be converted into it's corresponding hex-based status code when it is entered into the EventData table: GPS, PANIC, WAYMARK, etc, (see gprmc source module "Data.java" for a current list). $GPRMC,080701.00,A,3128.7540,N,14257.6714,W,000.0,000.0,180707,,,A_1C Represents the NMEA-0183 $GPRMC record straight from the GPS receiver.
I don't like NMEA format. Ideally it should be something like OsmAnd protocol: https://www.traccar.org/osmand/
I appreciate your assistance and reply. I have done some research and currently this is the only DCS that OpenGTS has that is HTTP-based and included in the open source version.
Where can I find all DCS options available for OpenGTS?
Section 8.1 here lists some (PDF page 30): http://opengts.sourceforge.net/OpenGTS_Config.pdf
Most TK102/TK103 tracking devices (using the common TK102/TK103 protocols). Astra Telematics AT240, AT110, AT210 Sanav GC-101, MT-101, and CT-24 Personal Tracker (HTTP-based protocol) Sanav GX-101 Vehicle Tracker (HTTP-based protocol) CelltracGTS™/Free for Android phones CelltracGTS™/Pro for Android phones Aspicore GSM Tracker (Nokia, Samsung, Sony Ericsson phones) TAIP (Trimble ASCII Interface Protocol). TrackStick GPS data logger "GPSMapper" capable phones. "NetGPS" capable devices.
How about the Sanav GC-101 http protocol? Or does this have the same GPRMC problem?
Format:
IMEI=IMEI Number&rmc=$GPRMC,
I have implemented HTTP forwarding. Now you can put something like this in the config file:
<entry key='forward.enable'>true</entry> <entry key='forward.url'>http://example.com:8080/gprmc/Data?id={uniqueId}&code=0x0000&gprmc={gprmc}</entry>
hi tananaev,
sorry to bring this up again, i've tried adding this (changed only the domain though) to the traccar.xml file just in the server config section. but had no success. mind guiding me a bit?
<entry key='forward.enable'>true</entry>
<entry key='forward.url'>http://example.com:8080/gprmc/Data?id={uniqueId}&code=0x0000&gprmc={gprmc}</entry>
Thank you :)
Have you changed the URL to point to your OpenGTS server?
yes, i have.
So this is how it looks.
<!-- SERVER CONFIG -->
<entry key='web.enable'>false</entry>
<entry key='web.port'>8082</entry>
<entry key='web.path'>/opt/traccar/web</entry>
<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.type'>google</entry>
<entry key='logger.enable'>true</entry>
<entry key='logger.level'>all</entry>
<entry key='logger.file'>/opt/traccar/logs/tracker-server.log</entry>
<entry key='event.enable'>true</entry>
<entry key='event.suppressRepeated'>60</entry>
<entry key='event.overspeedHandler'>true</entry>
<entry key='event.globalSpeedLimit'>90</entry>
<entry key='event.motionHandler'>true</entry>
<entry key='event.geofenceHandler'>true</entry>
<entry key='forward.enable'>true</entry>
<entry key='forward.url'>http://192.89.150.56:8080/gprmc/Data?id={uniqueId}&;code=0x0000&;gprmc={gprmc}</entry>
Have you tried to submit data to that URL manually and see if it works?
hi, thanks for your response.
http://myip:8080/gprmc/Data acct=iceman&dev=op3&gprmc=$GPRMC,041532,A,3128.7540,N,14257.6714,W,000.0,000.0,280916,,*5 [gprmc=$GPRMC,041532,A,3128.7540,N,14257.6714,W,000.0,000.0,280916,,*5&dev=op3&acct=iceman]
so the above is a url sent from GPS2OpenGTS android application. and it seems to work fine..
I cannot fathom how to add manual values to the url you have used.
That's not a valid URL and also it doesn't match the configuration that you are using for Traccar.
Can you please use proper formatting for stuff that you put in the comments.
Hello Mr. Anton, i tested it and its working for geo-fence / geo-zone email notification, but any idea how to pass the info from : ExtractValue(:extended_info, '/info/battery') / 100 (Its successfuly being inserted on the Column 'batteryLevel' on the 'EventData' table from OpenGTS database.) is it possible to pass that info to forward.url? I tried:
<entry key='forward.url'>http://127.0.0.1:8080/gprmc/Data?id={uniqueId}&code=0x0000&batt={batteryLevel}&gprmc={gprmc}</entry>
But no success =/ Thanks for any help
@esteves67
<entry key='forward.enable'>true</entry>
Sorry for my mistake, didnt saw it was closed :x
If I update a device's location via traccar to GTS, the gui is perfectly fine but the e-mail notifications on a Geozone arrival/departure (geofencing e-mail notification) does not invoke nor work.
If I use a OpenGTS DCS server, for the same device, this notification works ok.
Is there any way to make Traccar perform whatever process the OpenGTS DCS does when it receives a message so these e-mails work? Or, does anybody know where to start looking to make this work?