Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

2PLUS_v3.2_b001
#4

(18-09-2017, 08:00)uncle_bob Wrote:  Is it enabled in the config?

I don't know since I never enabled or disabled it on this or previous versions.

I did a search for "version" and found this in the "NET" tab, but nothing in the config tab

//---------------------------------------------------------
//     Software Version Checker
//---------------------------------------------------------
#if (Enable_Internet == 1)
void check_SoftwareVersion()
{
  static uint8_t mux_id = 4;
  String DevModel = String(Board_Version / 10.0, 1) + "-" + DeviceModel;
  char HTTP_response[250];
  memset(HTTP_response, 0, sizeof(HTTP_response));

String Data = "GET /WD_services/VCheck/LastVersionCheck.php?";
  Data += "ID=";
  Data += DevID;
  Data += "&model=";
  Data += DevModel;
  Data += "&softver=";
  Data += SoftwareVer;
  Data += "&lt=";
  Data += String(LATITUDE, 3);
  Data += "&lg=";
  Data += String(LONGITUDE, 3);
  Data += " HTTP/1.0\r\n";
  Data += "Host: ";
  Data += "weatherduino.com";
  Data += "\r\n";
  Data += "Connection: close\r\n\r\n";

// Create connection with the WeatherDuino Server
  if (wifi.createTCP(mux_id, "weatherduino.com", 80, 0))
  {
    #ifdef PRINT_DEBUG_VCHECK
      Serial.println(F("Checking for latest software version..."));
    #endif
    const char *PacketToSend = Data.c_str();
    wifi.send(mux_id,(const uint8_t*)PacketToSend, strlen(PacketToSend));

    uint8_t buffer[250] = {0};
    uint16_t len = wifi.recv(mux_id, buffer, sizeof(buffer), 2000);
    if (len > 0)
     {
      for(uint16_t i = 0; i < len; i++)
       {
        HTTP_response[i] = (char)buffer[i];
       }
      char * content = strstr(HTTP_response, "\r\n\r\n");      
      if (content != NULL)
       {
        content += 4;
        LatestSoftwareVersion = content;
        //VCheck = true;
        #ifdef PRINT_DEBUG_VCHECK
          Serial.print(F("Latest software version: ")); Serial.println(LatestSoftwareVersion);
        #endif
       }
     }
  }
  wifi.releaseTCP(mux_id);
}

#endif
//=========================================================================================
Reply


Messages In This Thread
2PLUS_v3.2_b001 - by danner - 18-09-2017, 06:48
RE: 2PLUS_v3.2_b001 - by danner - 18-09-2017, 07:01
RE: 2PLUS_v3.2_b001 - by werk_ag - 18-09-2017, 18:41
RE: 2PLUS_v3.2_b001 - by uncle_bob - 18-09-2017, 08:00
RE: 2PLUS_v3.2_b001 - by danner - 18-09-2017, 08:38
RE: 2PLUS_v3.2_b001 - by hornychz - 18-09-2017, 08:52
RE: 2PLUS_v3.2_b001 - by danner - 18-09-2017, 09:29
RE: 2PLUS_v3.2_b001 - by uncle_bob - 18-09-2017, 09:49
RE: 2PLUS_v3.2_b001 - by uncle_bob - 18-09-2017, 10:05
RE: 2PLUS_v3.2_b001 - by uncle_bob - 18-09-2017, 10:10
RE: 2PLUS_v3.2_b001 - by hornychz - 18-09-2017, 10:34
RE: 2PLUS_v3.2_b001 - by danner - 18-09-2017, 10:39
RE: 2PLUS_v3.2_b001 - by hornychz - 18-09-2017, 10:46
RE: 2PLUS_v3.2_b001 - by qldbureau - 18-09-2017, 11:51
RE: 2PLUS_v3.2_b001 - by werk_ag - 18-09-2017, 15:39
RE: 2PLUS_v3.2_b001 - by danner - 18-09-2017, 19:59
RE: 2PLUS_v3.2_b001 - by danner - 19-09-2017, 02:24
RE: 2PLUS_v3.2_b001 - by werk_ag - 19-09-2017, 02:39
RE: 2PLUS_v3.2_b001 - by danner - 19-09-2017, 04:51



Users browsing this thread: 1 Guest(s)