Page 1 of 1

Sending data manually from a browser to GpsGeateServer

Posted: Sun Dec 03, 2017 5:29 pm
by flash
i like to sending Data over a URL to my GpsGateServer
i use:

http://myserveradress:8008/GpsGate.aspx?longitude=34.2333&latitude=23.2222&altitude=34.0&username=tracker1&pw=1234

i get only: "Bad Request (Invalid Hostname)"

what do i wrong?

Re: Sending data manually from a browser to GpsGeateServer

Posted: Sun Dec 03, 2017 6:06 pm
by johan
You find the specifications here:

For device integration, start by taking a look at "GpsGate TrackerOne reference design" here: http://gpsgate.com/developer/gpsgate_trackerone

Re: Sending data manually from a browser to GpsGeateServer

Posted: Mon Dec 04, 2017 8:47 pm
by flash
Dear Johan

Thanks for your answer.
What means the dopple "d" in the "GpsGate TrackerOne Reference Design" (hhmmss.dd) ?

Best Regards
Martin

Re: Sending data manually from a browser to GpsGeateServer

Posted: Mon Dec 04, 2017 9:22 pm
by johan
hundreds os a second. You can leave that out.

Re: Sending data manually from a browser to GpsGeateServer

Posted: Tue Dec 05, 2017 4:40 pm
by flash
Thanks Johan

my next problem is:

from my device i get this: 59.341334, 18.059841
i convert it to: 5920.288024 N and 1803.354276 E

then i send it to the server with this URL:
?cmd=$FRCMD,353841084434703,_SendMessage,,5920.288024,N,1803.354276,E,100,,,051217,153906,1

the result on the server is: 59.33813, 18.05590

can you help me, please?

Regards
Martin

Re: Sending data manually from a browser to GpsGeateServer

Posted: Tue Dec 05, 2017 4:53 pm
by johan
Yes, your conversion to DDMM.mmmm is wrong.

Here you have a useful online converter that you can use to check your results. Useful for testing while developing your conversion further:

http://www.hiddenvision.co.uk/ez/

Re: Sending data manually from a browser to GpsGeateServer

Posted: Tue Dec 05, 2017 4:59 pm
by johan
Here is some C# code to convert from decimal degrees to NMEA (DDMM.mmmm)

Code: Select all

        static public string BuildNmeaCoordinate(double dblDegrees, int iLeftPadding, int iDecimals)
        {
            dblDegrees = Math.Abs(dblDegrees);

            int iDegrees = (int)dblDegrees;
            double dblMinutes = (dblDegrees - (double)iDegrees) * 60.0;

            int iMinutes = (int)dblMinutes;
            double dblFracMinutes = (dblMinutes - (double)iMinutes);

            // Be safe from rounding errors
            if (iMinutes >= 60)
            {
                iMinutes = 59;
                iDegrees += 1;
            }

            if (iMinutes < 0)
            {
                iMinutes = 0;
                iDegrees -= 1;
            }

            double dblNmea = (double)iDegrees * 100 + (double)iMinutes + dblFracMinutes;

            return BuildNmeaDouble(dblNmea, iLeftPadding, iDecimals);
        }

        static public string BuildNmeaDouble(double dblValue, int iLeftPadding, int iDecimals)
        {
            // Always include a 0.
            iLeftPadding = iLeftPadding == 0 ? 1 : iLeftPadding;

            string strZeros = "0000000000000000";
            return dblValue.ToString(strZeros.Substring(0, iLeftPadding) + "." + strZeros.Substring(0, iDecimals), NumberFormatInfo.InvariantInfo);
        }

Re: Sending data manually from a browser to GpsGeateServer

Posted: Wed Dec 06, 2017 8:45 am
by flash
Dear Johan

many thanks for your help.
it works now!

Regards
Martin