From 2904a08d5ef1f61c1ac9f1279a8a680f5787a930 Mon Sep 17 00:00:00 2001 From: Sam Machin Date: Fri, 24 Aug 2018 08:57:59 +0100 Subject: [PATCH] Added function to get the IMSI Getting the IMSI is useful for trying to debug issues with peoples subscriptions in the GSM netwotk and its not printed on the card or anywhere, if the card isn't inserted or hasn't started properly then the command returns ERROR --- lib/sim800.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/sim800.py b/lib/sim800.py index cc44608..f1a7e2d 100644 --- a/lib/sim800.py +++ b/lib/sim800.py @@ -213,6 +213,14 @@ def imei(): else: return "" +# Get the IMSI number of the Sim Card +def imsi(): + responce = command("AT+CIMI") + if (len(responce)>=2): + return responce[-2] + else: + return "" + # Get/Set ringer volume (0-100) def ringervolume(level=None): # Set the new leve if we have one to set