Gps tracker con traccar server

Estoy en un proyecto y me gustaria me ayuden a terminarlo..

En sintesis es un Gps Tracker con Arduino One y SIM808 como modulo Gprs/Gps

lo que tengo avanzado hasta ahora es el siguiente codigo pero como el protocolo que quiero utilizar es OsmAnd no estoy pudiendo generar la cadena como debe ser.. segun el protocolo debe ser asi:

  OsmAnd Live Tracking web address format:

http://demo.traccar.org:5055/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5}
where:

demo.traccar.org – server address or domain name (e.g., it can be your server public IP address)
123456 – your device unique identifier (e.g., IMEI number)

EL CODIGO IDE

#include<SoftwareSerial.h>



extern uint8_t SmallFont[];

#define rxPin 7
#define txPin 8

int powersoft = 9;



SoftwareSerial mySerial(rxPin, txPin);

char inChar = 0;

int8_t answer;
char aux_str[100];

char url[] = "mi ip:puerto";
char frame[200];
char response[100];

char latitude[15];
char longitude[15];
char altitude[16];
char date[24];
char TTFF[3];
char satellites[3];
char speedOTG[10];
char course[15];

//**********************************************************************************************************
void setup(){
    mySerial.begin(9600);
    Serial.begin(9600); 
    pinMode(powersoft,OUTPUT);
    
    Serial.println("Starting...");
    power_on();

    // starts the GPS and waits for signal
    start_GPS();

    while (sendATcommand("AT+CREG?", "+CREG: 0,1", 2000) == 0);

    sendATcommand("AT+SAPBR=3,1,\"Contype\",\"GPRS\"", "OK", 2000);
    sendATcommand("AT+SAPBR=3,1,\"APN\",\"internet\"", "OK", 2000);
    sendATcommand("AT+SAPBR=3,1,\"USER\",\"\"", "OK", 2000);
    sendATcommand("AT+SAPBR=3,1,\"PWD\",\"\"", "OK", 2000);
    
    // gets the GPRS bearer
    while (sendATcommand("AT+SAPBR=1,1", "OK", 20000) == 0)
    {
      delay(5000);
    }
   // while (sendATcommand("AT+SAPBR=1,1", "ERROR", 20000) == 0)
  // {

   //  sendATcommand("AT+SAPBR=1,0", "OK", 20000);
   

   //  return power_on;
   //}
}


void loop(){

    // gets GPS data
    get_GPS();
    
    // sends GPS data to the script
    send_HTTP();
    
    //sendNMEALocation("81596199",frame);
    //delay(3000);
}

//**************************************************************************************
void power_on(){

    uint8_t answer=0;

    // checks if the module is started
    
    }
   
//************************************************************************************
int8_t start_GPS(){

    unsigned long previous;
    
    sendATcommand("AT+CIPSHUT", "OK", 2000);
    previous = millis();
    // starts the GPS
    while(sendATcommand("AT+CGPSPWR=1", "OK", 2000)==0);
    while(sendATcommand("AT+CGPSRST=0", "OK", 2000)==0);
    delay(2000);

    // waits for fix GPS
    while(( (sendATcommand("AT+CGPSSTATUS?", "2D Fix", 5000) || 
        sendATcommand("AT+CGPSSTATUS?", "3D Fix", 5000)) == 0 ) );

    return 1;
}

