Skip to content

Commit

Permalink
Merge branch 'v1.2-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
abadar05 committed Jun 22, 2020
2 parents 83b99bc + 0675cda commit cbb22a5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
11 changes: 5 additions & 6 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"general":{
"broker": "cnm-ih-na.azure-devices.net",
"port": 8883,
"client_id": "urn:dev:ops:000000-EMA-prod-35e2e86e0226777586316eb5",
"broker": "mqtts://cnm-ih-na.azure-devices.net:8883",
"client_id": "urn:dev:ops:000000-EMA-prod-a2096a57e3c7bf2e0aa1809b",
"clean_session": false,
"keep_alive_sec": 30
},
"credentials":{
"user_name": "cnm-ih-na.azure-devices.net/urn:dev:ops:000000-EMA-prod-35e2e86e0226777586316eb5",
"user_name": "cnm-ih-na.azure-devices.net/urn:dev:ops:000000-EMA-prod-a2096a57e3c7bf2e0aa1809b",
"password": "schneider-eco-structure-token"
},
"ssl/tls":{
"enable_tls": true,
"tls_insecure_set": false
},
"things-pro":{
"asset_name": "TAILB1015962",
"mx_api_token": "$2b$10$rqI5mRWxPspcUbh.1aJWF.mK23eJI52UCSlPyjgXuhbVA4wiAdln2",
"asset_name": "TAILB1015963",
"mx_api_token": "$2b$10$SE09Yv5NZGFzONuBDtbYZ.46928ZQdaxuC65r8HWkmix0RJpub.hy",
"device_name": "ModSlave-Device",
"system_status": true
}
Expand Down
4 changes: 3 additions & 1 deletion se-connector/get_modbus_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ def getModbusTags():
'https://localhost/api/v1/mxc/equipments',
headers=headers,
verify=False)


print ("Return code :", r.status_code)
data = r.json()


"""
Parser
Expand Down
14 changes: 12 additions & 2 deletions se-connector/sub-mbus-and-publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,18 @@ def on_log(client, userdata, level, buf):
"""
Connect to broker
"""
ret=client.connect(host= cfg["general"]["broker"],
port= cfg["general"]["port"],

broker_url = (cfg["general"]["broker"])
modified_url = broker_url.split("//")[1]

url = modified_url.split(":")[0]
port = modified_url.split(":")[1]

# Convert from unicode into integer
port = int(str(port))

ret=client.connect(host= url,
port= port,
keepalive= cfg["general"]["keep_alive_sec"])

print ("Connecting to broker: {}".format(cfg["general"]["broker"]))
Expand Down

0 comments on commit cbb22a5

Please # to comment.