Commit message
This commit is contained in:
parent
370d851500
commit
c1f26f9340
|
@ -18,11 +18,11 @@
|
||||||
},
|
},
|
||||||
"enter":{
|
"enter":{
|
||||||
"action": "Off",
|
"action": "Off",
|
||||||
"duration": 10
|
"duration": 5
|
||||||
},
|
},
|
||||||
"vent": {
|
"vent": {
|
||||||
"action": "Off",
|
"action": "Off",
|
||||||
"duration": 30,
|
"duration": 15,
|
||||||
"holding": 2
|
"holding": 2
|
||||||
},
|
},
|
||||||
"motor": {
|
"motor": {
|
||||||
|
|
|
@ -7,5 +7,5 @@ spec:
|
||||||
virtualEnv: base # 사용할 가상환경 이름입니다.
|
virtualEnv: base # 사용할 가상환경 이름입니다.
|
||||||
package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.)
|
package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.)
|
||||||
stackbase:
|
stackbase:
|
||||||
tagName: v0.0.25 # Stackbase(gitea)에 릴리즈 태그명 입니다.
|
tagName: v0.0.26 # Stackbase(gitea)에 릴리즈 태그명 입니다.
|
||||||
repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다.
|
repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다.
|
||||||
|
|
9
main.py
9
main.py
|
@ -56,14 +56,15 @@ def Measure_Weight(client):
|
||||||
val = 0
|
val = 0
|
||||||
try:
|
try:
|
||||||
result = client.read_holding_registers(1, 1)
|
result = client.read_holding_registers(1, 1)
|
||||||
if result.iserror():
|
if not result:
|
||||||
print(f'Error: {result}')
|
print(f'Error: {result}')
|
||||||
else:
|
else:
|
||||||
val = result.registers[0]
|
val = result.registers[0]
|
||||||
val -= 1000
|
val -= 1000
|
||||||
val /= 1000
|
val /= 1000
|
||||||
#print(f'value: {val}')
|
# print(f'value: {val}')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(f'Measure_Weight Error: {e}')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return float(val)
|
return float(val)
|
||||||
|
@ -204,7 +205,7 @@ def runAction():
|
||||||
# 1. device-app-test -> Good
|
# 1. device-app-test -> Good
|
||||||
# 2. device-app-light-app -> Good
|
# 2. device-app-light-app -> Good
|
||||||
# 3. device-test-app -> Bad
|
# 3. device-test-app -> Bad
|
||||||
global data, client
|
global data
|
||||||
sdtcloud = sdtcloudnodeqmqtt.sdtcloudnodeqmqtt()
|
sdtcloud = sdtcloudnodeqmqtt.sdtcloudnodeqmqtt()
|
||||||
mqttClient1 = sdtcloud.setClient(f"device-app-1{uuid.uuid1()}") # parameter is client ID(string)
|
mqttClient1 = sdtcloud.setClient(f"device-app-1{uuid.uuid1()}") # parameter is client ID(string)
|
||||||
mqttClient2 = sdtcloud.setClient(f"device-app-2{uuid.uuid1()}") # parameter is client ID(string)
|
mqttClient2 = sdtcloud.setClient(f"device-app-2{uuid.uuid1()}") # parameter is client ID(string)
|
||||||
|
@ -218,7 +219,6 @@ def runAction():
|
||||||
# - Asset Code's variable: assetCode(string)
|
# - Asset Code's variable: assetCode(string)
|
||||||
# - You may need it to create a topic.
|
# - You may need it to create a topic.
|
||||||
|
|
||||||
|
|
||||||
cnt = 0
|
cnt = 0
|
||||||
while True:
|
while True:
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
@ -348,6 +348,7 @@ def exit_handler(signum, frame):
|
||||||
Valve_Vent(chip=output_lines, status=status, action='Off')
|
Valve_Vent(chip=output_lines, status=status, action='Off')
|
||||||
Valve_MixedWater(chip=output_lines, status=status, action='Off')
|
Valve_MixedWater(chip=output_lines, status=status, action='Off')
|
||||||
Valve_PureWater(chip=output_lines, status=status, action='Off')
|
Valve_PureWater(chip=output_lines, status=status, action='Off')
|
||||||
|
Valve_EnterWater(chip=output_lines, status=status, action='Off')
|
||||||
|
|
||||||
client.close()
|
client.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue