Skip to content

Commit

Permalink
feat(pio): 更新一键安装fishbot环境
Browse files Browse the repository at this point in the history
  • Loading branch information
fishros committed Jul 10, 2024
1 parent f5aa351 commit 30a0c41
Showing 1 changed file with 15 additions and 30 deletions.
45 changes: 15 additions & 30 deletions tools/tool_install_micros_fishbot_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,23 @@ def install_nodejs(self):

PrintUtils.print_info("开始生成安装脚本~")
install_sh = """export HOME={} && $HOME.platformio/penv/bin/pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple platformio
export http_proxy=http://fishros.org:8899 && export https_proxy=http://fishros.org:8899
echo "开始下载ESP32开发依赖库~"
echo "当前进度: 1/7"
$HOME.platformio/penv/bin/pio pkg install --global --platform "platformio/espressif32"
echo "当前进度: 2/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/contrib-piohome"
echo "当前进度: 3/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/framework-arduinoespressif32"
echo "当前进度: 4/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-scons"
echo "当前进度: 5/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-mkfatfs"
echo "当前进度: 6/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-mkspiffs"
echo "当前进度: 7/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-mklittlefs"
echo "\n开始确认ESP32开发依赖库安装状态~"
rm -rf /tmp/pio
mkdir -p /tmp/pio/
cd /tmp/pio
touch platformio.ini
mkdir src
wget http://github.fishros.org/https://raw.githubusercontent.com/fishros/example_micoros_board/main/example01_helloworld/src/main.cpp -O src/main.cpp
echo "[env:featheresp32]" >> platformio.ini
echo "platform = espressif32" >> platformio.ini
echo "board = featheresp32" >> platformio.ini
echo "framework = arduino" >> platformio.ini
source $HOME/.platformio/penv/bin/activate
export http_proxy=http://fishros.org:8899 && export https_proxy=http://fishros.org:8899
pio run
export http_proxy= && export https_proxy=
echo "当前进度: 1/7"
$HOME.platformio/penv/bin/pio pkg install --global --platform "platformio/espressif32"
echo "当前进度: 2/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/contrib-piohome"
echo "当前进度: 3/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/framework-arduinoespressif32"
echo "当前进度: 4/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-scons"
echo "当前进度: 5/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-mkfatfs"
echo "当前进度: 6/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-mkspiffs"
echo "当前进度: 7/7"
$HOME.platformio/penv/bin/pio pkg install --global --tool "platformio/tool-mklittlefs"
pio run
rm -rf /tmp/pio
""".format(user_home)
FileUtils.new('/tmp/', 'install_pio.sh',install_sh)
CmdTask('sudo -u {} bash /tmp/install_pio.sh'.format(user), os_command=True).run()
Expand Down

0 comments on commit 30a0c41

Please sign in to comment.