This commit is contained in:
xyj 2023-12-02 18:52:19 +08:00
parent 2d0ae0144c
commit 9142a1bce3
1 changed files with 1 additions and 21 deletions

View File

@ -401,27 +401,7 @@ def t2():
def t1():
# run_with_client()
while True:
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
}
client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0)
time.sleep(60)
run_with_client()
client = mqtt.Client(transport="websockets")