faucamp / python-gsmmodem

Python module to control a GSM modem attached to the system: send/receive SMS messages, handle calls, etc
GNU Lesser General Public License v3.0
384 stars 302 forks source link

Wavecom M1306 does not issue 'OK' at end of AT+CPIN? response #19

Closed faucamp closed 11 years ago

faucamp commented 11 years ago

This report was submitted via email; quoting original text below:

I bought a wavecom M1306 model for monitoring temperature of computer room. But gsmmodem.GsmModem.connect() always throw a timeout exception. Since I'm a newbie on Python, I use print 'some string' to locate that the problem is in method _handleLineRead. Then I realize that for normal AT command like 'AT+CFUN?', the modem respond an 'OK' after displaying CFUN's value, But when asking 'AT+CPIN?' my M1306 modem simply reply 'AT+CPIN: READY' without 'OK' appended. So the _handleLineRead won't call self._responseEvent.set(), The read thread is then waiting until timeout.

franciumlin commented 11 years ago

The information of WAVECOM M1306B GSM modem, Using gsmterm.py :

ATI: WAVECOM MODEM
MULTIBAND 900E 1800 OK

AT+CGMI: WAVECOM MODEM
OK

AT+CGMM: MULTIBAND 900E 1800 OK

AT+CGMR: 430e09gm.3 1207928 020102 14:41 OK

AT+CFUN=?: +CFUN: (0,1),(0,1) OK

AT+WIND=?: +WIND: (0-1023) OK

AT+WIND?: +WIND: 50
OK

AT+CPMS=?: +CPMS: (("SM","BM","SR"),("SM")) OK

AT+CNMI=?: +CNMI: (0-3),(0-3),(0-3),(0-2),(0,1) OK

AT+CVHU=?: ERROR

AT+CSMP?: +CSMP: 49,167,0,0 OK

AT+GCAP: +GCAP: +CGSM, +FCLASS OK

AT+CPIN?: +CPIN: READY

AT+CLAC: ERROR

faucamp commented 11 years ago

Thanks for the report and info!

I have modified the pin-unlock method to compensate for Wavecom's +CPIN response format. It slows down the connect() method slightly, but the small slowdown (0.2 second) is negligible since connect() is only called once.

Please re-open the ticket if you feel this has not been resolved.