如何使用 PlatformIO espota ArduinOTA 上传通过防火墙
ArduinoOTA 的协议尝试在随机选择的端口上连接到正在尝试编程设备的主机。这通常导致数据包被防火墙过滤,因为没有规则允许通过数据包,而且它们与现有连接无关。
你可以创建防火墙规则允许从 ESP8266/ESP32 到编程主机的所有流量,但这极其不安全,因为它允许被黑客入侵的 IoT 设备攻击你的设备。
为了修复此问题,在 platformio.ini 中使用以下命令添加固定主机端口
example-3.ini
并添加这些防火墙规则:
example-2.txt
allow from <IoT device> to <programming host> port 55190 TCP完整的 platformio.ini 示例:
example-1.ini
extends = env:d1_mini
upload_protocol = espota
upload_port = 192.168.178.25
upload_flags = --host_port=55910Check out similar posts by category:
Embedded, ESP8266/ESP32, PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow