开发者社区 > 物联网 > 正文

【物联网】MQTT OTA 失败 提示HTTP/1.1 400 Bad Request

我参考了这个流程进行OTA:https://help.aliyun.com/document_detail/85700.html?spm=a2c4g.11186623.6.641.6d815b3eNH0L6H&accounttraceid=c69909a2-2a22-43a7-9b34-9535c49f3f2b
参考的是ota_mqtt-example.c这个样例,已经将版本提交到服务器上,并对固件进行了验证。
但是在OTA流程在执行的时候出现了问题,卡在 IOT_OTA_FetchYield(h_ota, buf_ota, OTA_BUF_LEN, 1);
显示获取OTA数据失败。
log提示:
    [dbg] httpclient_recv_response(760): RESPONSE (Length: 32 Bytes)
    < HTTP/1.1 400 Bad Request

请问我该如何解决此问题?

...............................................
                 len = IOT_OTA_FetchYield(h_ota, buf_ota, OTA_BUF_LEN, 1);
                if (len > 0) {
                    ESP_LOGI(TAG, "zzs ota data: %s\n", buf_ota);
                    if (0) {// (1 != /*将读取的buf_ota写入寄存器成功*/) {
                        ESP_LOGE(TAG, "zzs write data to file failed");
                        rc = -1;
                    break;
                    }
                } else {
                    IOT_OTA_ReportProgress(h_ota, IOT_OTAP_FETCH_FAILED, NULL);
                    ESP_LOGE(TAG, "zzs ota fetch fail");
                }
...............................................

整个流程的LOG如下:

I (29) boot: ESP-IDF v3.
1-dev-378-gc10e6d3-dirty 2nd stage bootloader
I (29) boot: compile time 18:23:59
I (29) boot: SPI Speed      : 40MHz
I (30) boot: SPI Mode       : QIO
I (30) boot: SPI Flash Size : 2MB
I (30) boot: Partition Table:
I (31) boot: ## Label            Usage          Type ST Offset   Length
I (31) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (32) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (32) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (33) boot:  3 ota_0            OTA app          00 10 00010000 000b0000
I (33) boot:  4 ota_1            OTA app          00 11 000c0000 000b0000
I (34) boot:  5 app_data0        WiFi data        01 02 00170000 00020000
I (35) boot:  6 app_data1        Unknown data     01 40 00190000 00040000
I (35) boot: End of partition table
E (36) boot: ota data partition invalid and no factory, will try all partitions
I (36) esp_image: segment 0: paddr=0x00010010 vaddr=0x40210010 size=0x6c1f8 (442872) map
I (134) esp_image: segment 1: paddr=0x0007c210 vaddr=0x3ffe8000 size=0x00570 (  1392) load
I (135) esp_image: segment 2: paddr=0x0007c788 vaddr=0x3ffe8570 size=0x0011c (   284) load
I (135) esp_image: segment 3: paddr=0x0007c8ac vaddr=0x40100000 size=0x07108 ( 28936) load
0x40100000: _stext at ??:?

I (142) boot: Loaded app from partition at offset 0x10000
I (7) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (12) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
zzs app_main
zzs initialise_wifi
E (218) OTA_TEST: Setting WiFi configuration SSID wind...
mode : sta(84:f3:eb:ae:91:b6)
add if0
I (225) OTA_TEST: gateway_subdev_main task started...
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 8
pm open phy_2,type:2 0 0
cnt

