This commit is contained in:
xyj 2024-01-24 17:49:33 +08:00
parent 0bdbeb9cf7
commit 59e6f59d36
7 changed files with 22 additions and 70 deletions

View File

@ -5,55 +5,13 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="6fcbdb26-1795-4695-b353-57b405f1e401" name="Changes" comment=""> <list default="true" id="6fcbdb26-1795-4695-b353-57b405f1e401" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" /> <change afterPath="$PROJECT_DIR$/conf/main/common.conf" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/lot_manager.iml" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/conf/common/mqtt.conf" beforeDir="false" afterPath="$PROJECT_DIR$/conf/common/mqtt.conf" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/api.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/cron_delete_mp4.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/modify_device_name.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/record.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/start_data_upload.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/start_push_stream.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/stop_data_upload.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/stop_push_stream.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/bash/stream.sh" beforeDir="false" afterPath="$PROJECT_DIR$/bash/stream.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/close_blue_led.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/close_led.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/common/data_upload.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/common/record.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/common/sensor_to_local.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/common/sensor_to_server.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/device/device.conf" beforeDir="false" afterPath="$PROJECT_DIR$/conf/device/device.conf" afterDir="false" /> <change beforePath="$PROJECT_DIR$/conf/device/device.conf" beforeDir="false" afterPath="$PROJECT_DIR$/conf/device/device.conf" afterDir="false" />
<change beforePath="$PROJECT_DIR$/conf/example/bash/cron_set_for_32G.sh" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/conf/example/supervisord.conf" beforeDir="false" afterPath="$PROJECT_DIR$/conf/example/supervisord.conf" afterDir="false" />
<change beforePath="$PROJECT_DIR$/conf/example/bash/cron_set_for_64G.sh" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/config.py" beforeDir="false" afterPath="$PROJECT_DIR$/config.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/conf/example/bash/start_dataupload_internal_one_hour.sh" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/tool.py" beforeDir="false" afterPath="$PROJECT_DIR$/tool.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/conf/example/bash/stop_dataupload_internal_one_hour.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/example/cron_for_32G.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/example/cron_for_64G.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/example/cron_for_dataupload.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/main/common.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/conf/zhanguan/topic.conf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/create_db.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/data_upload.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/__init__.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/base.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/models/__init__.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/models/base.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/models/lot_data_model.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/repository/__init__.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/repository/lot_data_repository.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db/session.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/delete_lot_data_3_days.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/delete_than20G.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/install.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/open_blue_led.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/open_led.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/requirements.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/sensor_to_local.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/sensor_to_server.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/video_task.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/物联网系统程序开发流程.docx" beforeDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -90,17 +48,17 @@
"RunOnceActivity.OpenProjectViewOnStart": "true", "RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "master", "git-widget-placeholder": "master",
"last_opened_file_path": "/home/lihai/pythonProjects/xumu_iot/bash", "last_opened_file_path": "/home/lihai/pythonProjects/xumu_iot/conf",
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"
} }
}]]></component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/conf" />
<recent name="$PROJECT_DIR$/bash" /> <recent name="$PROJECT_DIR$/bash" />
<recent name="$PROJECT_DIR$" /> <recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/conf/example/bash" /> <recent name="$PROJECT_DIR$/conf/example/bash" />
<recent name="$PROJECT_DIR$/conf/example" /> <recent name="$PROJECT_DIR$/conf/example" />
<recent name="$PROJECT_DIR$/conf/main" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/conf/example/bash" /> <recent name="$PROJECT_DIR$/conf/example/bash" />

View File

@ -1,5 +1,5 @@
[program:__mqtt__] [program:__mqtt__]
directory=/home/pi/lot_manager directory=/home/pi/xumu_iot
command=/usr/bin/python MQTT.py command=/usr/bin/python MQTT.py
user=pi user=pi
autostart=true autostart=true

View File

@ -1,10 +1,10 @@
# 设备1-32G # 设备1-32G
# 编号 # 编号
[xumu_camera_1] [xumu_a001]
# 订阅的控制主题,必须和系统设置的相同 # 订阅的控制主题,必须和系统设置的相同
subscribe_topic=xumu_camera_1 subscribe_topic=xumu_a001
# 发布消息的主题 # 发布消息的主题
publish_topic=camera_1 publish_topic=a001
info_topic=info_xumu_camera_1 info_topic=info_xumu_a001
username=lihai_lot_land1 username=lihai_lot_land1
password=lihai_lot_land1 password=lihai_lot_land1

View File

@ -27,7 +27,7 @@ user=pi
host = 127.0.0.1 host = 127.0.0.1
port = 9001 port = 9001
[program:__mqtt__] [program:__mqtt__]
directory=/home/pi/lot_manager directory=/home/pi/xumu_iot
command=/usr/bin/python MQTT.py command=/usr/bin/python MQTT.py
user=pi user=pi
autostart=true autostart=true

7
conf/main/common.conf Normal file
View File

@ -0,0 +1,7 @@
# 域名地址
[broker]
host=mqtt.lihaink.cn
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

View File

@ -16,9 +16,6 @@ try:
broker = config.get("broker", "host") broker = config.get("broker", "host")
# 端口这里必须是int类型 # 端口这里必须是int类型
port = config.getint("broker", "port") port = config.getint("broker", "port")
# 录像地址
post_record_list_url = config.get("record", "post_record_list_url")
post_record_url = config.get("record", "post_record_url")
# 读取设备配置 # 读取设备配置
config.read('conf/device/device.conf') config.read('conf/device/device.conf')
@ -33,12 +30,6 @@ try:
# 密码 # 密码
password = config.get(device_name, "password") password = config.get(device_name, "password")
# 特殊配置
config.read('conf/zhanguan/topic.conf')
zhanguan_device_name = config.get("device", "name")
# tool配置
mp4_path = '/home/pi/mp4'
except Exception as e: except Exception as e:
# print(e) # print(e)
pass pass

View File

@ -1,11 +1,7 @@
import json import json
import os
import subprocess import subprocess
import threading
import requests from config import info_topic
from config import mp4_path, post_record_list_url, post_record_url, info_topic
# 统一返回 # 统一返回