adammck / pygsm

Send and receive SMS via a GSM modem in Python
BSD 3-Clause "New" or "Revised" License
133 stars 57 forks source link

erron in gsmmodem.py #7

Closed ghost closed 11 years ago

ghost commented 13 years ago
>>> import pygsm
>>> m = pygsm.GsmModem(port="/dev/ttyS0")
>>> m.send_sms("+919500889199", "testing from python")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pygsm/gsmmodem.py", line 794, in send_sms
    self._write(chr(27))
  File "/usr/lib/python2.5/site-packages/pygsm/gsmmodem.py", line 268, in _write
    self.device.write(str)
AttributeError: 'NoneType' object has no attribute 'write'
pnv1193 commented 11 years ago

I'm having the same issue. Please help.

adammck commented 11 years ago

Try calling m.boot before calling m.send.sms. This could definitely be better documented.