connected with wind, channel 13
I (8449) event: sta ip: 192.168.13.121, mask: 255.255.255.0, gw: 192.168.13.1
zzs gateway_subdev_main
zzs demo_gateway_function
[inf] iotx_device_info_init(40): device_info created successfully!
[dbg] iotx_device_info_set(50): start to set device info!
[dbg] iotx_device_info_set(64): device_info set successfully!
[dbg] guider_print_dev_guider_info(256): ....................................................
[dbg] guider_print_dev_guider_info(257):           ProductKey : a1IwceIlmxC
[dbg] guider_print_dev_guider_info(258):           DeviceName : test2
[dbg] guider_print_dev_guider_info(259):             DeviceID : a1IwceIlmxC.test2
[dbg] guider_print_dev_guider_info(261): ....................................................
[dbg] guider_print_dev_guider_info(262):        PartnerID Buf : ,partner_id=espressif
[dbg] guider_print_dev_guider_info(263):         ModuleID Buf : ,module_id=wroom-32
[dbg] guider_print_dev_guider_info(264):           Guider URL :
[dbg] guider_print_dev_guider_info(266):       Guider SecMode : 3 (TCP + Direct + Plain)
[dbg] guider_print_dev_guider_info(268):     Guider Timestamp : 2524608000000
[dbg] guider_print_dev_guider_info(269): ....................................................
[dbg] guider_print_dev_guider_info(275): ....................................................
[dbg] guider_print_conn_info(233): -----------------------------------------
[dbg] guider_print_conn_info(234):             Host : a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com
[dbg] guider_print_conn_info(235):             Port : 1883
[dbg] guider_print_conn_info(238):         ClientID : a1IwceIlmxC.test2|securemode=3,timestamp=2524608000000,signmethod=hmacsha1,gw=1,ext=0,partner_id=espressif,module_id
=wroom-32|
[dbg] guider_print_conn_info(243): -----------------------------------------
 ~~~~~~~~~~~~~~~~ start test ~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~ start construct ~~~~~~~~~~~~~
[inf] iotx_mc_init(1703): MQTT init success!
ESP32SOCK 59 HAL_TCP_Establish() | establish tcp connection with server(host=a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com port=1883)
ESP32SOCK 99 HAL_TCP_Establish() | fail to establish tcp
[err] iotx_mc_connect(2001): TCP or TLS Connection failed
[inf] iotx_mc_disconnect(2129): mqtt disconnect!
[inf] iotx_mc_release(2175): mqtt release!
[err] IOT_Gateway_Construct(709): construct MQTT failed
E (8701) OTA_TEST: zzs IOT_Gateway_Construct

E (8703) OTA_TEST: zzs MQTT construct failed
out of demo!
[err] LITE_dump_malloc_free_stats(594): WITH_MEM_STATS = 0
zzs gateway_subdev_main
zzs demo_gateway_function
[dbg] iotx_device_info_init(32): device_info already created, return!
[dbg] iotx_device_info_set(50): start to set device info!
[dbg] iotx_device_info_set(64): device_info set successfully!
[dbg] guider_print_dev_guider_info(256): ....................................................
[dbg] guider_print_dev_guider_info(257):           ProductKey : a1IwceIlmxC
[dbg] guider_print_dev_guider_info(258):           DeviceName : test2
[dbg] guider_print_dev_guider_info(259):             DeviceID : a1IwceIlmxC.test2
[dbg] guider_print_dev_guider_info(261): ....................................................
[dbg] guider_print_dev_guider_info(262):        PartnerID Buf : ,partner_id=espressif
[dbg] guider_print_dev_guider_info(263):         ModuleID Buf : ,module_id=wroom-32
[dbg] guider_print_dev_guider_info(264):           Guider URL :
[dbg] guider_print_dev_guider_info(266):       Guider SecMode : 3 (TCP + Direct + Plain)
[dbg] guider_print_dev_guider_info(268):     Guider Timestamp : 2524608000000
[dbg] guider_print_dev_guider_info(269): ....................................................
[dbg] guider_print_dev_guider_info(275): ....................................................
[dbg] guider_print_conn_info(233): -----------------------------------------
[dbg] guider_print_conn_info(234):             Host : a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com
[dbg] guider_print_conn_info(235):             Port : 1883
[dbg] guider_print_conn_info(238):         ClientID : a1IwceIlmxC.test2|securemode=3,timestamp=2524608000000,signmethod=hmacsha1,gw=1,ext=0,partner_id=espressif,module_id
=wroom-32|
[dbg] guider_print_conn_info(243): -----------------------------------------
 ~~~~~~~~~~~~~~~~ start test ~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~ start construct ~~~~~~~~~~~~~
