Compare commits

..

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

2 changed files with 13 additions and 53 deletions

View File

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

62
main.py
View File

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