finnal
This commit is contained in:
Binary file not shown.
@@ -37,10 +37,15 @@ async def websocket_distance(websocket: WebSocket):
|
|||||||
# except Exception as log_e:
|
# except Exception as log_e:
|
||||||
# print(f"日志写入失败: {log_e}")
|
# print(f"日志写入失败: {log_e}")
|
||||||
#调用 Modbus 可执行文件
|
#调用 Modbus 可执行文件
|
||||||
|
# print(f"调用 Modbus 程序,传递距离: {distance}")
|
||||||
|
signal = "echo 'orangepi' | sudo "+ MODBUS_BIN_PATH
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
[MODBUS_BIN_PATH, str(int(distance))],
|
[signal],
|
||||||
capture_output=True, text=True, timeout=5
|
# shell=True,ocapture_output=True, text=True, timeout=0
|
||||||
|
shell=True
|
||||||
)
|
)
|
||||||
|
# print("signal:", signal)
|
||||||
|
# print(f"Modbus 程序返回: {result.stdout.strip()}, 错误: {result.stderr.strip()}")
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
# 发送错误信息给客户端
|
# 发送错误信息给客户端
|
||||||
await websocket.send_json({
|
await websocket.send_json({
|
||||||
|
Binary file not shown.
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <thread>
|
||||||
#include <wiringPi.h>
|
#include <wiringPi.h>
|
||||||
|
|
||||||
#include "/home/orangepi/RKApp/ApCreate/NetraLib/include/Netra.hpp"
|
#include "/home/orangepi/RKApp/ApCreate/NetraLib/include/Netra.hpp"
|
||||||
@@ -56,6 +57,11 @@ int main(int argc, char *argv[])
|
|||||||
WriteGpio(GPIO_Pin2, value);
|
WriteGpio(GPIO_Pin2, value);
|
||||||
cout << "[sendGpioSignal] 完成" << endl;
|
cout << "[sendGpioSignal] 完成" << endl;
|
||||||
|
|
||||||
|
this_thread::sleep_for(chrono::milliseconds(100));
|
||||||
|
|
||||||
|
WriteGpio(GPIO_Pin1, !value);
|
||||||
|
WriteGpio(GPIO_Pin2, !value);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -255,3 +255,83 @@
|
|||||||
2025-10-08 12:47:29 - 上传图片 /mnt/save/warning/warning_20251008_124723.jpg 时出错: timed out
|
2025-10-08 12:47:29 - 上传图片 /mnt/save/warning/warning_20251008_124723.jpg 时出错: timed out
|
||||||
2025-10-08 12:48:24 - 开始上传图片: /mnt/save/warning/warning_20251008_124823.jpg
|
2025-10-08 12:48:24 - 开始上传图片: /mnt/save/warning/warning_20251008_124823.jpg
|
||||||
2025-10-08 12:48:30 - 上传图片 /mnt/save/warning/warning_20251008_124823.jpg 时出错: timed out
|
2025-10-08 12:48:30 - 上传图片 /mnt/save/warning/warning_20251008_124823.jpg 时出错: timed out
|
||||||
|
2025-10-08 13:26:19 - 开始上传图片: /mnt/save/warning/warning_20251008_132618.jpg
|
||||||
|
2025-10-08 13:26:19 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 13:26:19 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 13:26:20 - 数据库插入成功
|
||||||
|
2025-10-08 13:26:20 - 上传线程结束: /mnt/save/warning/warning_20251008_132618.jpg: 成功!
|
||||||
|
2025-10-08 13:50:04 - 开始上传图片: /mnt/save/warning/warning_20251008_135004.jpg
|
||||||
|
2025-10-08 13:50:04 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 13:50:04 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 13:50:04 - 数据库插入成功
|
||||||
|
2025-10-08 13:50:04 - 上传线程结束: /mnt/save/warning/warning_20251008_135004.jpg: 成功!
|
||||||
|
2025-10-08 13:52:16 - 开始上传图片: /mnt/save/warning/warning_20251008_135216.jpg
|
||||||
|
2025-10-08 13:52:16 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 13:52:16 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 13:52:17 - 数据库插入成功
|
||||||
|
2025-10-08 13:52:17 - 上传线程结束: /mnt/save/warning/warning_20251008_135216.jpg: 成功!
|
||||||
|
2025-10-08 13:54:23 - 开始上传图片: /mnt/save/warning/warning_20251008_135422.jpg
|
||||||
|
2025-10-08 13:54:23 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 13:54:23 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 13:54:23 - 数据库插入成功
|
||||||
|
2025-10-08 13:54:23 - 上传线程结束: /mnt/save/warning/warning_20251008_135422.jpg: 成功!
|
||||||
|
2025-10-08 13:54:27 - 开始上传图片: /mnt/save/warning/warning_20251008_135425.jpg
|
||||||
|
2025-10-08 13:54:27 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 13:54:27 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 13:54:27 - 数据库插入成功
|
||||||
|
2025-10-08 13:54:27 - 上传线程结束: /mnt/save/warning/warning_20251008_135425.jpg: 成功!
|
||||||
|
2025-10-08 13:55:09 - 开始上传图片: /mnt/save/warning/warning_20251008_135508.jpg
|
||||||
|
2025-10-08 13:55:09 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 13:55:09 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 13:55:09 - 数据库插入成功
|
||||||
|
2025-10-08 13:55:09 - 上传线程结束: /mnt/save/warning/warning_20251008_135508.jpg: 成功!
|
||||||
|
2025-10-08 13:55:11 - 开始上传图片: /mnt/save/warning/warning_20251008_135509.jpg
|
||||||
|
2025-10-08 13:55:11 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 13:55:11 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 13:55:11 - 数据库插入成功
|
||||||
|
2025-10-08 13:55:11 - 上传线程结束: /mnt/save/warning/warning_20251008_135509.jpg: 成功!
|
||||||
|
2025-10-08 14:14:27 - 开始上传图片: /mnt/save/warning/warning_20251008_141427.jpg
|
||||||
|
2025-10-08 14:14:27 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 14:14:27 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 14:14:28 - 数据库插入成功
|
||||||
|
2025-10-08 14:14:28 - 上传线程结束: /mnt/save/warning/warning_20251008_141427.jpg: 成功!
|
||||||
|
2025-10-08 14:19:00 - 开始上传图片: /mnt/save/warning/warning_20251008_141859.jpg
|
||||||
|
2025-10-08 14:19:00 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 14:19:00 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 14:19:00 - 数据库插入成功
|
||||||
|
2025-10-08 14:19:00 - 上传线程结束: /mnt/save/warning/warning_20251008_141859.jpg: 成功!
|
||||||
|
2025-10-08 14:22:40 - 开始上传图片: /mnt/save/warning/warning_20251008_142240.jpg
|
||||||
|
2025-10-08 14:22:40 - 串口读取失败: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
|
||||||
|
2025-10-08 14:22:40 - 使用经纬度上传: lon=1201, lat=3129
|
||||||
|
2025-10-08 14:22:41 - 数据库插入成功
|
||||||
|
2025-10-08 14:22:41 - 上传线程结束: /mnt/save/warning/warning_20251008_142240.jpg: 成功!
|
||||||
|
2025-10-08 14:25:18 - 开始上传图片: /mnt/save/warning/warning_20251008_142518.jpg
|
||||||
|
2025-10-08 14:25:20 - 开始上传图片: /mnt/save/warning/warning_20251008_142519.jpg
|
||||||
|
2025-10-08 14:25:20 - 开始上传图片: /mnt/save/warning/warning_20251008_142520.jpg
|
||||||
|
2025-10-08 14:25:22 - 上传图片 /mnt/save/warning/warning_20251008_142518.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:25:22 - 上传图片 /mnt/save/warning/warning_20251008_142520.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:25:22 - 上传图片 /mnt/save/warning/warning_20251008_142519.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:25:22 - 开始上传图片: /mnt/save/warning/warning_20251008_142521.jpg
|
||||||
|
2025-10-08 14:25:22 - 开始上传图片: /mnt/save/warning/warning_20251008_142522.jpg
|
||||||
|
2025-10-08 14:25:25 - 上传图片 /mnt/save/warning/warning_20251008_142522.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:25:25 - 上传图片 /mnt/save/warning/warning_20251008_142521.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:25:26 - 开始上传图片: /mnt/save/warning/warning_20251008_142525.jpg
|
||||||
|
2025-10-08 14:25:28 - 上传图片 /mnt/save/warning/warning_20251008_142525.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:25:42 - 开始上传图片: /mnt/save/warning/warning_20251008_142541.jpg
|
||||||
|
2025-10-08 14:25:45 - 上传图片 /mnt/save/warning/warning_20251008_142541.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:29:35 - 开始上传图片: /mnt/save/warning/warning_20251008_142935.jpg
|
||||||
|
2025-10-08 14:29:37 - 上传图片 /mnt/save/warning/warning_20251008_142935.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:29:39 - 开始上传图片: /mnt/save/warning/warning_20251008_142937.jpg
|
||||||
|
2025-10-08 14:29:39 - 开始上传图片: /mnt/save/warning/warning_20251008_142939.jpg
|
||||||
|
2025-10-08 14:29:40 - 上传图片 /mnt/save/warning/warning_20251008_142937.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:29:40 - 上传图片 /mnt/save/warning/warning_20251008_142939.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:32:59 - 开始上传图片: /mnt/save/warning/warning_20251008_143258.jpg
|
||||||
|
2025-10-08 14:32:59 - 开始上传图片: /mnt/save/warning/warning_20251008_143259.jpg
|
||||||
|
2025-10-08 14:33:02 - 开始上传图片: /mnt/save/warning/warning_20251008_143301.jpg
|
||||||
|
2025-10-08 14:33:02 - 上传图片 /mnt/save/warning/warning_20251008_143259.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:33:02 - 上传图片 /mnt/save/warning/warning_20251008_143258.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:33:02 - 上传图片 /mnt/save/warning/warning_20251008_143301.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:33:54 - 开始上传图片: /mnt/save/warning/warning_20251008_143353.jpg
|
||||||
|
2025-10-08 14:33:54 - 上传图片 /mnt/save/warning/warning_20251008_143353.jpg 时出错: [Errno 113] No route to host
|
||||||
|
2025-10-08 14:33:56 - 开始上传图片: /mnt/save/warning/warning_20251008_143354.jpg
|
||||||
|
2025-10-08 14:33:57 - 上传图片 /mnt/save/warning/warning_20251008_143354.jpg 时出错: [Errno 113] No route to host
|
||||||
|
Reference in New Issue
Block a user