56
56
# FONA Versions
57
57
FONA_800_L = const (0x01 )
58
58
FONA_800_H = const (0x6 )
59
+ FONA_800_C = const (0x7 )
59
60
FONA_808_V1 = const (0x2 )
60
61
FONA_808_V2 = const (0x3 )
61
62
FONA_3G_A = const (0x4 )
@@ -71,7 +72,7 @@ class FONA:
71
72
"""CircuitPython FONA module interface.
72
73
73
74
:param ~busio.UART uart: FONA UART connection.
74
- :param ~digitalio.DigitalInOut rdt : FONA RST pin.
75
+ :param ~digitalio.DigitalInOut rst : FONA RST pin.
75
76
:param ~digitalio.DigitalInOut ri: Optional FONA Ring Interrupt (RI) pin.
76
77
:param bool debug: Enable debugging output.
77
78
"""
@@ -147,14 +148,20 @@ def _init_fona(self) -> bool:
147
148
self ._fona_type = FONA_3G_A
148
149
elif self ._buf .find (b"SIMCOM_SIM5320E" ) != - 1 :
149
150
self ._fona_type = FONA_3G_E
150
-
151
- if self ._fona_type == FONA_800_L :
152
- # determine if SIM800H
151
+ elif self ._buf .find (b"SIM800" ) != - 1 :
153
152
self ._uart_write (b"AT+GMM\r \n " )
154
153
self ._read_line (multiline = True )
155
154
156
155
if self ._buf .find (b"SIM800H" ) != - 1 :
157
156
self ._fona_type = FONA_800_H
157
+ elif self ._buf .find (b"SIM800L" ) != - 1 :
158
+ self ._fona_type = FONA_800_L
159
+ elif self ._buf .find (b"SIM800C" ) != - 1 :
160
+ self ._fona_type = FONA_800_C
161
+
162
+ if self ._debug and self ._fona_type == 0 :
163
+ print (f"Unsupported module: { self ._buf } " )
164
+
158
165
return True
159
166
160
167
def factory_reset (self ) -> bool :
@@ -366,7 +373,7 @@ def gps(self) -> int:
366
373
# Instead just look for a fix and if found assume it's a 3D fix.
367
374
self ._get_reply (b"AT+CGNSINF" )
368
375
369
- if not b"+CGNSINF: " in self ._buf :
376
+ if b"+CGNSINF: " not in self ._buf :
370
377
return False
371
378
372
379
status = int (self ._buf [10 :11 ].decode ("utf-8" ))
0 commit comments