ESP32 HTTP OTA test

本文详细介绍如何使用ESP-IDF中的simple_ota_example进行ESP32固件的OTA升级测试。包括搭建本地HTTP服务器、配置ESP32连接及升级URL等步骤,并解答了HTTPS OTA升级时如何跳过服务器证书验证的问题。

1. Please use the simple_ota_example(In ESP-IDF) to test.

2. Please follow these steps to create a local HTTP server for testing.

  • The PC is connected to the same router as ESP32.

  • Prepare a firmware for the OTA test upgrade, such as the hello-world.bin firmware.
    在这里插入图片描述

  • In the directory where is the stored hello-world. bin file , if you are in a Python 3 environment, create a local server with the following command.

    python -m http.server 8070
    

    在这里插入图片描述

  • Then use the following command to query the native IP address.

    ifconfig
    

    在这里插入图片描述

  • When the server address and the upgraded firmware are ready, please do the following configuration and then download the firmware to upgrade.

    menuconfig -> Example Connection Configuration -> WiFi SSID
    menuconfig -> Example Connection Configuration -> WiFi Password

    在这里插入图片描述

    menuconfig -> Component config - > ESP HTTPS OTA -> Allow HTTP for OTA

    在这里插入图片描述

    menuconfig -> Example Configuration -> (Enable)Skip server certificate CN fieldcheck
    menuconfig -> Example Configuration -> firmware upgrade url endpoint

    在这里插入图片描述在这里插入图片描述

  • The test results are as follows:
    在这里插入图片描述

Q & A

Q1. How to skip server-side certificate check if HTTPS OTA is enabled?

  • You can try to enable the menuconfig -> Component config -> ESP-TLS -> Allow potentially insecure options -> Skip server certificate verification by defaul option (please note that this is not safe and is only for testing), as follows :
    在这里插入图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值