Over The Air Upgrade

Thorvald
Posts: 8
Joined: Fri Feb 20, 2015 6:25 am

Over The Air Upgrade

Postby Thorvald » Mon Mar 02, 2015 4:28 pm

Hi

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

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

Re: Over The Air Upgrade

Postby ESP_Faye » Mon Mar 02, 2015 5:19 pm

Hi,

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

Thorvald
Posts: 8
Joined: Fri Feb 20, 2015 6:25 am

Re: Over The Air Upgrade

Postby Thorvald » Tue Mar 03, 2015 5:58 pm

Hi

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

Who is online

Users browsing this forum: No registered users and 183 guests