int8_t get_GPS(){
    char * auxChar;
    // request Basic string
    sendATcommand("AT+CGPSINF=0", "OK", 8000);
 
   

    auxChar = strstr(response, "+CGPSINF:");
    if (auxChar != NULL)    
    {
         // Parses the string 
      memset(longitude, '\0', 15);
      memset(latitude, '\0', 15);
      memset(altitude, '\0', 16);
      memset(date, '\0', 24);
     // memset(TTFF, '\0', 3);
      //memset(satellites, '\0', 3);
      memset(speedOTG, '\0', 10);
     // memset(course, '\0', 15);
    
      strcpy (response, auxChar);
      Serial.println(response);
      
      strtok(response, ",");
      strcpy(longitude,strtok(NULL, ",")); // Gets longitude
      strcpy(latitude,strtok(NULL, ",")); // Gets latitude
      strcpy(altitude,strtok(NULL, ",")); // Gets altitude    
      strcpy(date,strtok(NULL, ",")); // Gets date
      //strcpy(TTFF,strtok(NULL, ","));  
      //strcpy(satellites,strtok(NULL, ",")); // Gets satellites
      strcpy(speedOTG,strtok(NULL, ",")); // Gets speed over ground. Unit is knots.
      //strcpy(course,strtok(NULL, "\r")); // Gets course

      answer = 1;
    }
    else
    
      answer = 0;

    return answer;
}

void sendNMEALocation(char * cellPhoneNumber, char * message) 
{ 
    char ctrlZString[2];  
    char sendSMSString[100];    
    
    // Started sendNMEALocation.
    memset(ctrlZString, '\0', 2);
    ctrlZString[0] = 26;  
    
    memset(sendSMSString, '\0', 100); 
    sprintf(sendSMSString,"AT+CMGS=\"%s\"",cellPhoneNumber);            
     
    // request Basic string
    sendATcommand(sendSMSString, ">", 2000);
    mySerial.println(message);
    sendATcommand(ctrlZString, "OK", 6000); 
    //Ended sendNMEALocation.
    
} 

void send_HTTP(){
    
    // Initializes HTTP service
    answer = sendATcommand("AT+HTTPINIT", "OK", 10000);
    if (answer == 1)
    {
        // Sets CID parameter
        answer = sendATcommand("AT+HTTPPARA=\"CID\",1", "OK", 5000);
        if (answer == 1)
        {
            // Sets url 
            char url[] = "mi ip:5055";
            memset(aux_str, '\0', 100);
            sprintf(aux_str, "AT+HTTPPARA=\"URL\",\"%s", url);
            //limpar antesLIMPAR ANTES
            mySerial.print(aux_str);
            Serial.println(aux_str);
            memset(frame, '\0', 200);
            sprintf(frame, "/?id=12345&lat=%s&lon=%s&timestamp=%s&altitude=%s&speed=%s", latitude, longitude, date, altitude, speedOTG);
            Serial.println(frame);
            mySerial.print(frame);
            
            answer = sendATcommand("\"", "OK", 5000);
            if (answer == 1)
            {
                // Starts GET action
                answer = sendATcommand("AT+HTTPACTION=0", "+HTTPACTION: 0,200", 30000);
                if (answer == 1)
                {

                    Serial.println(F("Done!"));
                }
                else
                {
                    Serial.println(F("Error getting url"));
                }

            }
            else
            {
                Serial.println(F("Error setting the url"));
            }
        }
        else
        {
            Serial.println(F("Error setting the CID"));
        }    
    }
    else
    {
        Serial.println(F("Error initializating"));
    }

    sendATcommand("AT+HTTPTERM", "OK", 5000);
    
}


int8_t sendATcommand(char* ATcommand, char* expected_answer1, unsigned int timeout){

    uint8_t x=0,  answer=0;
    unsigned long previous;
    char readVar[100];
    char * auxChar;
    

    memset(response, '\0', 100);    // Initialize the string
    memset(readVar, '\0', 100);    // Initialize the string

    while( mySerial.available() > 0) mySerial.read();    // Clean the input buffer
    while( Serial.available() > 0) Serial.read();    // Clean the input buffer
 
    mySerial.write(ATcommand);    // Send the AT command 
    mySerial.write("\r\n\r\n");    // Send enter
    
    Serial.println(ATcommand);
    
 
    x = 0;
    previous = millis();

    // this loop waits for the answer
    do{
        if(mySerial.available() != 0){    
            readVar[x] = mySerial.read();
            x++;
            // check if the desired answer is in the response of the module
            auxChar = strstr(readVar, expected_answer1);
            if (auxChar != NULL)    
            {
                if( strstr(readVar, "+CGPSINF:") == NULL)
                  strcpy (response, auxChar);
                else
                  strcpy (response, readVar);
                
                Serial.println(response);  
                answer = 1;
            }
        }
        // Waits for the asnwer with time out
    }
    while((answer == 0) && ((millis() - previous) < timeout));  

    if(auxChar == NULL)
      Serial.println(readVar);
    
    return answer;
}

en el serial:

OK

AT+CGPSSTATUS?
AT+CGPSSTATUS?


+CGPSSTATUS: Location Not Fix

OK

AT+CGPSSTATUS?
AT+CGPSSTATUS?


+CGPSSTATUS: Location 2D Fix

OK

AT+CGPSSTATUS?
2D Fix
AT+CREG?
+CREG: 0,1
AT+SAPBR=3,1,"Contype","GPRS"
OK
AT+SAPBR=3,1,"APN","internet"
OK
AT+SAPBR=3,1,"USER",""
OK
AT+SAPBR=3,1,"PWD",""
OK
AT+SAPBR=1,1
OK
AT+CGPSINF=0
AT+CGPSINF=0


+CGPSINF: 0,2516.716000,5730.062900,135.000000,20170301184137.000,0,5,1.000080,186.190002

OKè‘Èaî¾¼ÊüÞ÷oÿ¯<qþøŒÅÏ


+CGPSINF: 0,2516.716000,5730.062900,135.000000,20170301184137.000,0,5,1.000080,186.190002

O
AT+HTTPINIT
OK
AT+HTTPPARA="CID",1
OK


"

y ahi queda colgado es por que esta en NMEA
si alguien tiene algo echo si me ayudan les estare agradecido!!

De acuerdo a un código que vi la secuencia debería ser

char path[200]; 
    sprintf(path,"/?id=%s&lat=%2.6f&lon=%3.6f&altitude=%d&speed=%d",USERID,MyGPSPos.latitude, MyGPSPos.longitude,MyGPSPos.alt,MyGPSPos.spd);

Evidentemente este caso involucra un procesador mas avanzado que el que tu estas usando porque esto %2.6f no se permito o sea 2 digitos enteros y 6 digitos de mantisa para el float.
Pero veamos lo positivo y comparemos con tu caso.

sprintf(frame, "/?id=12345&lat=%s&lon=%s&timestamp=%s&altitude=%s&speed=%s", latitude, longitude, date, altitude, speedOTG);

el buffer esta bien.
USERID en ambos casos esta bien
lat y long luego verificaré que envias
tu envias timestamp y el envia altitude y speed
timestamp no esta en el caso de esta ejemplo.

Ahora las coordenas las convierte de este modo

void convertCoords(float latitude, float longitude, float &lat_return, float &lon_return){
	int lat_deg_int = int(latitude/100);		//extract the first 2 chars to get the latitudinal degrees
	int lon_deg_int = int(longitude/100);		//extract first 3 chars to get the longitudinal degrees
    // must now take remainder/60
    // this is to convert from degrees-mins-secs to decimal degrees
    // so the coordinates are "google mappable"
    float latitude_float = latitude - lat_deg_int * 100;		//remove the degrees part of the coordinates - so we are left with only minutes-seconds part of the coordinates
    float longitude_float = longitude - lon_deg_int * 100;     
    lat_return = lat_deg_int + latitude_float / 60 ;			//add back on the degrees part, so it is decimal degrees
    lon_return = lon_deg_int + longitude_float / 60 ;
}

Te dejo la fuente (Linkit-ONE-Traccar-Client) para tu análisis.

Muchas gracias revisare todo y si tengo avances lo publicare..

algun avance con este projecto? yo estoy usando el Arduino UNO con el Adafrut FONA 808 que tiene integrado el SIM808. estoy intentando mandar SMS commands desde traccar usando el SMPP protocol al SIM808 para activar el gps y que mande data por un tiempo definido y luego apagar la antena del gps denuevo con otro comando sms para ahorrar bateria.

fueron capaces de connectar el modulo a traccar?