flash
Posts: 4
Joined: Mon Oct 08, 2007 9:23 pm
Location: Switzerland
Contact: Website

Sending data manually from a browser to GpsGeateServer

Sun Dec 03, 2017 5:29 pm

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?

User avatar
johan
GpsGate
Posts: 14310
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Sending data manually from a browser to GpsGeateServer

Sun Dec 03, 2017 6:06 pm

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
Regards,
Johan

GpsGate Support

flash
Posts: 4
Joined: Mon Oct 08, 2007 9:23 pm
Location: Switzerland
Contact: Website

Re: Sending data manually from a browser to GpsGeateServer

Mon Dec 04, 2017 8:47 pm

Dear Johan

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

Best Regards
Martin

User avatar
johan
GpsGate
Posts: 14310
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Sending data manually from a browser to GpsGeateServer

Mon Dec 04, 2017 9:22 pm

hundreds os a second. You can leave that out.
Regards,
Johan

GpsGate Support

flash
Posts: 4
Joined: Mon Oct 08, 2007 9:23 pm
Location: Switzerland
Contact: Website

Re: Sending data manually from a browser to GpsGeateServer

Tue Dec 05, 2017 4:40 pm

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

User avatar
johan
GpsGate
Posts: 14310
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Sending data manually from a browser to GpsGeateServer

Tue Dec 05, 2017 4:53 pm

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/
Regards,
Johan

GpsGate Support

User avatar
johan
GpsGate
Posts: 14310
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Sending data manually from a browser to GpsGeateServer

Tue Dec 05, 2017 4:59 pm

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);
        }
Regards,
Johan

GpsGate Support

flash
Posts: 4
Joined: Mon Oct 08, 2007 9:23 pm
Location: Switzerland
Contact: Website

Re: Sending data manually from a browser to GpsGeateServer

Wed Dec 06, 2017 8:45 am

Dear Johan

many thanks for your help.
it works now!

Regards
Martin

Return to “GpsGate for Developers”