Skip to content

Commit 11e6c3c

Browse files
committed
Correction of LTE connection method for GPy.
1 parent 6c69090 commit 11e6c3c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

LiveObjects/hal.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def get_apikey(self):
2222
def get_client_id(self):
2323
return self._lang + 'MQTT'
2424

25-
def mqtt_lib_import_str(self, lang):
26-
# https://stackoverflow.com/questions/8718885/import-module-from-string-variable
25+
@staticmethod
26+
def mqtt_lib_import_str(lang):
2727
import_strings = {
2828
'microPython': 'from umqttrobust import MQTTClient',
2929
'Python': 'import paho.mqtt.client as paho'
@@ -145,14 +145,14 @@ def pycom_wifi_connect(ssid, password):
145145
break
146146

147147

148-
def mobile_connect(pin):
149-
# noinspection PyUnresolvedReferences
148+
def lte_connect(pin):
149+
150150
from network import LTE
151151
import socket
152152

153153
lte = LTE()
154154
time.sleep(2)
155-
print("PIN", (lte.send_at_cmd(f'AT+CPIN="{pin}"')).strip())
155+
print("PIN", (lte.send_at_cmd('AT+CPIN="%s"' % pin)).strip())
156156

157157
lte.attach()
158158
print("attaching... ", end='')

0 commit comments

Comments
 (0)