[inf] iotx_mc_init(1703): MQTT init success!
ESP32SOCK 59 HAL_TCP_Establish() | establish tcp connection with server(host=a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com port=1883)
ESP32SOCK 101 HAL_TCP_Establish() | success to establish tcp, fd=1
[err] iotx_mc_wait_CONNACK(1198): wait connack timeout
ESP32SOCK 160 HAL_TCP_Write() | select-write timeout 1
[err] iotx_mc_connect(2027): wait connect ACK timeout, or receive a ACK indicating error!
[inf] iotx_mc_disconnect(2129): mqtt disconnect!
[inf] iotx_mc_release(2175): mqtt release!
[err] IOT_Gateway_Construct(709): construct MQTT failed
E (17980) OTA_TEST: zzs IOT_Gateway_Construct

E (17982) OTA_TEST: zzs MQTT construct failed
out of demo!
[err] LITE_dump_malloc_free_stats(594): WITH_MEM_STATS = 0
zzs gateway_subdev_main
zzs demo_gateway_function
[dbg] iotx_device_info_init(32): device_info already created, return!
[dbg] iotx_device_info_set(50): start to set device info!
[dbg] iotx_device_info_set(64): device_info set successfully!
[dbg] guider_print_dev_guider_info(256): ....................................................
[dbg] guider_print_dev_guider_info(257):           ProductKey : a1IwceIlmxC
[dbg] guider_print_dev_guider_info(258):           DeviceName : test2
[dbg] guider_print_dev_guider_info(259):             DeviceID : a1IwceIlmxC.test2
[dbg] guider_print_dev_guider_info(261): ....................................................
[dbg] guider_print_dev_guider_info(262):        PartnerID Buf : ,partner_id=espressif
[dbg] guider_print_dev_guider_info(263):         ModuleID Buf : ,module_id=wroom-32
[dbg] guider_print_dev_guider_info(264):           Guider URL :
[dbg] guider_print_dev_guider_info(266):       Guider SecMode : 3 (TCP + Direct + Plain)
[dbg] guider_print_dev_guider_info(268):     Guider Timestamp : 2524608000000
[dbg] guider_print_dev_guider_info(269): ....................................................
[dbg] guider_print_dev_guider_info(275): ....................................................
[dbg] guider_print_conn_info(233): -----------------------------------------
[dbg] guider_print_conn_info(234):             Host : a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com
[dbg] guider_print_conn_info(235):             Port : 1883
[dbg] guider_print_conn_info(238):         ClientID : a1IwceIlmxC.test2|securemode=3,timestamp=2524608000000,signmethod=hmacsha1,gw=1,ext=0,partner_id=espressif,module_id
=wroom-32|
[dbg] guider_print_conn_info(243): -----------------------------------------
 ~~~~~~~~~~~~~~~~ start test ~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~ start construct ~~~~~~~~~~~~~
[inf] iotx_mc_init(1703): MQTT init success!
ESP32SOCK 59 HAL_TCP_Establish() | establish tcp connection with server(host=a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com port=1883)
ESP32SOCK 101 HAL_TCP_Establish() | success to establish tcp, fd=1
[err] iotx_mc_wait_CONNACK(1198): wait connack timeout
[err] iotx_mc_connect(2027): wait connect ACK timeout, or receive a ACK indicating error!
[inf] iotx_mc_disconnect(2129): mqtt disconnect!
[inf] iotx_mc_release(2175): mqtt release!
[err] IOT_Gateway_Construct(709): construct MQTT failed
E (26791) OTA_TEST: zzs IOT_Gateway_Construct

