ESP8266 Developer Zone The Official ESP8266 Forum 2015-03-03T17:58:37+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=239 2015-03-03T17:58:37+08:00 2015-03-03T17:58:37+08:00 https://bbs.espressif.com:443/viewtopic.php?t=239&p=882#p882 <![CDATA[Re: Over The Air Upgrade]]>
The DNS-function is working fine when calling service etc. My problem is when filling the structure needed for calling
system_upgrade_start(upServer)

upServer = (struct upgrade_server_info *)os_zalloc(sizeof(struct upgrade_server_info));
os_sprintf(upServer->pre_version, "v%d.%d", 1, 0);
os_sprintf(upServer->upgrade_version, "v%d.%d", 1, 1);
upServer->check_cb = ota_cb;
upServer->check_times = 60000;
upServer->port = OTASERVERPORT;
uint32_t otaip = ipaddr_addr(OTASERVERIP);
os_memcpy(upServer->ip, &otaip, 4);
upServer->url = (uint8 *) os_zalloc(512);
os_sprintf(upServer->url,"GET /v1/device/rom/?action=download_rom&version=%s&filename=user%d.bin HTTP/1.1\r\nHost: "IPSTR":%d\r\n\r\n",upServer->upgrade_version,user_bin_n,IP2STR(upServer->ip),upServer->port);

As you can see I can only set the IP-Address, where the binaries should be downloaded from.
I would like to enter a hostname and then let system_upgrade_start(upServer) do the DNS-lookup

Best regards
Thorvald

Statistics: Posted by Thorvald — Tue Mar 03, 2015 5:58 pm


]]>
2015-03-02T17:19:25+08:00 2015-03-02T17:19:25+08:00 https://bbs.espressif.com:443/viewtopic.php?t=239&p=865#p865 <![CDATA[Re: Over The Air Upgrade]]>
of course it can be not only ip , but also host name

we support DNS function, please refer to http://bbs.espressif.com/viewtopic.php?f=21&t=232

Statistics: Posted by ESP_Faye — Mon Mar 02, 2015 5:19 pm


]]>
2015-03-02T16:28:44+08:00 2015-03-02T16:28:44+08:00 https://bbs.espressif.com:443/viewtopic.php?t=239&p=859#p859 <![CDATA[Over The Air Upgrade]]>
Using over the air upgrade I hit a problem when setting up the host where the binaries are placed, as my server is placed in a multihosting environment. In that kind os setup I need top provide the hostname as part of the url and not just the ip-address.

In the sample for calling system_upgrade_start it is possible to add a host-name like

os_sprintf(upServer->url,"GET /v1/device/rom/?action=download_rom&version=%s&filename=user%d.bin HTTP/1.1\r\nHost: "IPSTR":%d\r\n\r\n" .........

but changing that host name from an IP to a real name just results in the firmware sending two hostnames - first the IP, and then the one added to the URL, and that does not Work for Microsoft servers.

Will you look at a way to add the hostname and not just the IP-Address

Best regards
Thorvald

Statistics: Posted by Thorvald — Mon Mar 02, 2015 4:28 pm


]]>