Commit message
This commit is contained in:
parent
95921c49b8
commit
5c1d08ee98
|
@ -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.47 # Stackbase(gitea)에 릴리즈 태그명 입니다.
|
tagName: v0.0.48 # Stackbase(gitea)에 릴리즈 태그명 입니다.
|
||||||
repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다.
|
repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다.
|
||||||
|
|
26
main.py
26
main.py
|
@ -5,7 +5,7 @@ import sys, signal
|
||||||
import gpiod
|
import gpiod
|
||||||
from pymodbus.client import ModbusTcpClient
|
from pymodbus.client import ModbusTcpClient
|
||||||
# import AWSIoTPythonSDK.MQTTLib as AWSIoTPyMQTT
|
# import AWSIoTPythonSDK.MQTTLib as AWSIoTPyMQTT
|
||||||
import sdtcloudnodeqmqtt
|
# import sdtcloudnodeqmqtt
|
||||||
import pytz
|
import pytz
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import threading, socket
|
import threading, socket
|
||||||
|
@ -278,16 +278,16 @@ def clean_system():
|
||||||
Valve_MainWater(chip=output_lines, status=status, action='Off')
|
Valve_MainWater(chip=output_lines, status=status, action='Off')
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
Valve_EnterWater(chip=output_lines, status=status, action='On'])
|
Valve_EnterWater(chip=output_lines, status=status, action='On')
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
Valve_Vent(chip=output_lines, status=status, action='On'])
|
Valve_Vent(chip=output_lines, status=status, action='On')
|
||||||
time.sleep(clean_duration)
|
time.sleep(clean_duration)
|
||||||
|
|
||||||
Valve_PureWater(chip=output_lines, status=status, action='Off')
|
Valve_PureWater(chip=output_lines, status=status, action='Off')
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
Valve_Vent(chip=output_lines, status=status, action='Off'])
|
Valve_Vent(chip=output_lines, status=status, action='Off')
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
Valve_EnterWater(chip=output_lines, status=status, action='Off'])
|
Valve_EnterWater(chip=output_lines, status=status, action='Off')
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
def runAction():
|
def runAction():
|
||||||
|
@ -301,13 +301,13 @@ def runAction():
|
||||||
# 2. device-app-light-app -> Good
|
# 2. device-app-light-app -> Good
|
||||||
# 3. device-test-app -> Bad
|
# 3. device-test-app -> Bad
|
||||||
global data
|
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)
|
||||||
mqttClient3 = sdtcloud.setClient(f"device-app-3{uuid.uuid1()}") # parameter is client ID(string)
|
# mqttClient3 = sdtcloud.setClient(f"device-app-3{uuid.uuid1()}") # parameter is client ID(string)
|
||||||
mqttClient4 = sdtcloud.setClient(f"device-app-4{uuid.uuid1()}") # parameter is client ID(string)
|
# mqttClient4 = sdtcloud.setClient(f"device-app-4{uuid.uuid1()}") # parameter is client ID(string)
|
||||||
mqttClient5 = sdtcloud.setClient(f"device-app-5{uuid.uuid1()}") # parameter is client ID(string)
|
# mqttClient5 = sdtcloud.setClient(f"device-app-5{uuid.uuid1()}") # parameter is client ID(string)
|
||||||
mqttlist = [mqttClient1, mqttClient2, mqttClient3, mqttClient4, mqttClient5]
|
# mqttlist = [mqttClient1, mqttClient2, mqttClient3, mqttClient4, mqttClient5]
|
||||||
|
|
||||||
# If you have config's value, please make config.json file.
|
# If you have config's value, please make config.json file.
|
||||||
# - Project Code's variable: projectCode(string)
|
# - Project Code's variable: projectCode(string)
|
||||||
|
@ -322,7 +322,7 @@ def runAction():
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
data['timestamp'] = int(time.time() * 1000)
|
data['timestamp'] = int(time.time() * 1000)
|
||||||
sdtcloud.pubMessage(mqttlist[cnt], data)
|
# sdtcloud.pubMessage(mqttlist[cnt], data)
|
||||||
cnt += 1
|
cnt += 1
|
||||||
if cnt == 5:
|
if cnt == 5:
|
||||||
cnt = 0
|
cnt = 0
|
||||||
|
|
Loading…
Reference in New Issue