Closed HomeACcessoryKid closed 5 years ago
I have introduced a DNS lookup already in ota_init starting from 0.9.11. This trigger the bug already in that stage, so it is not related to the ota_connect routine and a lot easier to debug. IF it passes this stage after that is never an issue in ota_connect.
Introducing a 2 seconds holdoff before calling DNS seems to suppress the error -1 but there is still an issue with error -6
next step is to use lwip_debug
to be continued
the -1 issue is solved and the solution is simple
by default the lwip dns only has one entry in its work queue AND we were still working with a lookup for the NTP server.
solution:
EXTRA_CFLAGS += -DDNS_TABLE_SIZE=2
I have not been able to reproduce the -6 error yet/anymore but if you see it, please comment!!
in the typical situation, the default gateway requests confirmation of arp from our assigned address ALL the time
in the code we are referring to ota.c near line 278 of release 0.9.10 if (!local_port) { do { wc_RNG_GenerateBlock(&rng, initial_port, 2); local_port=256initial_port[0]+initial_port[1]; printf("%04x,",local_port); } while (local_port<LOCAL_PORT_START); } UDPLGP("%04x ",local_port); ret = netconn_gethostbyname(host, &target_ip); while(ret) { printf("%d",ret); vTaskDelay(delay); delay=delay<500?delay2:500; //exponential hold-off till 5 seconds ret = netconn_gethostbyname(host, &target_ip); }
typical: --- ota_get_version in UDPlogger --- ota_get_version --- ota_connect LocalPort=e847 in printf --- ota_get_version
this time:
in UDPlogger --- ota_get_version --- ota_connect LocalPort=e847 in printf --- ota_get_version
<some 5 seconds of nothing>