Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By Joe Job
#52257 I am using a 12f and attempting to get HTTP Update sorted. I have asked for help with it on Github but it seems more active here. With the following code I am getting:

HTTP_UPDATE_FAILED Error (-1): HTTP error: connection refused

Code: Select all
void setup() {
 
  Serial.begin(9600);
  delay(10);
  Serial.println(F("System Initiating..."));
  client.setServer(mqtt_server,mqttPort);
  pinMode(powerPin, OUTPUT);
  readSpiffs();
 
  if ( esid != "" ) {
   
      WiFi.begin(esid.c_str(), epass.c_str());
     
      if (checkWifiConnection()) {
       
        serverType = "WC";
        Serial.println(F("Successfully connected to WiFi"));     
       
        t_httpUpdate_return ret = ESPhttpUpdate.update("https://iot.techbubbletechnologies.com/updates/updater.php","","E1 D2 56 D8 9B 14 F2 8E 3D 36 D9 35 BC B3 4F 19 45 C1 97 98");
   
        switch(ret) {
             case HTTP_UPDATE_FAILED:
                Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
                Serial.println("");
                break;
   
            case HTTP_UPDATE_NO_UPDATES:
                Serial.println("HTTP_UPDATE_NO_UPDATES");
                break;
   
            case HTTP_UPDATE_OK:
                Serial.println("HTTP_UPDATE_OK");
                break;
        }
     
        long rssi = WiFi.RSSI();
        digitalWrite(powerPin, HIGH);
        delay(1000);
        dht.begin();
        delay(2);
       
        return;
       
      }
  }


I have removed any HTACCESS redirects on that folder and the SHA1 is correct, any ideas guys, getting pretty frustrated with this one :D At the moment the page in question is just returning the NO UPDATES header yet it is returning connection denied.
User avatar
By martinayotte
#52275 Currently, your server is responding a HTTP Error 304, which is HTTP_CODE_NOT_MODIFIED, therefore Updater returns HTTP_UPDATE_NO_UPDATES.
Did you check on the server side if there any reason for this Error 304 ?
Did you also tried without SSL (although I've tried with wget and still returning 304) ?
User avatar
By Joe Job
#52282
martinayotte wrote:Currently, your server is responding a HTTP Error 304, which is HTTP_CODE_NOT_MODIFIED, therefore Updater returns HTTP_UPDATE_NO_UPDATES.
Did you check on the server side if there any reason for this Error 304 ?
Did you also tried without SSL (although I've tried with wget and still returning 304) ?


I mentioned that I set it to respond with that response but when using the code above updater does not respond with this it responds with connection refused. I cannot try without SSL the server is secure and has an A+ Qualys rating (Higher than Google and Facebook ;) ) and includes PFS, HSTS etc. Unencrypted communication is not possible.
Last edited by Joe Job on Sat Aug 06, 2016 11:48 am, edited 1 time in total.
User avatar
By Joe Job
#52292
martinayotte wrote:Currently, your server is responding a HTTP Error 304, which is HTTP_CODE_NOT_MODIFIED, therefore Updater returns HTTP_UPDATE_NO_UPDATES.
Did you check on the server side if there any reason for this Error 304 ?
Did you also tried without SSL (although I've tried with wget and still returning 304) ?


Bit of extra info the broker is on the same domain and no issues connecting securely there:

System Initiating...
Mounted file system!
Waiting for Wifi to connect...
......Successfully connected to WiFi
HTTP_UPDATE_FAILD Error (-1): HTTP error: connection refused
CURRENT BATTERY: 2.89
30.00
56.00
Attempting connection to TechBubble IoT JumpWay...
Connected to TechBubble IoT JumpWay!