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
Over The Air Upgrade
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
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
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
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 75 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.