Comments (8)
anyone can help?
from python-gsmmodem.
Hello @fredyrommy , this is what I would try:
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.
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.
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.
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.
"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.
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.
Hi!
There are two things that have to be checked concerning your problem:
- It looks like receiving
['ERROR']
from modem afterAT+CLAC
command doesn't switch to the interactive command recognition - In case of an empty response (no commands available)
smsSupportedEncoding
tried to iteratesNone
received fromsupportedCommands
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)
- Question: Support for modems with multiple SIMS ? HOT 1
- dial_polling_demo.py throws gsmmodem.exceptions.TimeoutException: ['NO CARRIER']
- TimeoutException with Sim800 module HOT 1
- Delivery Reports can't be disabled when in PDU mode HOT 2
- Modem working but having Timeout Exception HOT 3
- CMSError: CMS 321 HOT 3
- incompatibility with latest pyserial 3.5
- (removed - useless)
- Sms not receiving
- Support for RFC2217 (serial port over network)
- how best to extend? HOT 1
- Add an example to demonstrate the Sending SMS HOT 2
- Does not work on Python 3.x HOT 2
- Still Alive? HOT 5
- Question: support for windows? HOT 12
- Timeout exception raised for any command. HOT 16
- Error: 'GsmModem' object has no attribute 'rxThread' HOT 3
- sms_handler fails HOT 2
- Instant timeout exception
- PDU Decoding Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-gsmmodem.