环境:Ubuntu 18.04 WSL 最好有梯子,配合proxychains来编译,或者直接使用vultr的机子来。 建议不要用root用户
sudo apt install gcc make git wget curl flex bison gperf python-serial libncurses5-dev python3-pip python-pip python python3
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
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"
cd micropython/micropython
make -C mpy-cross
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
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
对比Makefile
$MPTD/Makefile #我的提供的文件
../esp32/Makefile #esp32目录下的Makefile
搜索关键词cam
,大概会有12处可以匹配到。
然后把那整行或整段的添加到相应的位置。