Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response coming as No content even though curl giving right results #55

Closed
shariq-azim opened this issue May 21, 2021 · 1 comment
Closed

Comments

@shariq-azim
Copy link

shariq-azim commented May 21, 2021

Hello Devs.
I was trying your library with simple example of yours and with json body as you prescribed but not getting results.

The file is hosted through my mobile using an application on port 12345
The bin file is available at http://192.168.0.6:12345/fota_chris_original.ino.esp32.bin

I have done curl to get response like this:

D:\developement\Python3>curl -i http://192.168.0.6:12345/fota_chris_original.ino
.esp32.bin
HTTP/1.1 200 OK
Last-Modified: Fri, 21 May 2021 17:42:36 GMT
Date: Fri, 21 May 2021 18:14:08 GMT
Server: SimpleHttpServer/1.1
Content-Length: 891248
Content-Type: application/octet-stream

Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output

The json file looks like this and can be available as
http://192.168.0.6:12345/fota.json

JSON

{
    "type": "esp32-fota-http",
    "version": 2,
    "host": "192.168.0.6:12345",
    "port": 12345,
    "bin": "/fota_chris_original.ino.esp32.bin"
}

As you can see I have even not used extra http there

  • Arduino board: ESP32

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.10

code is below


#include <esp32fota.h>
#include <WiFi.h>

// Change to your WiFi credentials
const char *ssid = "xxxx";
const char *password = "xxxxx";

esp32FOTA esp32FOTA("esp32-fota-http", 1);

void setup()
{
  esp32FOTA.checkURL = "http://192.168.0.6:12345/fota.json";
  Serial.begin(115200);
  setup_wifi();
}

void setup_wifi()
{
  delay(10);
  Serial.print("Connecting to my wifi");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println(WiFi.localIP());
}

void loop()
{

  bool updatedNeeded = esp32FOTA.execHTTPcheck();
  if (updatedNeeded)
  {
    esp32FOTA.execOTA();
  }

  delay(2000);
}

But the response is strange and similar to that mentioned in
#1 , #34 , #32

image

Btw, my webserver is logging a get request every few seconds though..

Please suggest please?

Regards,
Shariq

@shariq-azim
Copy link
Author

Hey @chrisjoyce911 what is your suggestions ?The problem wasnt solved though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants