esp8266 SDK安装编译,基本按照https://xuhong.blog.youkuaiyun.com/article/details/104736261安装就可以了
这里主要说一下我自己安装遇到的问题:
1.需要安装Python环境,我虚拟机安装Python的pip安装就是卡了我很长时间,最后我将pip的版本升级到pip --version 查看
pip 20.3.4 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)`升级到20.3.4
但是后面报错
DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
说的是Python3的版本低了,但是我好像用的是Python2.7的嘛,应该后面有用到Python3,ubuntu16自带的Python3.5不提供更新了,,那就只有升级Python3.5了
2.把ubuntu16的Python3升级到3.9。
参考https://www.pythonheidong.com/blog/article/803124/c734374bc8a9e05cedad/
最后效果是这样:
root@fengyang-virtual-machine:~# python3
Python 3.9.0 (default, Aug 31 2021, 11:35:51)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
于是乎又出现问题:在Ubuntu 16.04.6 LTS上安装python3.7和pip3后出现Command ‘(‘lsb_release’, ‘-a’)’
问题的解决办法:https://blog.youkuaiyun.com/tao_627/article/details/90901563
加入SDK根目录,运行./install.sh没有报错,运行结束了。
接着加入历程里面运行make menuconfig
弹出配置串口,没问题
make all
3问题:.fatal: 在 .gitmodules 中没有发现路径 ‘components/mqtt/esp-mqtt’ 的子模组映射,没有子模块,我就进入sdk的目录打开gedit .gitmodules
发现如何:
[submodule "components/json/cJSON"]
path = components/json/cJSON
url = https://gitee.com/xuhongv/cJSON.git
[submodule "components/mbedtls/mbedtls"]
path = components/mbedtls/mbedtls
url = https://gitee.com/xuhongv/mbedtls.git
[submodule "components/lwip/lwip"]
path = components/lwip/lwip
url = https://gitee.com/xuhongv/esp-lwip.git
于是在后面添加
[submodule "components/mqtt/esp-mqtt"]
path = components/mqtt/esp-mqtt
#url = https://gitee.com/xuhongv/esp-lwip.git
url = https://github.com/tuanpmt/esp_mqtt
完成报错。
最后 make all
/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 16MB
0x0 ESP8266_RTOS_SDK/examples/get-started/hello_world/build/bootloader/bootloader.bin
0x10000 ESP8266_RTOS_SDK/examples/get-started/hello_world/build/hello-world.bin
0x8000 ESP8266_RTOS_SDK/examples/get-started/hello_world/build/partitions_singleapp.bin
这就准备好了要烧录到esp8266的bin文件
使用SDK 的make flash烧录板子
1,问题:A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
解决:使用win的烧写工具烧写
ESPFlashDownloadTool_v3.6.4.exe
链接:https://www.espressif.com/zh-hans/support/download/other-tools
然后按照 make all 中提示的文件和烧录地址
0x0 ESP8266_RTOS_SDK/examples/get-started/hello_world/build/bootloader/bootloader.bin
0x10000 ESP8266_RTOS_SDK/examples/get-started/hello_world/build/hello-world.bin
0x8000 ESP8266_RTOS_SDK/examples/get-started/hello_world/build/partitions_singleapp.bin