diff --git a/download_and_execute.sh b/download_and_execute.sh index 7285dd5..b2677eb 100644 --- a/download_and_execute.sh +++ b/download_and_execute.sh @@ -97,7 +97,7 @@ if [ -f "smp_init.sh" ]; then fi # 执行smp_init.sh -# ./smp_init.sh + ./smp_init.sh echo "smp_init.sh 执行完成" else echo "smp_init.sh 不存在" diff --git a/edu_coder/extur_edu.py b/edu_coder/extur_edu.py index e50932e..046176c 100644 --- a/edu_coder/extur_edu.py +++ b/edu_coder/extur_edu.py @@ -8,7 +8,7 @@ port = 48835 -with open("../user.txt", "r") as f: +with open("edu_coder/user.txt", "r") as f: user_id = f.read().strip() user_id = user_id.split("=")[-1] diff --git a/edu_coder/mqtt_edu.py b/edu_coder/mqtt_edu.py index fb77d3a..a050600 100644 --- a/edu_coder/mqtt_edu.py +++ b/edu_coder/mqtt_edu.py @@ -2,7 +2,7 @@ import paho.mqtt.client as mqtt import time import os -if not os.path.exists("user.txt"): +if not os.path.exists("edu_coder/user.txt"): os.system("bash get_user.sh") broker = '121.40.129.71' @@ -38,7 +38,7 @@ client.connect(broker, port, 60) # 启动一个后台线程来处理网络流量和回调 client.loop_start() -with open("user.txt", "r") as f: +with open("edu_coder/user.txt", "r") as f: user = f.read().strip() # # 发布消息 diff --git a/smp_coder/extur_smp.py b/smp_coder/extur_smp.py index 1c1ad87..8ea4d58 100644 --- a/smp_coder/extur_smp.py +++ b/smp_coder/extur_smp.py @@ -8,7 +8,7 @@ port = 48835 -with open("../user.txt", "r") as f: +with open("smp_coder/user.txt", "r") as f: user_id = f.read().strip() user_id = user_id.split("=")[-1] @@ -27,7 +27,7 @@ def on_message(client, userdata, msg): if msg.payload.decode() == "image produce": # 收到拍照请求 # 打开相机,拍照,保存图片,发送图片 if not os.path.exists("/tmp/image.jpg"): - os.system("bash camera.sh") + os.system("bash smp_coder/camera.sh") else: client.publish("response/{}".format(user_id), "image produce success!", qos=2)