I want to send and receive SMS text message using Python.
So far I have installed gammu and managed to write a script and send SMS to my mobile phone.
The couple of questions I have are:
1. Is there a version of Python-Gammu available for Python 3? (If I run in version 3 the import modules are not found)
2. Can anyone supply a link or code snippet showing how I can detect and incoming SMS and read it?
Thank you
- elParaguayo
- Posts: 1943
- Joined: Wed May 16, 2012 12:46 pm
- Location: London, UK
Re: Gammu for Python
How did you install it? It looks like it's on PyPi and available for Python 3 so you should be able to install using:
or
depending on your preference for installing modules.
Code: Select all
sudo pip-3.2 install python-gammu
Code: Select all
pip-3.2 install --user python-gammu
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.
Re: Gammu for Python
I can't install python-gammu like that.
If I try to install with pip or pip3, I get errors:
Alternatively I can install python-gammu using "sudo apt-get install python-gammu" - but then python-gammu is available for python2 and not for python3.
Help!!!
Thanks!
If I try to install with pip or pip3, I get errors:
Unfortunately I am a Noob and have no clue what to do with that info.pi@raspberrypi ~ $ sudo pip install python-gammu
Downloading/unpacking python-gammu
Running setup.py egg_info for package python-gammu
Package gammu was not found in the pkg-config search path.
Perhaps you should add the directory containing `gammu.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gammu' found
....
distutils.errors.DistutilsExecError: command 'pkg-config' failed with exit status 1
Alternatively I can install python-gammu using "sudo apt-get install python-gammu" - but then python-gammu is available for python2 and not for python3.
Help!!!
Thanks!
-
- Posts: 690
- Joined: Tue Jun 16, 2015 6:01 am
Re: Gammu for Python
Gammu for Python 3 is only available in Sid or later https://packages.debian.org/search?keyw ... hon3-gammu
So, you have to use Python's package manager `pip3` to try to install it, as you probably don't want to go researching apt-pinning.
Select one of the two options that elParaguayo has posted, copy the code and run. (If you don't know the difference between the two commands, use the one with `--user` in it.)
So, you have to use Python's package manager `pip3` to try to install it, as you probably don't want to go researching apt-pinning.
Select one of the two options that elParaguayo has posted, copy the code and run. (If you don't know the difference between the two commands, use the one with `--user` in it.)
Account Inactive
Re: Gammu for Python
Ok, I understand that python-gammu is not (yet) available for stable releases of Ubuntu (or, in my case, Mint or Raspbian).
BUT: I don't even manage to install python-gammu into python2 with pip.
To be sure that not an old system is the reason for that, I've just set up a new VM with the most recent version of Mint. (V18).
Then I executed:
After that I tried
None of that worked.
It always compains "No package 'gammu' found...
...command 'Pkg-config' failed with exit status 1...
...Command "python setup py egg info" failed with error code 1 in /tmp/pip-build-9wbxXe/python-gammu/
Any ideas?
It's a VM, so no risk in destroying anything, I could run TeamViewer on it in case anyone would be willing to help and take a look...
Thanks,
Ralf
BUT: I don't even manage to install python-gammu into python2 with pip.
To be sure that not an old system is the reason for that, I've just set up a new VM with the most recent version of Mint. (V18).
Then I executed:
Code: Select all
sudo apt-get install python-pip
sudo apt-get install gammu
Code: Select all
sudo pip install python-gammu
pip install --upgrade pip
sudo pip install setuptools
sudo pip install python-gammu
sudo -H pip install python-gammu
pip install python-gammu
pip install --user python-gammu
It always compains "No package 'gammu' found...
...command 'Pkg-config' failed with exit status 1...
...Command "python setup py egg info" failed with error code 1 in /tmp/pip-build-9wbxXe/python-gammu/
Any ideas?
It's a VM, so no risk in destroying anything, I could run TeamViewer on it in case anyone would be willing to help and take a look...
Thanks,
Ralf
-
- Posts: 690
- Joined: Tue Jun 16, 2015 6:01 am
Re: Gammu for Python
If you're trying Python 2 then a simple
will suffice.
https://packages.debian.org/search?keyw ... thon-gammu
Code: Select all
sudo apt-get install python-gammu
https://packages.debian.org/search?keyw ... thon-gammu
Account Inactive