oozie / pyhumod

Using Huawei Modems in Python
Other
33 stars 15 forks source link

Huawei E160 modem is not recognized #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I installed pyHuMod-0.03 on python 2.6 and ran following commands

>>> import humod
>>> m=humod.Modem()
>>> m.show_model()

It prints out.. '^RSSI:12'

>>> m.sms_list()
results in an output like this...

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "humod/at_commands.py", line 160, in sms_list
    messages_data = message_lister.set('"%s"' % message_type)
  File "humod/at_commands.py", line 64, in set
    self.prefixed)
  File "humod/humodem.py", line 158, in send_at
    return self.return_data(cmd)
  File "humod/humodem.py", line 181, in return_data
    errors.check_for_errors(input_line)
  File "humod/errors.py", line 35, in check_for_errors
    raise AtCommandError, input_line
humod.errors.AtCommandError: ERROR

Original issue reported on code.google.com by keheliya.gallaba on 16 Oct 2010 at 4:37

GoogleCodeExporter commented 9 years ago
Hey keheliya.gallaba, I have been having the same issue and though I am yet to 
completely fix it, I have made the following observations.

[ I am using Huawei E173 modem ]

Changing 

m=humod.Modem()

to

m = humod.Modem( '/dev/ttyUSB2', '/dev/ttyUSB4' )

enabled me to access some services like static info, sending texts was still a 
no-go though :(

Not giving up though and looking through the code, trying to figure out more. 
If you have come across any new info, please let us know

Original comment by eeb...@gmail.com on 12 Nov 2011 at 8:10

GoogleCodeExporter commented 9 years ago
Update :

Using the lowest numbered result from running "ls -l /dev/ttyUSB*"
in both inputs, e.g

m = humod.Modem( '/dev/ttyUSB0', '/dev/ttyUSB0' )

gave more consistent results, allowing me to send, receive list and delete 
SMSes 

the modem kept disconnecting ever so often though and one has to find the 
lowest ttyUSB every single time you reconnect, not perfect but progress

Original comment by eeb...@gmail.com on 13 Nov 2011 at 12:20

fmalina commented 9 years ago

Read carefully docs/GettingStarted, section Instantiate a Modem().