FOTA failure: No GET request at webserver

rith87

FOTA failure: No GET request at webserver

Postby rith87 » Thu Nov 19, 2015 11:10 pm

Hello folks,

I'm doing fota using https://github.com/nqd/esp8266-dev but the GET request from the system_upgrade_start() function is not being seen at my webserver. Here's the evidence:

On the ESP side:

Code: Select all

FOTA client: Connect to ip 192.168.0.16:80
FOTA Client: Sent request
FOTA Client: Request timeout, close connection
FOTA Client: Disconnect
Final response: {"application":"otaupdate","last":{"version":"0.0.2","created":"2015-11-19T14:59:04.090Z","protocol":"http:","host":"192.168.0.16","path":"/firmwares/564de3b81fce1d320de52ffd/download"}}
   Version 0.0.2
   Host 192.168.0.16
   Path /firmwares/564de3b81fce1d320de52ffd/download
   Protocol http:
FOTA Client: Preparing to get firmware
Firmware client: Connect to 192.168.0.16:80
Firmware client: Connected
system_upgrade_start
upgrade_connect
upgrade_connect_cb
GET /firmwares/564de3b81fce1d320de52ffd/download HTTP/1.1
Host: 192.168.0.16
Connection: keep-alive
Cache-Control: no-cache
User-Agent: ESP8266
Accept: */*
Content-Type: application/json

HEAD /firmwares/564de3b81fce1d320de52ffd/download HTTP/1.1
Host: 192.168.0.16
Connection: close
Cache-Control: no-cache
User-Agent: ESP8266
Accept: */*
Content-Type: application/json


On the webserver side:

Code: Select all

GET /api/otaupdate/versions/image2 200 4.064 ms - 186
HEAD /firmwares/564de3b81fce1d320de52ffd/download - - ms - -


So, the HEAD request is received fine but not the GET request. Can the folks at Espressif explain why this is the case?

PS: I've also asked this to the esp8266-dev author but I'm not sure which party will be able to assist..

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: FOTA failure: No GET request at webserver

Postby ESP_Faye » Fri Nov 20, 2015 3:09 pm

Hi,

The "GET" here is just a UART output log, at that time, ESP8266 did not send the GET request, but send the HEAD request instead.

Code: Select all

GET /firmwares/564de3b81fce1d320de52ffd/download HTTP/1.1
Host: 192.168.0.16
Connection: keep-alive
Cache-Control: no-cache
User-Agent: ESP8266
Accept: */*
Content-Type: application/json


Sorry that may lead to misunderstanding.

Thanks for your interest in ESP8266 !

rith87

Re: FOTA failure: No GET request at webserver

Postby rith87 » Sat Nov 21, 2015 9:28 am

Thanks for the response. If the GET request is just a print out and only the HEAD request is sent, it seems like the HEAD response was rejected by the ESP. If so, can you share what the ESP is looking for in the HEAD response? Or if you see anything wrong with the headers that are being sent to the remote side?

Code: Select all

HEAD /firmwares/564de3b81fce1d320de52ffd/download HTTP/1.1
Host: 192.168.0.16
Connection: close
Cache-Control: no-cache
User-Agent: ESP8266
Accept: */*
Content-Type: application/json

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: FOTA failure: No GET request at webserver

Postby ESP_Faye » Mon Nov 23, 2015 5:27 pm

Hi,

After you sent this HEAD, what is the response from your server ?

rith87

Re: FOTA failure: No GET request at webserver

Postby rith87 » Mon Nov 23, 2015 9:25 pm

I actually don't get an HTTP response from the server. However, if I send the exact same HTTP request via cURL, I get a 200. Well, let me investigate a little more...

aforino
Posts: 1
Joined: Mon Apr 18, 2016 10:58 pm

Re: FOTA failure: No GET request at webserver

Postby aforino » Mon Apr 18, 2016 11:06 pm

@rith87
Where you able to solve this issue or to figure out what caused the webserver to send a 400 response?

lagrota
Posts: 2
Joined: Fri May 13, 2016 12:40 am

Re: FOTA failure: No GET request at webserver

Postby lagrota » Fri May 13, 2016 12:48 am

@rith87

Did you get any further results? Did you manage to send/receive the upgrade correctly? I'm having the same issue as you did and I didn't find a solution yet.

Folks at Espressif, did you find a solution for @rith87's issue?

Thank you in advance!

Who is online

Users browsing this forum: No registered users and 13 guests