Skip to content

Commit d6220d9

Browse files
author
brentru
committed
parse to ensure notification msg
1 parent c06bf86 commit d6220d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

FONA_SMS_Sensor/code.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
# Create a serial connection for the FONA connection
1111
uart = busio.UART(board.TX, board.RX)
12-
rst = digitalio.DigitalInOut(board.D5)
12+
rst = digitalio.DigitalInOut(board.D4)
1313

1414
# Initialize FONA module (this may take a few seconds)
15-
fona = FONA(uart, rst, debug=True)
15+
fona = FONA(uart, rst)
1616

1717
# Initialize BME280 Sensor
1818
i2c = busio.I2C(board.SCL, board.SDA)
@@ -37,6 +37,8 @@
3737
notification_buf = fona.read_line()[1]
3838
# Split out the sms notification slot num.
3939
notification_buf = notification_buf.decode()
40+
if "+CMTI:" not in notification_buf:
41+
continue
4042
sms_slot = notification_buf.split(",")[1]
4143

4244
print("NEW SMS!\n\t Slot: ", sms_slot)

0 commit comments

Comments
 (0)