Using pyhumod on Mac OSX with E160 USB

31 views
Skip to first unread message

justinf

unread,
Jul 11, 2009, 2:49:31 AM7/11/09
to pyhumod

Hello,

I am using pyhumod on a Mac OSX notebook with the E160 USB (little
brother to the E220 you have. The E160 is a very popular pay-and-go
model in the UK).

I modified the pyhumod code to reflect OSX's slightly different /dev
configuration like this:

# Mac ports are:
# crw-rw-rw- 1 root wheel 9, 85 10 Jul 21:49 /dev/
cu.HUAWEIMobile-Modem
# crw-rw-rw- 1 root wheel 9, 87 10 Jul 21:49 /dev/
cu.HUAWEIMobile-Pcui

#DEFAULT_DATA_PORT = '/dev/ttyUSB0'
DEFAULT_DATA_PORT = '/dev/cu.HUAWEIMobile-Modem'

#DEFAULT_CONTROL_PORT = '/dev/ttyUSB1'
DEFAULT_CONTROL_PORT = '/dev/cu.HUAWEIMobile-Pcui'

This seems to work, but I think the AT command set varies ever to
slightly between the E220 & E160.

I'm getting the +CMS ERROR: 500 'catch-all' error.

I'm 99% sure the E160 can support SMS. I know it can receive them, I
have the smsq.py code base showing received SMS's (but it fails on
send also): http://code.google.com/p/smsq/source/browse/trunk/smsq.py

The output I'm getting from pyhumod is:

$ python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import humod
>>> m=humod.Modem()
>>> m.show_model()
'^RSSI:13'
>>> m.enter_text_mode()
>>> m.send_text('+44xxxxxxxxxx', 'test message')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.5/site-packages/humod/at_commands.py", line
135, in send_text
result = self.ctrl_port.send(contents+chr(26))
File "/Library/Python/2.5/site-packages/humod/humodem.py", line 170,
in send
return self.return_data(at_cmd)
File "/Library/Python/2.5/site-packages/humod/humodem.py", line 191,
in return_data
errors.check_for_errors(input_line)
File "/Library/Python/2.5/site-packages/humod/errors.py", line 35,
in check_for_errors
raise AtCommandError, input_line
humod.errors.AtCommandError: +CMS ERROR: 500
>>> m.connect()
>>> m.disconnect()
>>> quit ()
$

All ideas warmly received

Thanks,


Justin

oozie

unread,
Jul 12, 2009, 4:39:05 AM7/12/09
to pyh...@googlegroups.com
Hi Justin,

On Sat, Jul 11, 2009 at 7:49 AM, justinf<jus...@creamcow.com> wrote:
> Hello,
>
> I am using pyhumod on a Mac OSX notebook with the E160 USB (little
> brother to the E220 you have. The E160 is a very popular pay-and-go
> model in the UK).
>
> I modified the pyhumod code to reflect OSX's slightly different /dev
> configuration like this:

>[...]

This is one way of doing it. Another way (which I failed to describe
in the docs other than the docstrings, my apologies):
>>> dataport = '/dev/cu.HUAWEIMobile-Modem'
>>> ctrlport = '/dev/cu.HUAWEIMobile-Pcui'
>>> m = humod.Modem(dataport, ctrlport)

Thanks for your useful suggestions, I'll mention that on the wiki.

> This seems to work, but I think the AT command set varies ever to
> slightly between the E220 & E160.
>
> I'm getting the +CMS ERROR: 500 'catch-all' error.
>
> I'm 99% sure the E160 can support SMS. I know it can receive them, I
> have the smsq.py code base showing received SMS's (but it fails on
> send also): http://code.google.com/p/smsq/source/browse/trunk/smsq.py

According to Huawei it does support SMS services:
http://www.huawei.com/mobileweb/en/products/view.do?id=1960

>[...]

I think you still use the 0.01-beta version as show_model() returned
'^RSSI:13'. This happened because the beta version did not clear the
serial line before sending a new command to the modem. If you keep
getting RSSI value instead then there is definitely something wrong in
here.

Did you try to send text without entering text mode?

What happens when you call m.get_detailed_error() straight after error
500 is returned?

What does m.get_mode() show?

How do other devices (e.g. your mobile) react to sending texts from
this SIM card?

--
best regards,
oozie
http://blog.ooz.ie/

oozie

unread,
Jul 12, 2009, 5:57:14 AM7/12/09
to pyh...@googlegroups.com
Hi again,

On Sun, Jul 12, 2009 at 9:39 AM, oozie <oo...@ooz.ie> wrote:
[...]


> Did you try to send text without entering text mode?
>
> What happens when you call m.get_detailed_error() straight after error
> 500 is returned?
>
> What does m.get_mode() show?
>
> How do other devices (e.g. your mobile) react to sending texts from
> this SIM card?

Two more things:
What does m.get_networks() say?

What's the output of m.get_service_center()?

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages