update
This commit is contained in:
parent
2d139a039f
commit
ef268df604
|
@ -195,27 +195,30 @@ def local():
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
while True:
|
while True:
|
||||||
data = {'ambient_temperature': 1,
|
try:
|
||||||
'ambient_humidity': 1,
|
data = {'ambient_temperature': 1,
|
||||||
'carbon_dioxide': 1,
|
'ambient_humidity': 1,
|
||||||
'ambient_air_pressure': 1,
|
'carbon_dioxide': 1,
|
||||||
'ambient_lighting': 1,
|
'ambient_air_pressure': 1,
|
||||||
'soil_moisture': 1,
|
'ambient_lighting': 1,
|
||||||
'soil_temperature': 1,
|
'soil_moisture': 1,
|
||||||
'soil_conductivity': 1,
|
'soil_temperature': 1,
|
||||||
'soil_PH': 1,
|
'soil_conductivity': 1,
|
||||||
'soil_potassium_phosphate_nitrogen': 1,
|
'soil_PH': 1,
|
||||||
'soil_potassium_phosphate_phosphorus': 1,
|
'soil_potassium_phosphate_nitrogen': 1,
|
||||||
'soil_potassium_phosphate_potassium': 1,
|
'soil_potassium_phosphate_phosphorus': 1,
|
||||||
'rainfall': 1,
|
'soil_potassium_phosphate_potassium': 1,
|
||||||
'wind_speed': 1,
|
'rainfall': 1,
|
||||||
'wind_direction': 1,
|
'wind_speed': 1,
|
||||||
'create_time': int(time.time()),
|
'wind_direction': 1,
|
||||||
'device_name': device_name
|
'create_time': int(time.time()),
|
||||||
}
|
'device_name': device_name
|
||||||
t2 = LOT_DATA(**data)
|
}
|
||||||
add(t2)
|
t2 = LOT_DATA(**data)
|
||||||
time.sleep(1)
|
add(t2)
|
||||||
|
time.sleep(10)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -198,28 +198,31 @@ def t():
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
while True:
|
while True:
|
||||||
data = {'ambient_temperature': 1,
|
try:
|
||||||
'ambient_humidity': 1,
|
data = {'ambient_temperature': 1,
|
||||||
'carbon_dioxide': 1,
|
'ambient_humidity': 1,
|
||||||
'ambient_air_pressure': 1,
|
'carbon_dioxide': 1,
|
||||||
'ambient_lighting': 1,
|
'ambient_air_pressure': 1,
|
||||||
'soil_moisture': 1,
|
'ambient_lighting': 1,
|
||||||
'soil_temperature': 1,
|
'soil_moisture': 1,
|
||||||
'soil_conductivity': 1,
|
'soil_temperature': 1,
|
||||||
'soil_PH': 1,
|
'soil_conductivity': 1,
|
||||||
'soil_potassium_phosphate_nitrogen': 1,
|
'soil_PH': 1,
|
||||||
'soil_potassium_phosphate_phosphorus': 1,
|
'soil_potassium_phosphate_nitrogen': 1,
|
||||||
'soil_potassium_phosphate_potassium': 1,
|
'soil_potassium_phosphate_phosphorus': 1,
|
||||||
'rainfall': 1,
|
'soil_potassium_phosphate_potassium': 1,
|
||||||
'wind_speed': 1,
|
'rainfall': 1,
|
||||||
'wind_direction': 1,
|
'wind_speed': 1,
|
||||||
'create_time': int(time.time()),
|
'wind_direction': 1,
|
||||||
'device_name': device_name
|
'create_time': int(time.time()),
|
||||||
}
|
'device_name': device_name
|
||||||
t2 = LOT_DATA(**data)
|
}
|
||||||
client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0)
|
t2 = LOT_DATA(**data)
|
||||||
add(t2)
|
client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0)
|
||||||
time.sleep(1)
|
add(t2)
|
||||||
|
time.sleep(10)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def on_connect(client, userdata, flags, rc):
|
def on_connect(client, userdata, flags, rc):
|
||||||
|
|
Loading…
Reference in New Issue