E (26794) OTA_TEST: zzs MQTT construct failed
out of demo!
[err] LITE_dump_malloc_free_stats(594): WITH_MEM_STATS = 0
zzs gateway_subdev_main
zzs demo_gateway_function
[dbg] iotx_device_info_init(32): device_info already created, return!
[dbg] iotx_device_info_set(50): start to set device info!
[dbg] iotx_device_info_set(64): device_info set successfully!
[dbg] guider_print_dev_guider_info(256): ....................................................
[dbg] guider_print_dev_guider_info(257):           ProductKey : a1IwceIlmxC
[dbg] guider_print_dev_guider_info(258):           DeviceName : test2
[dbg] guider_print_dev_guider_info(259):             DeviceID : a1IwceIlmxC.test2
[dbg] guider_print_dev_guider_info(261): ....................................................
[dbg] guider_print_dev_guider_info(262):        PartnerID Buf : ,partner_id=espressif
[dbg] guider_print_dev_guider_info(263):         ModuleID Buf : ,module_id=wroom-32
[dbg] guider_print_dev_guider_info(264):           Guider URL :
[dbg] guider_print_dev_guider_info(266):       Guider SecMode : 3 (TCP + Direct + Plain)
[dbg] guider_print_dev_guider_info(268):     Guider Timestamp : 2524608000000
[dbg] guider_print_dev_guider_info(269): ....................................................
[dbg] guider_print_dev_guider_info(275): ....................................................
[dbg] guider_print_conn_info(233): -----------------------------------------
[dbg] guider_print_conn_info(234):             Host : a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com
[dbg] guider_print_conn_info(235):             Port : 1883
[dbg] guider_print_conn_info(238):         ClientID : a1IwceIlmxC.test2|securemode=3,timestamp=2524608000000,signmethod=hmacsha1,gw=1,ext=0,partner_id=espressif,module_id
=wroom-32|
[dbg] guider_print_conn_info(243): -----------------------------------------
 ~~~~~~~~~~~~~~~~ start test ~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~ start construct ~~~~~~~~~~~~~
[inf] iotx_mc_init(1703): MQTT init success!
ESP32SOCK 59 HAL_TCP_Establish() | establish tcp connection with server(host=a1IwceIlmxC.iot-as-mqtt.cn-shanghai.aliyuncs.com port=1883)
ESP32SOCK 101 HAL_TCP_Establish() | success to establish tcp, fd=1
[inf] iotx_mc_connect(2035): mqtt connect success!
[dbg] iotx_mc_report_mid(2259): MID Report: started in MQTT
[dbg] iotx_mc_report_mid(2276): MID Report: json data = '{"id":"a1IwceIlmxC_test2_mid","params":{"_sys_device_mid":"wroom-32","_sys_device_pid":"espressif"}}'
[dbg] iotx_mc_report_mid(2292): MID Report: topic name = '/sys/a1IwceIlmxC/test2/thing/status/update'
[dbg] iotx_mc_report_mid(2309): MID Report: finished, IOT_MQTT_Publish() = 0
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/sub/register_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/thing/sub/register_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/sub/unregister_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/thing/sub/unregister_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/topo/add_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/thing/topo/add_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/topo/delete_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/thing/topo/delete_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/topo/get_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/thing/topo/get_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/config/get_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/thing/config/get_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/list/found_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/thing/list/found_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /ext/session/a1IwceIlmxC/test2/combine/login_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/ext/session/a1IwceIlmxC/test2/combine/login_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /ext/session/a1IwceIlmxC/test2/combine/logout_reply!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/ext/session/a1IwceIlmxC/test2/combine/logout_reply] successfully
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/rrpc/request/+!
[dbg] iotx_mc_cycle(1269): SUBACK
[err] iotx_mc_handle_recv_SUBACK(1020): There is a identical topic and related handle in list!
[inf] iotx_gateway_event_handle(566): event type 3
[inf] iotx_gateway_subscribe_unsubscribe_topic(479): subscribe or unsubscribe [/sys/a1IwceIlmxC/test2/rrpc/request/+] successfully
E (29067) OTA_TEST: zzs IOT_Gateway_Construct

[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /ota/device/request/a1IwceIlmxC/test2!
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /ota/device/upgrade/a1IwceIlmxC/test2!
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/config/get_reply!
[inf] iotx_mc_subscribe(1388): mqtt subscribe success,topic = /sys/a1IwceIlmxC/test2/thing/config/push!
E (29122) OTA_TEST: zzs IOT_OTA_Init

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WIFI_VERSDION: 1
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E (30139) OTA_TEST: zzs wait ota upgrade command....
E (30131) OTA_TEST: zzs OTA begin

[dbg] iotx_mc_cycle(1269): SUBACK
[inf] iotx_gateway_event_handle(566): event type 3
[dbg] iotx_mc_cycle(1269): SUBACK
[inf] iotx_gateway_event_handle(566): event type 3
[dbg] iotx_mc_cycle(1269): SUBACK
[inf] iotx_gateway_event_handle(566): event type 3
[dbg] iotx_mc_cycle(1269): SUBACK
[inf] iotx_gateway_event_handle(566): event type 3
[dbg] iotx_mc_cycle(1260): PUBACK
[inf] iotx_gateway_event_handle(566): event type 9
I (30334) ota: rc: 0

I (30335) OTA_TEST: zzs OTA end

E (32338) OTA_TEST: zzs wait ota upgrade command....
E (32331) OTA_TEST: zzs OTA begin

I (32534) ota: rc: 0

I (32535) OTA_TEST: zzs OTA end

E (34539) OTA_TEST: zzs wait ota upgrade command....
E (34531) OTA_TEST: zzs OTA begin

I (34734) ota: rc: 0

I (34736) OTA_TEST: zzs OTA end

E (36738) OTA_TEST: zzs wait ota upgrade command....
E (36731) OTA_TEST: zzs OTA begin

I (36935) ota: rc: 0

I (36937) OTA_TEST: zzs OTA end

E (38948) OTA_TEST: zzs wait ota upgrade command....
E (38942) OTA_TEST: zzs OTA begin

I (39144) ota: rc: 0

I (39146) OTA_TEST: zzs OTA end

E (41148) OTA_TEST: zzs wait ota upgrade command....
E (41141) OTA_TEST: zzs OTA begin

[dbg] iotx_mc_cycle(1277): PUBLISH
[dbg] iotx_mc_handle_recv_PUBLISH(1091):         Packet Ident : 00000000
[dbg] iotx_mc_handle_recv_PUBLISH(1092):         Topic Length : 37
[dbg] iotx_mc_handle_recv_PUBLISH(1096):           Topic Name : /ota/device/upgrade/a1IwceIlmxC/test2
[dbg] iotx_mc_handle_recv_PUBLISH(1099):     Payload Len/Room : 406 / 2006
[dbg] iotx_mc_handle_recv_PUBLISH(1100):       Receive Buflen : 2048
[dbg] iotx_mc_handle_recv_PUBLISH(1111): delivering msg ...
[dbg] iotx_mc_deliver_message(866): topic be matched
[dbg] otamqtt_UpgrageCb(121): topic=/ota/device/upgrade/a1IwceIlmxC/test2
[dbg] otamqtt_UpgrageCb(122): len=406, topic_msg={"code":"1000","data":{"size":473568,"sign":"9ae25d9035cdafde3f35b65b28dcc24a","version":"2","url":"https://iotx-ota.oss-
cn-shanghai.aliyuncs.com/ota/f68d663fd996f941e3a43a96a4e9198e/cjq0m74a200063a77ooyz0863.bin?Expires=1545639168&OSSA ...
[dbg] otamqtt_UpgrageCb(140): receive device upgrade
E (41344) OTA_TEST: zzs IOT_OTA_IsFetching

E (41346) OTA_TEST: zzs IOT_OTA_FetchYield

[dbg] httpclient_common(785): host: 'iotx-ota.oss-cn-shanghai.aliyuncs.com', port: 443
ESP32SOCK 59 HAL_TCP_Establish() | establish tcp connection with server(host=iotx-ota.oss-cn-shanghai.aliyuncs.com port=443)
ESP32SOCK 101 HAL_TCP_Establish() | success to establish tcp, fd=2
[dbg] httpclient_send_header(317): REQUEST (Length: 326 Bytes)
> GET /ota/f68d663fd996f941e3a43a96a4e9198e/cjq0m74a200063a77ooyz0863.bin?Expires=1545639168&OSSAccessKeyId=cS8uRRy54RszYWna&Signature=IaaQHyu9BFs48txrS02bEdaoc8E%3D HTTP
/1.1
> Host: iotx-ota.oss-cn-shanghai.aliyuncs.com
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Encoding: gzip, deflate
>
[dbg] httpclient_send_header(322): Written 326 bytes
[inf] httpclient_recv(384): 32 bytes has been read
[dbg] httpclient_recv_response(760): RESPONSE (Length: 32 Bytes)
< HTTP/1.1 400 Bad Request
< Server
[wrn] httpclient_response_parse(643): Response code 400
[dbg] httpclient_response_parse(646): Reading headers: HTTP/1.1 400 Bad Request
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[dbg] httpclient_retrieve_content(428): Current data: <!DOCTYPE H
[dbg] httpclient_retrieve_content(534): Total-Payload: 281 Bytes; Read: 11 Bytes
[inf] httpclient_recv(384): 270 bytes has been read
[dbg] httpclient_retrieve_content(589): no more (content-length)
[inf] httpclient_common(828): close http channel
[dbg] httpclient_close(774): client disconnected
I (41435) OTA_TEST: zzs ota data: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<h1>400 Bad Request</h1>
<p>The plain HTTP request was sent to HTTPS port.<hr/>Powered by AliyunOSS</body>
</html>


I (41451) ota: IOT_OTAG_FETCHED_SIZE: 281

I (41453) ota: IOT_OTAG_FILE_SIZE: 473568

I (41456) ota: IOT_OTAG_MD5SUM: 9ae25d9035cdafde3f35b65b28dcc24a

I (41469) ota: IOT_OTAG_VERSION: 2

E (41463) OTA_TEST: zzs download percence: 0

E (41566) OTA_TEST: zzs IOT_OTA_FetchYield

[dbg] httpclient_common(785): host: 'iotx-ota.oss-cn-shanghai.aliyuncs.com', port: 443
ESP32SOCK 59 HAL_TCP_Establish() | establish tcp connection with server(host=iotx-ota.oss-cn-shanghai.aliyuncs.com port=443)
ESP32SOCK 101 HAL_TCP_Establish() | success to establish tcp, fd=2
[dbg] httpclient_send_header(317): REQUEST (Length: 326 Bytes)
> GET /ota/f68d663fd996f941e3a43a96a4e9198e/cjq0m74a200063a77ooyz0863.bin?Expires=1545639168&OSSAccessKeyId=cS8uRRy54RszYWna&Signature=IaaQHyu9BFs48txrS02bEdaoc8E%3D HTTP
/1.1
> Host: iotx-ota.oss-cn-shanghai.aliyuncs.com
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Encoding: gzip, deflate
>
[dbg] httpclient_send_header(322): Written 326 bytes
[inf] httpclient_recv(384): 32 bytes has been read
[dbg] httpclient_recv_response(760): RESPONSE (Length: 32 Bytes)
< HTTP/1.1 400 Bad Request
< Server
[wrn] httpclient_response_parse(643): Response code 400
[dbg] httpclient_response_parse(646): Reading headers: HTTP/1.1 400 Bad Request
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[dbg] httpclient_retrieve_content(428): Current data: <!DOCTYPE H
[dbg] httpclient_retrieve_content(534): Total-Payload: 281 Bytes; Read: 11 Bytes
[inf] httpclient_recv(384): 270 bytes has been read
[dbg] httpclient_retrieve_content(589): no more (content-length)
[inf] httpclient_common(828): close http channel
[dbg] httpclient_close(774): client disconnected
E (41646) OTA_TEST: zzs ota fetch fail
I (41650) ota: IOT_OTAG_FETCHED_SIZE: 281

I (41654) ota: IOT_OTAG_FILE_SIZE: 473568

I (41657) ota: IOT_OTAG_MD5SUM: 9ae25d9035cdafde3f35b65b28dcc24a

I (41660) ota: IOT_OTAG_VERSION: 2

E (41663) OTA_TEST: zzs download percence: 0

E (41765) OTA_TEST: zzs IOT_OTA_FetchYield

[dbg] httpclient_common(785): host: 'iotx-ota.oss-cn-shanghai.aliyuncs.com', port: 443
ESP32SOCK 59 HAL_TCP_Establish() | establish tcp connection with server(host=iotx-ota.oss-cn-shanghai.aliyuncs.com port=443)
ESP32SOCK 101 HAL_TCP_Establish() | success to establish tcp, fd=2
[dbg] httpclient_send_header(317): REQUEST (Length: 326 Bytes)
> GET /ota/f68d663fd996f941e3a43a96a4e9198e/cjq0m74a200063a77ooyz0863.bin?Expires=1545639168&OSSAccessKeyId=cS8uRRy54RszYWna&Signature=IaaQHyu9BFs48txrS02bEdaoc8E%3D HTTP
/1.1
> Host: iotx-ota.oss-cn-shanghai.aliyuncs.com
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Encoding: gzip, deflate
>
[dbg] httpclient_send_header(322): Written 326 bytes
[inf] httpclient_recv(384): 32 bytes has been read
[dbg] httpclient_recv_response(760): RESPONSE (Length: 32 Bytes)
< HTTP/1.1 400 Bad Request
< Server
[wrn] httpclient_response_parse(643): Response code 400
[dbg] httpclient_response_parse(646): Reading headers: HTTP/1.1 400 Bad Request
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[inf] httpclient_recv(384): 32 bytes has been read
[dbg] httpclient_retrieve_content(428): Current data: <!DOCTYPE H
[dbg] httpclient_retrieve_content(534): Total-Payload: 281 Bytes; Read: 11 Bytes
[inf] httpclient_recv(384): 270 bytes has been read
[dbg] httpclient_retrieve_content(589): no more (content-length)
[inf] httpclient_common(828): close http channel
[dbg] httpclient_close(774): client disconnected
E (41847) OTA_TEST: zzs ota fetch fail
I (41852) ota: IOT_OTAG_FETCHED_SIZE: 281

I (41856) ota: IOT_OTAG_FILE_SIZE: 473568

I (41869) ota: IOT_OTAG_MD5SUM: 9ae25d9035cdafde3f35b65b28dcc24a

I (41862) ota: IOT_OTAG_VERSION: 2

E (41864) OTA_TEST: zzs download percence: 0

E (41966) OTA_TEST: zzs IOT_OTA_FetchYield

展开
收起
1997745470652655 2018-12-23 17:16:36 4853 0
3 条回答
写回答
取消 提交回答
  • 我也遇到了相同的问题

    2022-03-10 17:07:13
    赞同 展开评论 打赏
  • 我也差不多的问题,阿里没有人回吗

    [inf] httpclient_connect(426): rc = client->net.connect() = 0, success @ [1/3] iteration [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_parse_response_header(372): Reading headers: HTTP/1.1 200 OK [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [inf] _http_recv(214): ret of _http_recv is 32 [err] _http_parse_response_header(394): Could not parse header [err] httpclient_common(562): httpclient_recv_response is error,ret = -4 [inf] httpclient_close(502): client disconnected [err] ofc_Fetch(70): fetch firmware failed [err] IOT_OTA_FetchYield(698): Fetch firmware failed E (36128) ota: esp_ota_end failed! err=0x102. Image is invalid [inf] iotx_mc_keepalive_sub(1699): send MQTT ping... [inf] iotx_mc_cycle(1570): receive ping response! [inf] awss_notify_dev_info(205): topic:/sys/device/info/notify [inf] awss_notify_dev_info(209): send notify success [inf] awss_notify_dev_info(205): topic:/sys/device/info/notify [inf] awss_notify_dev_info(209): send notify success

    2019-11-01 08:19:58
    赞同 展开评论 打赏
  • 你好,我也遇到同样的问题,这个问题你解决了么?谢谢。
    2019-01-31 16:54:49
    赞同 展开评论 打赏

物联网领域前沿技术分享与交流

相关产品

  • 物联网平台
  • 热门讨论

    热门文章

    相关电子书

    更多
    基于RocketMQ Connect 构建全新数据流转处理平 立即下载
    RocketMQ Client-GO 介绍 立即下载
    RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载