Skip to content

Commit 1e2947b

Browse files
committed
Accept error messages like '+CME ERROR:58' without a space after ':'
My A6 GSM modem returns such error codes. This caused the library to hang, waiting for a response indefinitely. After this change modem initialization succeeds and it's possible to send SMS messages etc. It could be also the cause of #24, the symptoms are very similar.
1 parent 834c68b commit 1e2947b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gsmmodem/serial_comms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SerialComms(object):
1818
# End-of-line read terminator
1919
RX_EOL_SEQ = '\r\n'
2020
# End-of-response terminator
21-
RESPONSE_TERM = re.compile(r'^OK|ERROR|(\+CM[ES] ERROR: \d+)|(COMMAND NOT SUPPORT)$')
21+
RESPONSE_TERM = re.compile(r'^OK|ERROR|(\+CM[ES] ERROR: ?\d+)|(COMMAND NOT SUPPORT)$')
2222
# Default timeout for serial port reads (in seconds)
2323
timeout = 1
2424

0 commit comments

Comments
 (0)