Skip to content

Commit 6fae563

Browse files
committed
Switching to the current endpoint: mqtt.liveobjects.orange-business.com.
1 parent a4ecdef commit 6fae563

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

LiveObjects/Connection.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, board, deviceID, port, apiKey, debug = True):
4242
self.__port = port
4343
self.__apiKey = apiKey
4444
self.__parameters = {}
45-
self.__server = "liveobjects.orange-business.com"
45+
self.__server = "mqtt.liveobjects.orange-business.com"
4646
self.__topic = "dev/data"
4747
self.__value = "value"
4848
self.__payload = {self.__value: {}}
@@ -54,7 +54,7 @@ def __init__(self, board, deviceID, port, apiKey, debug = True):
5454
self.__mqtt = paho.Client(deviceID)
5555
else:
5656
self.ssl = port == 8883
57-
self.__mqtt = MQTTClient(deviceID, self.__server, self.__port, "json+device", self.__apiKey, 0, self.ssl, {})
57+
self.__mqtt = MQTTClient(deviceID, self.__server, self.__port, "json+device", self.__apiKey, 0, self.ssl, {'server_hostname':self.__server})
5858

5959
def loop(self):
6060
if self.mode == 0:
@@ -107,8 +107,9 @@ def connect(self):
107107
self.__mqtt.on_connect = self.__onConnect
108108
self.__mqtt.on_message = self.__onMessage
109109
if self.__port == 8883:
110-
dirname = os.path.dirname(__file__)
111-
filename = os.path.join(dirname, "./certfile.cer")
110+
# dirname = os.path.dirname(__file__)
111+
# filename = os.path.join(dirname, "./certfile.cer")
112+
filename = "/etc/ssl/certs/ca-certificates.crt"
112113
self.__mqtt.tls_set(filename)
113114
self.__mqtt.connect(self.__server, self.__port, 60)
114115
self.__mqtt.loop_start()

LiveObjects/hal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,16 @@ def is_waiting_for_pin():
199199
if is_waiting_for_pin():
200200
print("PIN", (lte.send_at_cmd('AT+CPIN="%s"' % pin)).strip())
201201
else:
202-
print("PIN READY")
202+
print("PIN PRESENT OK")
203203

204204
lte.attach()
205-
print("attaching... ", end='')
205+
print("Attaching... ", end='')
206206
while not lte.isattached():
207207
time.sleep(1)
208208
print("attached!")
209209

210210
lte.connect()
211-
print("connecting... ", end='')
211+
print("Connecting... ", end='')
212212
while not lte.isconnected():
213213
time.sleep(1)
214214
print("connected!")

0 commit comments

Comments
 (0)