try to init modem one by one

This commit is contained in:
2022-03-03 13:08:31 +01:00
parent db82f042a0
commit f4c6528c5e
2 changed files with 25 additions and 21 deletions
+7
View File
@@ -13,3 +13,10 @@ class SerialModem():
def __init__(self, modem: GsmModem, ccid: str = None):
self.modem = modem
self.ccid = ccid
def get_ccid(self):
cmd = "AT+CCID\r"
self.modem.connect()
response = self.modem.write(cmd, True)
self.ccid = response[0].split(" ")[1].replace("\"", "")
print("The SIM card ccid is:" + self.ccid)