Commit message

This commit is contained in:
support.sampyo 2024-07-30 05:22:35 +00:00
parent 5c1d08ee98
commit 50a6bf2373
2 changed files with 10 additions and 10 deletions

View File

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

18
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
@ -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