From f7bbca59a378cb3815bb75a8fc962c5fee01e7e1 Mon Sep 17 00:00:00 2001 From: zart Date: Fri, 28 Jun 2024 09:40:50 +0800 Subject: [PATCH] msg MQTT message --- smp_coder/extur_smp.py | 5 +++++ smp_init.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/smp_coder/extur_smp.py b/smp_coder/extur_smp.py index 4916813..8a33905 100644 --- a/smp_coder/extur_smp.py +++ b/smp_coder/extur_smp.py @@ -8,6 +8,7 @@ port = 48835 print(os.getcwd()) + with open("smp_coder/user.txt", "r") as f: user_id = f.read().strip() user_id = user_id.split("=")[-1] @@ -64,3 +65,7 @@ client.loop_stop() client.disconnect() print("收到响应,客户端退出。") + +os.system("sudo myenv/bin/python3 smp_coder/extur_smp.py > logex.txt 2>&1 &") +print("启动树莓派拍照客户端成功。") + diff --git a/smp_init.sh b/smp_init.sh index 662eef2..35258e3 100644 --- a/smp_init.sh +++ b/smp_init.sh @@ -52,12 +52,12 @@ else fi # 运行第二关的extur_smp.py -nohup sudo $env_dir/bin/python3 smp_coder/extur_smp.py > logex.txt 2>&1 & -if [ $? -eq 0 ]; then - echo "extur_smp.py 启动成功" -else - echo "extur_smp.py 启动失败" -fi +#nohup sudo $env_dir/bin/python3 smp_coder/extur_smp.py > logex.txt 2>&1 & +#if [ $? -eq 0 ]; then +# echo "extur_smp.py 启动成功" +#else +# echo "extur_smp.py 启动失败" +#fi