• Resolved ixzdoreagada

    (@ixzdoreagada)


    I want to write my own tracking mobile app. This app is to send information tagged with latitude, longitude,speed etc to TrackServer. I am confused about how to send the data. There is no documentation on how to package and send data to TrackServer. The tagged information will be displayed when the marker is clicked on.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tinuzz

    (@tinuzz)

    Hi,

    Indeed, there is no real documentation for that. That is because Trackserver mainly works with 3rd party apps, and the protocols that are used to transport the data are defined by them, and not by Trackserver.

    As such, Trackserver supports quite a few different ways to get data into it. The biggest requirement is, that it has to be over HTTP(S), which is a limit imposed by the fact that it’s a WordPress plugin. There are protocols that use HTTP GET and HTTP POST, and the latter comes in different flavors: some use JSON, some use XML, some just use multipart/form-data. Some use HTTP basic auth and others use more sophisticated authentication methods. Some have a notion of tracks, others only send locations and let Trackserver do the rest.

    I’m afraid I have to refer you to the source code for actual information.

    Trackserver figures out the protocol to use by doing some heuristics on the incoming request. See https://github.com/tinuzz/wp-plugin-trackserver/blob/master/class-trackserver.php#L482 for the parse_request() function that does this.

    Then, it delegates the request to a protocol-specific request handler (https://github.com/tinuzz/wp-plugin-trackserver/blob/master/class-trackserver.php#L596)

    I can’t make any recommendations, but the ‘getrequest’ protocol with HTTP basic auth is the simplest approch. Note that it doesn’t support creating tracks from the client. If you need ‘create track’ support in the client, look at the uLogger protocol (https://github.com/tinuzz/wp-plugin-trackserver/blob/master/class-trackserver-ulogger.php).

    I hope this helps.

    Martijn.

    Thread Starter ixzdoreagada

    (@ixzdoreagada)

    From the look of things that requires doing modification to trackserver itself or emulating one of the protocols. I will investigate.

    wolfgang61

    (@wolfgang61)

    I did once write such a tracker for android. It got bitrotten and probably does not work anymore on latest Android, but it might give you some ideas.

    https://gitlab.com/wrohdewald/gpsforwarder

    Main plusses:

    • can talk to Trackserver
    • try to be as reliable as possible
    • use as little power as possible
    • minimize data transfer, so NO http
    • no limits about how many points to transfer
    • many config options in the GUI
    • extensive and configurable logging in the GUI

    It still rarely hangs and I have to kill the app – which will lose points but after restarting, the same track recording will automatically continue.

    I would really like to bring it up to date but have currently no time. You are very welcome to have a look at it.

    My usage: I have my own mapmytracks server which receives data from Android and forwards it to several sinks like local storage or Trackserver. But the app can also send directly to Trackserver.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create My Own Mobile Tracker’ is closed to new replies.