Commit message

This commit is contained in:
support.sampyo 2024-07-30 04:55:55 +00:00
parent 95921c49b8
commit 5c1d08ee98
2 changed files with 14 additions and 14 deletions

View File

@ -7,5 +7,5 @@ spec:
virtualEnv: base # 사용할 가상환경 이름입니다.
package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.)
stackbase:
tagName: v0.0.47 # Stackbase(gitea)에 릴리즈 태그명 입니다.
tagName: v0.0.48 # Stackbase(gitea)에 릴리즈 태그명 입니다.
repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다.

26
main.py
View File

@ -5,7 +5,7 @@ import sys, signal
import gpiod
from pymodbus.client import ModbusTcpClient
# import AWSIoTPythonSDK.MQTTLib as AWSIoTPyMQTT
import sdtcloudnodeqmqtt
# import sdtcloudnodeqmqtt
import pytz
from datetime import datetime
import threading, socket
@ -278,16 +278,16 @@ def clean_system():
Valve_MainWater(chip=output_lines, status=status, action='Off')
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)
Valve_Vent(chip=output_lines, status=status, action='On'])
Valve_Vent(chip=output_lines, status=status, action='On')
time.sleep(clean_duration)
Valve_PureWater(chip=output_lines, status=status, action='Off')
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)
Valve_EnterWater(chip=output_lines, status=status, action='Off'])
Valve_EnterWater(chip=output_lines, status=status, action='Off')
time.sleep(0.5)
def runAction():
@ -301,13 +301,13 @@ def runAction():
# 2. device-app-light-app -> Good
# 3. device-test-app -> Bad
global data
sdtcloud = sdtcloudnodeqmqtt.sdtcloudnodeqmqtt()
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)
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)
mqttClient5 = sdtcloud.setClient(f"device-app-5{uuid.uuid1()}") # parameter is client ID(string)
mqttlist = [mqttClient1, mqttClient2, mqttClient3, mqttClient4, mqttClient5]
# sdtcloud = sdtcloudnodeqmqtt.sdtcloudnodeqmqtt()
# 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)
# 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)
# mqttClient5 = sdtcloud.setClient(f"device-app-5{uuid.uuid1()}") # parameter is client ID(string)
# mqttlist = [mqttClient1, mqttClient2, mqttClient3, mqttClient4, mqttClient5]
# If you have config's value, please make config.json file.
# - Project Code's variable: projectCode(string)
@ -322,7 +322,7 @@ def runAction():
if result:
data['timestamp'] = int(time.time() * 1000)
sdtcloud.pubMessage(mqttlist[cnt], data)
# sdtcloud.pubMessage(mqttlist[cnt], data)
cnt += 1
if cnt == 5:
cnt = 0