Compare commits

..

No commits in common. "main" and "v1.0.1" have entirely different histories.
main ... v1.0.1

2 changed files with 14 additions and 54 deletions

View File

@ -1,11 +1,11 @@
version: bwc/v2 # bwc 버전 정보입니다. version: bwc/v2 # bwc 버전 정보입니다.
spec: spec:
appName: manhole-app # 앱의 이름입니다. appName: gseps-app # 앱의 이름입니다.
runFile: main.py # 앱의 실행 파일입니다. runFile: main.py # 앱의 실행 파일입니다.
env: env:
bin: python3 # 앱을 실행할 바이너라 파일 종류입니다.(장비에 따라 다르므로 확인 후 정의해야 합니다.) bin: python3 # 앱을 실행할 바이너라 파일 종류입니다.(장비에 따라 다르므로 확인 후 정의해야 합니다.)
virtualEnv: manhole-env # 사용할 가상환경 이름입니다. virtualEnv: mqtt-s3-env # 사용할 가상환경 이름입니다.
package: requirement.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.) package: requirement.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.)
stackbase: stackbase:
tagName: v1.0.2 # Stackbase(gitea)에 릴리즈 태그명 입니다. tagName: v1.0.1 # Stackbase(gitea)에 릴리즈 태그명 입니다.
repoName: gseps-app-mqtt-s3 # Stackbase(gitea)에 저장될 저장소 이릅니다. repoName: gseps-app-mqtt-s3 # Stackbase(gitea)에 저장될 저장소 이릅니다.

62
main.py
View File

@ -17,66 +17,26 @@ def runAction():
while True: while True:
index = random.randint(0, 10) # float index = random.randint(0, 10) # float
if index < 5: if index < 5:
openValue = "ture" openValue = "open"
else: else:
openValue = "false" openValue = "close"
pngIndex = random.randint(0,2) pngIndex = random.randint(0,2)
pngList = ["./test1.png", "./test2.png", "./test3.png"] pngList = ["./test1.png", "./test2.png", "./test3.png"]
result = sdtcloudS3Client.uploadData(pngList[pngIndex], {"ContentType": "image/png"}) result = sdtcloudS3Client.uploadData(pngList[pngIndex], {"ContentType": "image/png"})
timedata = int(time.time()*1000)
data = { data = {
"rssi": { "temperature": random.uniform(0, 30), # float
"value": random.uniform(0, 30), # float, "water_level": random.randint(0, 30), # int,
"timestamp": timedata "open": openValue, # string
}, "image": result,
"gas_o2": { "data": {
"value": random.uniform(0, 30), # float, "temperature": random.uniform(0, 30), # float
"timestamp": timedata "water_level": random.randint(0, 30), # int
}, "open": openValue
"gas_h2s": { "image": result
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"rsrp": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"battery": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"sinr": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"rsrq": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"temperature": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"ph": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"humidity": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"water_level": {
"value": random.uniform(0, 30), # float,
"timestamp": timedata
},
"open": {
"value": openValue,
"timestamp": timedata
} }
} }
sdtcloudMqttClient.pubMessage(mqttClient, data) sdtcloudMqttClient.pubMessage(mqttClient, data)
time.sleep(10) time.sleep(10)