Coder Social home page Coder Social logo

pyhumod's People

Contributors

fmalina avatar oozie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyhumod's Issues

Huawei E160 modem is not recognized

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

Question about pyhumod vs E1550

What steps will reproduce the problem?
1. Connecting an E1550 Huawei modem
2. Trying to see the version/send messages/read messages
3.

What is the expected output? What do you see instead?
I can't see any action, it sort of freezes.

What version of the product are you using? On what operating system?
I'm using the latest version on Ubuntu 11.04

Please provide any additional information below.

I've used pyhumod with my E220 modem and it allways worked perfectly, but 
recently i've bought a new modem, a Huawei E1550 and the program i've been 
using with the E220, simply just won't work. Does any one knows why?


Original issue reported on code.google.com by [email protected] on 12 May 2011 at 10:16

Special Characters

When I send a message with special characters to my modem (Model E226) I cannot read the message. For example, if I send an SMS with the word Produção, when trying to read the message 00500072006F0064007500E700E3006F appears

safe_int never returns an integer '0'

Discovered this silly bug while troubleshooting the other issue.

In [6]: m.sms_list()
Out[6]: 
[['0', 'REC READ', 999222, '', '12/05/10,10:05:41+08'],  <-- '0' string
 [1, 'REC READ', 9996248, '', '12/05/10,09:50:51+08'],
 [2, 'REC READ', 9996248, '', '12/05/10,10:18:44+08'],
 [3, 'REC READ', 9996248, '', '12/05/10,10:24:53+08'],
 [4, 'REC READ', 9996248, '', '12/05/19,12:38:57+08'],
 [5, 'REC READ', 999222, '', '12/05/19,15:05:25+08'],
 [6, 'REC READ', 9996248, '', '12/05/20,12:51:05+08'],
 [7, 'REC READ', 999222, '', '12/05/20,14:15:10+08'],
 [8, 'REC READ', 9996248, '', '12/05/20,17:55:00+08'],
 [9, 'REC READ', 9996248, '', '12/05/21,01:54:36+08']]

In [7]: 

Don't get any umlauts from sms

if I read the sms with (Huawei E270) i only the the pasts of the message that are not a umlaut.

message saved in Sim card (made sure with a mobile)
"Klopuzofäblöda"

if I run: modem.sms_read(0) i'll get:
"Klolpuzofblda"

without any error or any infomation, that the encoding removed parts.

if I look at the information, that is sent over the tty also the umlauts are missing. Do I need to set the encoding somewhere for the E270?

E1750 hanging on print m.show_model()

Hey everyone,

So finally got that dongle in the mail and delivered.
However whenever I try to print the model it just hangs, for ever untill I ctrl-z / keyboard interrupt.

However, I was toying with pyserial after, and I did something to trigger a change in the path of the dongle. /dev/ttyUSB0 - 3 now became /dev/ttyUSB1 - 4 .

With this weird change in mind, I went back to try humod, this time it gave me an error and told me it couldn't find /dev/ttyUSB0 . (not strange since the paths scooped up a position)
So I ran the same script, only this time with: m = humod.Modem('/dev/ttyUSB1') and strangely enough the script printed the model number instantly.

However, after rebooting my pi, all paths are back to normal, and the issue is back.

Can someone shine some light on this?
Thanks!

UnicodeDecodeError when MMS is received

Happens if self.readline() returns byte data in humodem.py, line 172.

             input_line = self.readline().decode().rstrip()

Maybe we should catch the exception like so.

     while 1:
         # Read in one line of input.
         coded_input_line = self.readline()
         try:
            # input_line = self.readline().decode().rstrip()
            input_line = coded_input_line.decode().rstrip()
         except serial.serialutil.SerialException:
             time.sleep(.2)
             continue
        except UnicodeDecodeError:
            """ b'\x00\x06&application/vnd.wap.mms-message
            \x00\xaf\x84\x8d\xff\xb4\x81\x8c\x82\x98nw\x00\x8d\x90\x89\x19\x80
            +447736000000/TYPE=PLMN
            \x00\x8a\x80\x8e\x03\x08\xb5/\x88\x05\x81\x03\t:\x80\x83
            http://mmsc-ac1.mms.o\r\n'
            """
            print(coded_input_line)
            continue

International characters

What steps will reproduce the problem?
1. Send an SMS to the E220 that contains international characters (å,ä,ö)
2. Reading the SMS from the device using sms_read() returns the SMS 
without the international characters.
3.

What is the expected output? What do you see instead?
I send:
Testar att skicka ett sms med övriga tecken som inte används i 
engelskspråkiga länder.

sms_read() returns:
Testar att skicka ett sms med vriga tecken som inte anvnds i 
engelsksprkiga lnder.


What version of the product are you using? On what operating system?
pyhumod 0.03 on Slackware 13.0 with Linux 2.6.33.1

Please provide any additional information below.

Sending SMS with international characters:

>>> m.sms_send('+46xxxxxxxxx', 'Testar att skicka med å och ä och ö.')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/humod/at_commands.py", line 
136, in sms_send
    result = self.ctrl_port.return_data()
  File "/usr/lib64/python2.6/site-packages/humod/humodem.py", line 179, in 
return_data
    input_line = self.readline().rstrip()
  File "/usr/lib64/python2.6/site-packages/serial/serialutil.py", line 62, 
in readline 
    c = self.read(1)
  File "/usr/lib64/python2.6/site-packages/serial/serialposix.py", line 
353, in read buf = os.read(self.fd, size-len(read))
OSError: [Errno 11] Resource temporarily unavailable

Original issue reported on code.google.com by [email protected] on 21 May 2010 at 11:20

An sms with the content 'OK' gets ignored

This is probably as a result of these lines in humodem.py

179     if input_line == 'OK':
180         return data

I haven't figured out a workable fix yet. I'm also not very sure what I'd be at risk of breaking.

The 'read_message' don't exists

Please help me, when i use the CoolApps.rst example i get that error:
AttributeError: 'Modem' object has no attribute 'read_message'
It seem that when the modem receive an sms it can not read it because off this error.

Is this library still working / functional?

Hey all!

I'm working on a project where I'd like to use a GSM modem / dongle to act as a proxy server through python.
At my current provider, whenever I disconnect and reconnect to the mobile network, my IP changes.

My goal is to replicate that in python, connecting to the dongle whenever a proxy is needed and disconnecting + reconnecting whenever I need it changed.

If anyone could let me know, that would be great.
Huawei dongles are pretty expensive and hard to come by around here so I'd like to be sure before purchasing one!

Thanks!

E180 : can't read from modem

Hi,
I connected a E180 to an RPI, and trying to get the model using the basic example shown in the documentation. I have a virtualenv with the latest version of serial and python 2.7.
Unfortunately, the method show_model hangs (as described in another issue with a E1750).
It seems that the select.select statement in serialposix.py doesn't can't read from the file.
However, I have no issue at all when using the miniterm.py shipped with the serial library.

Any clue?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.