This commit is contained in:
xyj 2023-12-02 13:26:11 +08:00
parent 5dd7f5793e
commit 5cccf42674
3 changed files with 2 additions and 40 deletions

View File

@ -1,13 +0,0 @@
[program:test]
directory=/home/pi/lot_manager
command=/usr/bin/python test.py
user=pi
;是否随开机自启 或者reload自启动
autostart=false
;失败重启
autorestart=true
;重启次数
restart_times=3
redirect_stderr=true
stopsignal=TERM
stopasgroup=True

View File

@ -3,4 +3,5 @@ sqlalchemy~=2.0.19
uvicorn~=0.23.2
fastapi~=0.95.1
paho-mqtt~=1.6.1
requests~=2.31.0
requests~=2.31.0
pyserial~=3.5

26
test.py
View File

@ -1,26 +0,0 @@
import datetime
import time
import requests
# data = {
# "wind_speed": 26,
# "wind_direction": 6,
# "ambient_temperature": 66,
# "ambient_humidity": 78,
# "carbon_dioxide": 94,
# "ambient_air_pressure": 48,
# "rainfall": 3,
# "ambient_lighting": 59,
# "soil_temperature": 71,
# "soil_moisture": 19,
# "soil_conductivity": 62,
# "soil_PH": 49,
# "soil_potassium_phosphate_nitrogen": 5,
# "soil_potassium_phosphate_phosphorus": 5,
# "soil_potassium_phosphate_potassium": 86
# }
# data = LOT_DATA(**data, create_time=int(time.time()))
# add(data)
# print(data)
# requests.post("http://192.168.1.27:8000/add/lot_data", json=data)