如何给ESP32-CAM编译micropython
如何,ESP32,CAM,编译,micropython
2025-03-25 08:59:30 时间
0x0 编译前须知
环境:Ubuntu 18.04 WSL 最好有梯子,配合proxychains来编译,或者直接使用vultr的机子来。 建议不要用root用户
0x01 配置必要环境
sudo apt install gcc make git wget curl flex bison gperf python-serial libncurses5-dev python3-pip python-pip python python3
0x02 下载代码及相关工具
mkdir micropython
cd micropython
git clone --recursive https://github.com/espressif/esp-idf.git
git clone --depth=50 --branch=master https://github.com/micropython/micropython.git
curl -L https://dl.espressif.com/dl/xtensa-esp32-elf-gcc8_2_0-esp-2019r2-linux-amd64.tar.gz | tar zxf
wget https://cdn.jsdelivr.net/gh/ITJoker233/Blog/esp32-cam.tar.xz
mkdir esp32-cam
tar -xzvf esp32-cam.tar.gz -C esp32-cam
sudo pip3 install 'pyparsing<2.4' pyserial
0x03 linux 环境变量里添加路径
cd
export PATH="$PWD/micropython/xtensa-esp32-elf/bin:~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export ESPIDF="$PWD/micropython/esp-idf"
export MPTD="$PWD/micropython/esp32-cam"
0x04 编译mpy-cross
cd micropython/micropython
make -C mpy-cross
0x05 esp-idf切换到v4.0,并更新子模块
cd ..
git -C esp-idf checkout $(grep "ESPIDF_SUPHASH_V4 :=" micropython/ports/esp32/Makefile | cut -d " " -f 3)
git -C esp-idf submodule update --init
git -C micropython submodule update --init
cd esp-idf/components
git clone https://github.com/espressif/esp32-camera.git
0x06 编译esp32-cam
cd ../..
make -C micropython/ports/esp32 submodules -j4
cp -r micropython/ports/esp32 micropython/ports/esp32-cam
cd micropython/ports/esp32-cam
cp $MPTD/Makefile .
cp $MPTD/modcamera.c .
cp $MPTD/mpconfigport.h .
cp $MPTD/boards/manifest.py ./boards/manifest.py
cp $MPTD/boards/sdkconfig.base ./boards/sdkconfig.base
make clean
make V=1 -j4
如果没有报错应该大功告成了 XD....
如果出现编译错误,例如缺少xxx.c文件,尝试修改编译目录下的Makefile,具体思路如下:
对比Makefile
$MPTD/Makefile #我的提供的文件
../esp32/Makefile #esp32目录下的Makefile
搜索关键词cam
,大概会有12处可以匹配到。
然后把那整行或整段的添加到相应的位置。
相关文章
- 【InventWithPython 第一部分】校对活动正式启动
- python re.compile() 详解——Python正则表达式「建议收藏」
- 用了2周,终于把Python网站开发库大全整理完了
- python button使用方法_python gui界面设计
- 不止短信!教你用 Python 发送告警通知到微信
- Win10配置Airsim环境并设置Python通信
- 如何查看python源码_python判断路径是否存在
- python的第三方库是用什么实现的_python 第三方库
- python anaconda jupyter_anaconda和pip
- python实现微信发消息
- Python版PHP内置的MD5()函数
- 2022春节贺岁档电影开分,水门桥不理想,四海崩了!用Python一探究竟
- Python 哈希表查询_进入<哈希函数>为结界的世界
- 整理了上千个Python类库,简直太酷啦!
- Python 链接/操作 MongoDB 数据库
- Python中的语法糖甜不甜?
- python 变量与数据类型
- Python-方法反射
- Python正则表达式,这一篇就够了!
- python之抛出异常(raise语句)「建议收藏」