Author Topic: Geogram data records on a Google Map  (Read 3131 times)

Offline criegel

  • Newbie
  • *
  • Posts: 1
Geogram data records on a Google Map
« on: October 15, 2013, 02:48:27 PM »
Hi,

I've made an alternative to GPS-Trace Orange that shows Geogram data on a Google Map with a few tables.  One of the drivers for doing this was to get the battery's state of charge and to be able to group the assets being tracked into groups.  Here's the link:

http://gps.protovoltaics.com/

Feel free to try it out and give feedback, but use at your own risk.  This is being offered to you for free, so please don't expect support or features to be added.

You'll want to start by making a group for your tracking devices: Tracker | "New Asset Group" on the menubar, and then give the info for your tracker: Tracker | "New Asset".  Once you enter all of the data you should be able to see your device in the asset table and on the map.

To use the above website you'll want to add the battery status to the end of the data being sent in the UDP_Orange.pde file (the part to change is in bold blue text below):

   GSM.print(lastValid.course);
   GSM.print(";");
   GSM.print(lastValid.altitude);
   GSM.print(";");
   GSM.print(MAX17043getBatterySOC()/100,DEC);
   GSM.print(";");



You'll also have to change some of the parameters in the EEPROM data with the GO_V1_1_EEPROM_Program.pde file (again, part to change is in bold blue below):

   char gprsUser[25] = "";
   char gprsPass[25] = "";
   
   //char gprsHost[16] = "193.193.165.166"; //Server address for GPS-Trace Orange
   //char gprsHeader[11] = "#SD#";
   //char gprsReply[11] = "#ASD#1";
   //unsigned int gprsPort = 20332;
   
   char gprsHost[16] = "rdi.dyndns.biz";
   char gprsHeader[11] = ";";
   char gprsReply[11] = "ok";
   unsigned int gprsPort = 8777;


And further down in the file:

   Serial.print(GPRS_PORT);Serial.print(SPACE);   
   ninteger = gprsPort;

   if(w)EEPROM_writeAnything(GPRS_PORT,(uint16_t)ninteger); //GPRS port number
   Serial.print(ninteger,DEC);Serial.print(SPACE2);
   EEPROM_readAnything(GPRS_PORT,ninteger);Serial.println(ninteger,DEC);



Also, when you have multiple Geograms, I find it better to use the AT+GSN command to get the IMEI rather than have the IMEI in EEPROM.  I'm sure there's a more elegant way to do this but I just use the following function:

   uint8_t getIMEI() {
      char c;
      int index = 0;

      while(GSM.available()!=0)
         GSM.read();

      GSM.println("AT+GSN"); 
      do{
         while(GSM.available()==0);
         c=GSM.read();
         if( index < 15 && c >= '0' && c <= '9' ) {
            imei[index] = c;
            index++;
         }
      }
      while(c!='K');
      return c=='K';
   }


Then, make a global to store the IMEI:

   char imei[16] = "***************";

And call getIMEI() as the end of the setup() function.

With this you can use it in the UDP_Orange.pde file to use the contents of the imei global variable instead of the contents from the EEPROM:

   GSM.println("AT+CIPSEND");
   if(!sim900.confirmAtCommand(">",3000))
   {   
      //printEEPROM(IMEI);
      GSM.print(imei);

      printEEPROM(UDP_HEADER);


Let me know what you think,

- Chris

Offline DSS Circuits

  • Administrator
  • Sr. Member
  • *****
  • Posts: 421
Re: Geogram data records on a Google Map
« Reply #1 on: October 19, 2013, 09:27:33 AM »
Hi,

I've made an alternative to GPS-Trace Orange that shows Geogram data on a Google Map with a few tables.  One of the drivers for doing this was to get the battery's state of charge and to be able to group the assets being tracked into groups.  Here's the link:

http://gps.protovoltaics.com/

Feel free to try it out and give feedback, but use at your own risk.  This is being offered to you for free, so please don't expect support or features to be added.

You'll want to start by making a group for your tracking devices: Tracker | "New Asset Group" on the menubar, and then give the info for your tracker: Tracker | "New Asset".  Once you enter all of the data you should be able to see your device in the asset table and on the map.

To use the above website you'll want to add the battery status to the end of the data being sent in the UDP_Orange.pde file (the part to change is in bold blue text below):

   GSM.print(lastValid.course);
   GSM.print(";");
   GSM.print(lastValid.altitude);
   GSM.print(";");
   GSM.print(MAX17043getBatterySOC()/100,DEC);
   GSM.print(";");



You'll also have to change some of the parameters in the EEPROM data with the GO_V1_1_EEPROM_Program.pde file (again, part to change is in bold blue below):

   char gprsUser[25] = "";
   char gprsPass[25] = "";
   
   //char gprsHost[16] = "193.193.165.166"; //Server address for GPS-Trace Orange
   //char gprsHeader[11] = "#SD#";
   //char gprsReply[11] = "#ASD#1";
   //unsigned int gprsPort = 20332;
   
   char gprsHost[16] = "rdi.dyndns.biz";
   char gprsHeader[11] = ";";
   char gprsReply[11] = "ok";
   unsigned int gprsPort = 8777;


And further down in the file:

   Serial.print(GPRS_PORT);Serial.print(SPACE);   
   ninteger = gprsPort;

   if(w)EEPROM_writeAnything(GPRS_PORT,(uint16_t)ninteger); //GPRS port number
   Serial.print(ninteger,DEC);Serial.print(SPACE2);
   EEPROM_readAnything(GPRS_PORT,ninteger);Serial.println(ninteger,DEC);



Also, when you have multiple Geograms, I find it better to use the AT+GSN command to get the IMEI rather than have the IMEI in EEPROM.  I'm sure there's a more elegant way to do this but I just use the following function:

   uint8_t getIMEI() {
      char c;
      int index = 0;

      while(GSM.available()!=0)
         GSM.read();

      GSM.println("AT+GSN"); 
      do{
         while(GSM.available()==0);
         c=GSM.read();
         if( index < 15 && c >= '0' && c <= '9' ) {
            imei[index] = c;
            index++;
         }
      }
      while(c!='K');
      return c=='K';
   }


Then, make a global to store the IMEI:

   char imei[16] = "***************";

And call getIMEI() as the end of the setup() function.

With this you can use it in the UDP_Orange.pde file to use the contents of the imei global variable instead of the contents from the EEPROM:

   GSM.println("AT+CIPSEND");
   if(!sim900.confirmAtCommand(">",3000))
   {   
      //printEEPROM(IMEI);
      GSM.print(imei);

      printEEPROM(UDP_HEADER);


Let me know what you think,

- Chris
Looking forward to trying this out!  As for not using the AT+GSN, that was purposely done by design.  I've actually heard of some GPS servers locking out IMEI numbers if someone else buys a used a device and tries to register for a new account.  This gives the option of modifying the ID as well.