forked from YujinChu/AWX_collector
test
This commit is contained in:
parent
34d005656f
commit
17087026fe
|
@ -8,6 +8,7 @@ import serial.rs485
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
import queue
|
import queue
|
||||||
|
import argparse
|
||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,12 +32,17 @@ ER2: OFF 횟수
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('-config',help='')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
ROOT_PATH = f"/usr/local/sdt/app/{args.config}"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# JSON FILE READ #
|
# JSON FILE READ #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
with open("./connect_info.json","r") as f:
|
with open(f"{args.config}/connect_info.json","r") as f:
|
||||||
info = json.load(f)
|
info = json.load(f)
|
||||||
|
|
||||||
|
|
||||||
|
|
35
config.json
35
config.json
|
@ -1 +1,34 @@
|
||||||
ss
|
{
|
||||||
|
"1": 0,
|
||||||
|
"2": 0,
|
||||||
|
"3": 1,
|
||||||
|
"4": 0,
|
||||||
|
"5": 1,
|
||||||
|
"6": 0,
|
||||||
|
"7": 0,
|
||||||
|
"8": 0,
|
||||||
|
"9": 0,
|
||||||
|
"10": 0,
|
||||||
|
"11": 0,
|
||||||
|
"12": 0,
|
||||||
|
"13": 0,
|
||||||
|
"14": 0,
|
||||||
|
"15": 0,
|
||||||
|
"16": 1,
|
||||||
|
"17": 0,
|
||||||
|
"18": 0,
|
||||||
|
"19": 0,
|
||||||
|
"20": 0,
|
||||||
|
"21": 0,
|
||||||
|
"22": 0,
|
||||||
|
"23": 0,
|
||||||
|
"24": 0,
|
||||||
|
"25": 0,
|
||||||
|
"26": 0,
|
||||||
|
"27": 0,
|
||||||
|
"28": 0,
|
||||||
|
"29": 0,
|
||||||
|
"30": 0,
|
||||||
|
"31": 0,
|
||||||
|
"32": 0
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"mqtt":{
|
||||||
|
"topic":"/device-data/NQ-R04-TEST-003",
|
||||||
|
"id":"sdt",
|
||||||
|
"pw":"251327",
|
||||||
|
"host_ip":"13.209.39.139",
|
||||||
|
"port":32259
|
||||||
|
},
|
||||||
|
"port1":{
|
||||||
|
"path": "/dev/ttyMAX1",
|
||||||
|
"baudrate":57600,
|
||||||
|
"parity":1,
|
||||||
|
"stopbits":0,
|
||||||
|
"bytesize":8
|
||||||
|
},
|
||||||
|
"port2":{
|
||||||
|
"path": "/dev/ttyMAX0",
|
||||||
|
"baudrate":57600,
|
||||||
|
"parity":1,
|
||||||
|
"stopbits":0,
|
||||||
|
"bytesize":8
|
||||||
|
},
|
||||||
|
"port3":{
|
||||||
|
"path": "/dev/ttyMAX2",
|
||||||
|
"baudrate":115200,
|
||||||
|
"parity":1,
|
||||||
|
"stopbits":0,
|
||||||
|
"bytesize":8
|
||||||
|
},
|
||||||
|
"port4":{
|
||||||
|
"path": "/dev/ttyMAX3",
|
||||||
|
"baudrate":115200,
|
||||||
|
"parity":1,
|
||||||
|
"stopbits":0,
|
||||||
|
"bytesize":8
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue