Compare commits
2 Commits
133b409d6c
...
b578b825b6
Author | SHA1 | Date |
---|---|---|
xyj | b578b825b6 | |
xyj | 5a834671f4 |
|
@ -60,7 +60,7 @@
|
||||||
<recent name="$PROJECT_DIR$/conf" />
|
<recent name="$PROJECT_DIR$/conf" />
|
||||||
</key>
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunManager" selected="Shell Script.git_push.sh">
|
<component name="RunManager" selected="Shell Script.git_push.sh (1)">
|
||||||
<configuration name="t" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
<configuration name="t" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
||||||
<module name="agri_xumu" />
|
<module name="agri_xumu" />
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
@ -82,27 +82,6 @@
|
||||||
<option name="INPUT_FILE" value="" />
|
<option name="INPUT_FILE" value="" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="tes" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
|
||||||
<module name="agri_xumu" />
|
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
|
||||||
<option name="PARENT_ENVS" value="true" />
|
|
||||||
<envs>
|
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
|
||||||
</envs>
|
|
||||||
<option name="SDK_HOME" value="" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
||||||
<option name="IS_MODULE_SDK" value="true" />
|
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tes.py" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
|
||||||
<option name="MODULE_MODE" value="false" />
|
|
||||||
<option name="REDIRECT_INPUT" value="false" />
|
|
||||||
<option name="INPUT_FILE" value="" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
<configuration name="test" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
<configuration name="test" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
||||||
<module name="agri_xumu" />
|
<module name="agri_xumu" />
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
@ -145,6 +124,21 @@
|
||||||
<option name="INPUT_FILE" value="" />
|
<option name="INPUT_FILE" value="" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<configuration name="git_push.sh (1)" type="ShConfigurationType" temporary="true">
|
||||||
|
<option name="SCRIPT_TEXT" value="" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/../agri_xumu/git_push.sh" />
|
||||||
|
<option name="SCRIPT_OPTIONS" value="" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||||
|
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/../agri_xumu" />
|
||||||
|
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||||
|
<option name="INTERPRETER_PATH" value="/bin/bash" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||||
|
<option name="EXECUTE_SCRIPT_FILE" value="true" />
|
||||||
|
<envs />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
<configuration name="git_push.sh" type="ShConfigurationType" temporary="true">
|
<configuration name="git_push.sh" type="ShConfigurationType" temporary="true">
|
||||||
<option name="SCRIPT_TEXT" value="" />
|
<option name="SCRIPT_TEXT" value="" />
|
||||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
@ -162,11 +156,11 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<recent_temporary>
|
<recent_temporary>
|
||||||
<list>
|
<list>
|
||||||
|
<item itemvalue="Shell Script.git_push.sh (1)" />
|
||||||
<item itemvalue="Shell Script.git_push.sh" />
|
<item itemvalue="Shell Script.git_push.sh" />
|
||||||
<item itemvalue="Python.test" />
|
<item itemvalue="Python.test" />
|
||||||
<item itemvalue="Python.video_task" />
|
<item itemvalue="Python.video_task" />
|
||||||
<item itemvalue="Python.t" />
|
<item itemvalue="Python.t" />
|
||||||
<item itemvalue="Python.tes" />
|
|
||||||
</list>
|
</list>
|
||||||
</recent_temporary>
|
</recent_temporary>
|
||||||
</component>
|
</component>
|
||||||
|
|
4
MQTT.py
4
MQTT.py
|
@ -33,10 +33,6 @@ class MQTTClient:
|
||||||
self.client.subscribe(self.topic)
|
self.client.subscribe(self.topic)
|
||||||
client.publish(info_topic, payload=publish_payload(code=200, msg='成功订阅' + self.topic),
|
client.publish(info_topic, payload=publish_payload(code=200, msg='成功订阅' + self.topic),
|
||||||
qos=0)
|
qos=0)
|
||||||
# 关闭摄像机电
|
|
||||||
subprocess.Popen(['sudo /usr/bin/python close_led.py'], shell=True)
|
|
||||||
# 关闭LED灯
|
|
||||||
subprocess.Popen(['sudo /usr/bin/python close_blue_led.py'], shell=True)
|
|
||||||
|
|
||||||
def on_message(self, client, userdata, msg):
|
def on_message(self, client, userdata, msg):
|
||||||
if not valid(msg, client):
|
if not valid(msg, client):
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
# 设备1-32G
|
|
||||||
# 编号
|
# 编号
|
||||||
[xumu_a001]
|
[xumu_d001]
|
||||||
# 订阅的控制主题,必须和系统设置的相同
|
# 订阅的控制主题,必须和系统设置的相同
|
||||||
subscribe_topic=xumu_a001
|
subscribe_topic=xumu_d001
|
||||||
# 发布消息的主题
|
info_topic=info_xumu_d001
|
||||||
publish_topic=a001
|
|
||||||
info_topic=info_xumu_a001
|
|
||||||
username=lihai_lot_land1
|
username=lihai_lot_land1
|
||||||
password=lihai_lot_land1
|
password=lihai_lot_land1
|
|
@ -2,6 +2,3 @@
|
||||||
[broker]
|
[broker]
|
||||||
host=mqtt.lihaink.cn
|
host=mqtt.lihaink.cn
|
||||||
port=1883
|
port=1883
|
||||||
[record]
|
|
||||||
post_record_list_url=https://iot.lihaink.cn/api/index/file_list
|
|
||||||
post_record_url=https://iot.lihaink.cn/api/index/upload
|
|
6
tool.py
6
tool.py
|
@ -23,7 +23,7 @@ def exception_handler(func):
|
||||||
|
|
||||||
|
|
||||||
def push_stream(client):
|
def push_stream(client):
|
||||||
p = subprocess.Popen(['/bin/bash /home/pi/lot_manager/bash/start_push_stream.sh'],
|
p = subprocess.Popen(['/bin/bash /home/pi/agri_xumu/bash/start_push_stream.sh'],
|
||||||
shell=True,
|
shell=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
@ -33,7 +33,7 @@ def push_stream(client):
|
||||||
|
|
||||||
|
|
||||||
def close_stream(client):
|
def close_stream(client):
|
||||||
p = subprocess.Popen(['/bin/bash /home/pi/lot_manager/bash/stop_push_stream.sh'],
|
p = subprocess.Popen(['/bin/bash /home/pi/agri_xumu/bash/stop_push_stream.sh'],
|
||||||
shell=True,
|
shell=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
@ -73,7 +73,7 @@ def get_status(client):
|
||||||
|
|
||||||
|
|
||||||
def update(client):
|
def update(client):
|
||||||
p = subprocess.Popen(['/bin/bash /home/pi/lot_manager/git_update.sh'],
|
p = subprocess.Popen(['/bin/bash /home/pi/agri_xumu/git_update.sh'],
|
||||||
shell=True,
|
shell=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
|
Loading…
Reference in New Issue