FlashWebIT / ROTI

Romanian Open Transit Initiative - repository of official, reverse engineered and converted transit resources which give you programmatic access to static (scheduled) or real-time data (positions, updates etc.)
https://flashwebit.github.io/ROTI/
Do What The F*ck You Want To Public License
9 stars 2 forks source link

[Wiki: transitime installation guide] How is the integration done with the Traccar platform? #3

Open engalissongomes opened 2 years ago

BodoMinea commented 2 years ago

The Wiki guide is based on the assumption that the GPS positions are coming from a GTFS-Realtime feed.

In order to get GPS data from Traccar, assuming that you already have it installed and running somewhere, you need to change the agency config "AGENCY.xml" during the Configuring the transitime cores step as follows:

<?xml version="1.0" encoding="UTF-8"?>
<transitclock>
    <modules>
        <optionalModulesList>org.transitclock.core.schedBasedPreds.SchedBasedPredsModule;org.transitclock.custom.traccar.TraccarAVLModule</optionalModulesList>
    </modules>
    <autoBlockAssigner><autoAssignerEnabled>true</autoAssignerEnabled></autoBlockAssigner>
    <core>
        <agencyId>GTFS AGENCY ID</agencyId>
    </core>
    <avl>
        <!-- URL for traccar realtime vechicle tracker stream -->
        <traccar>
                <baseurl>http://localhost:8082 - or whatever your traccar instance address is</baseurl>
                <email>access_email_for_traccar</email>
                <password>access_password_for_traccar</password>
        </traccar>
        <minLatitude>COMPLETE FOR YOUR AREA - these fit all of Romania! 43.82247</minLatitude>
        <minLongitude>COMPLETE FOR YOUR AREA - these fit all of Romania! 20.40503</minLongitude>
        <maxLatitude>COMPLETE FOR YOUR AREA - these fit all of Romania! 47.96214</maxLatitude>
        <maxLongitude>COMPLETE FOR YOUR AREA - these fit all of Romania! 28.64511</maxLongitude>
    </avl>
   <db>
        <dbName>DB-NAME</dbName>
        <dbHost>DB-HOST:DB-PORT</dbHost> (localhost:3306)
        <dbType>DB-TYPE</dbType> (mysql)
        <dbUserName>DB-USER</dbUserName>
        <dbPassword>DB-PASSWOWRD</dbPassword>
    </db>
    <hibernate>
        <configFile>/usr/local/transitclock/config/hibernate_AGENCY.cfg.xml</configFile>
    </hibernate>
<web>
        <mapTileUrl>https://tile.openstreetmap.org/{z}/{x}/{y}.png</mapTileUrl>
    </web>
</transitclock>

Tips: check that the traccar URL is valid before running with this config by running something like curl http://localhost:8082

P.S.: this project/wiki is just a "log" of my personal experience deploying transitime, it's not the official project repo or support page. If something isn't working, although I'll do my best to help you, maybe it's better to ask over at https://github.com/TheTransitClock/transitime/issues

engalissongomes commented 2 years ago

good night, i tried in the other group but they didn't respond, i'm trying to implement transitime-docker and traccar, i have little experience, i've tried it in my country and i didn't find anyone, i need to know which files i edit.