Giter VIP home page Giter VIP logo

Comments (8)

enviel avatar enviel commented on August 15, 2024

anyone can help?

from python-gsmmodem.

lucasea777 avatar lucasea777 commented on August 15, 2024

Hello @fredyrommy , this is what I would try:

  1. Try using python3
  2. Try using this repo which is more stable:
  3. Replace this line with return ['+CSCS']

By the way, what driver are you using for your modem? (I could not find a driver for a raspberry pi to use my modem)

from python-gsmmodem.

enviel avatar enviel commented on August 15, 2024

hi @lucasea777
i actually have made some change to made the sms possible, this is what i do
i changed this line to

    if self._commands == None:
        return False

i don't know why my modem will return ['ERROR'] on AT+CLAC
that's what trigger the

    except CommandError:
        return None

can you tell me the difference between this 2 repos?
i thought the faucamp's repo has been abandoned

i don't use any driver on my raspberry pi the modem just work i guess linux come with driver for my modem

from python-gsmmodem.

babca avatar babca commented on August 15, 2024

faucamp's repo is abandoned from 2014, my repo includes all 2014-2016 fixes from all existing forks. Merging all fixes at once could introduce a new set of bugs, so feel free to also try the faucamp's repo if you encounter any problem with my fork, but keep in mind that faucamp's repo doesn't work with python3.

Since your modem doesn't support CLAC command for listing all supported commands, the self.write() on line 559 should raise a CommandError exception and it should switch to an interactive command recognition: modem.py#L571-L593. But it seems it is broken.

Could you try to add raise CommandError between lines 559 and 560 to raise the exception manually?

...
try:
            # AT+CLAC responses differ between modems. Most respond with +CLAC: and then a comma-separated list of commands
            # while others simply return each command on a new line, with no +CLAC: prefix
            response = self.write('AT+CLAC', timeout=10) # i think this command should raise CommandError, but maybe "ERROR" string recognition is currently broken.
            raise CommandError # for test purpose, try to raise CommandError manually
            if len(response) == 2: # Single-line response, comma separated
                commands = response[0]
                ...

from python-gsmmodem.

enviel avatar enviel commented on August 15, 2024

seems like nothing happen

DEBUG: write: AT+CLAC
DEBUG: response: ['ERROR']
DEBUG: write: AT+CMGS=27
DEBUG: response: ['> ']
DEBUG: write: 0021000E912698357516949800000ED0A413C40EB7C3A079981D4603
DEBUG: response: ['+CMGS: 32', 'OK']

from python-gsmmodem.

babca avatar babca commented on August 15, 2024

"seems like nothing happen" - we are trying to remove your original exception TypeError: argument of type 'NoneType' is not iterable. Is it removed by adding that line into original code?

from python-gsmmodem.

enviel avatar enviel commented on August 15, 2024

no it still give the same error

i revert back my change first

before doing what you asked

DEBUG: write: AT+CLAC
DEBUG: response: ['ERROR']
Process Process-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "send.py", line 394, in smsp
    sms = modem.sendSms(DestinationNumber, Text, waitForDeliveryReport=False, deliveryTimeout=10)
  File "build/bdist.linux-armv7l/egg/gsmmodem/modem.py", line 833, in sendSms
    self.smsEncoding = 'GSM'
  File "build/bdist.linux-armv7l/egg/gsmmodem/modem.py", line 678, in smsEncoding
    if not '+CSCS' in self._commands:
TypeError: argument of type 'NoneType' is not iterable

from python-gsmmodem.

tomchy avatar tomchy commented on August 15, 2024

Hi!
There are two things that have to be checked concerning your problem:

  • It looks like receiving ['ERROR'] from modem after AT+CLAC command doesn't switch to the interactive command recognition
  • In case of an empty response (no commands available) smsSupportedEncoding tried to iterates None received from supportedCommands call It is fixed in current code on master branch.

But you definitely you forget about debugging it with raising CommandError exception (as proposed by @babca) or using proper repository, because interactive recognition either raises TimeoutException or return an empty list (not None, fixed by pending pull request with unit tests).

@fredyrommy Could you recheck your isssue?

from python-gsmmodem.

Related Issues (20)

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.