ESP32 HTTP OTA test

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 :
    在这里插入图片描述
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ESP32 Arduino OTA是指利用ESP32开发板和Arduino框架进行远程固件升级的技术。 OTA即"Over-The-Air"的简称,意味着通过网络无线传输数据进行固件升级。ESP32 Arduino OTA提供了一种方便的方式来更新设备的固件,而无需将设备连接到计算机进行拆卸和重新烧写固件。 使用ESP32 Arduino OTA进行固件升级非常简单。首先,确保ESP32开发板上已经安装了Arduino框架。然后,在Arduino IDE中选择正确的开发板类型以及端口,并加载您的项目代码。 在您的代码中添加OTA库的引用,并配置OTA密码、端口和主机名。这些参数将用于识别设备和进行远程固件升级。 接下来,在您的代码的适当位置调用OTA库的函数。通过调用`ArduinoOTA.begin()`函数,您的ESP32将开始监听OTA端口,准备接受固件更新。然后,您可以通过您偏好的方式(例如,使用Arduino IDE中的固件升级工具)将新的固件发送到设备。 一旦新的固件被接收到,ESP32将暂停当前的运行,安全地擦除旧的固件并将新的固件写入设备的闪存。一切完成后,设备将重新启动,并开始运行这个新的固件。 使用ESP32 Arduino OTA不仅方便快捷,而且可以避免拆卸设备进行固件升级的麻烦。无论您是为自己的项目还是为客户提供远程支持,ESP32 Arduino OTA都是一种强大的工具。只需几行代码和简单的步骤,您就可以轻松地将新的功能和改进推送到您的设备上。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值