Michal Čihař - Blog Archives for python-gammu

Hacking Gammu

I've spent first day of SUSE Hackweek on Gammu. There are quite many tasks to be done and I wanted to complete at least some of them.

First I started with the website. I did not really like the old layout and aggressive colors and while touching it's code it's good idea to make the website work well in mobile devices. I've started with conversion to Bootstrap and It turned out to be quite easy task. The next step was making the pages simpler as in many places there was too much information hidden in sidebar. While doing content cleanup, I've removed some features which really don't make much sense these days (such as mirror selection). Anyway read more in the news entry on the site itself.

Second big task was to add support for Python 3 in python-gammu. It seems that world is finally slowly moving towards Python 3 and people started to request python-gammu to be available there as well. The porting itself took quite some time, but I've mostly completed it before Hackweek. Yesterday, there was just some time spent on polishing and releasing standalone python-gammu and Gammu without python bindings. Now you can build python-gammu using distutils or install it using pip install python-gammu.

Porting python-gammu to Python 3

Over the time I started to get more and more requests to have python-gammu working with Python 3. Of course this request makes sense, but I somehow failed to find time for that.

Also for quite some time python-gammu has been distributed together with Gammu sources. This was another struggle to overcome when supporting Python 3 as in many cases users will want to build the module for both Python 2 and 3 (at least most distributions will want to do so) and with current CMake based build system this did not seem to be easy to achieve.

So I've decided it's time to split python module out of the library. The reasons for having that together are no longer valid (libGammu has quite stable API these days) and having standard module which can be installed by pip is a nice thing.

Once the code has been put into separate git module, I've slowly progressed on porting to Python 3. Most of the problems were on the C side of the code, where Python really does not make it easy to support both Python 2 and 3. So the code ended up with many #ifdefs, but I see no other way. While doing these changes, many points in the API were fixed to accept unicode stings in Python 2 as well.

Anyway, today we have first successful build of python-gammu working on both Python 2 and 3. I'm afraid there is still some bug leading to occasional segfaults on Travis, but not reproducible locally. But hopefully this will be fixed in upcoming weeks and we can release separate python-gammu module again.

Gammu is getting new documentation for developers

During last weeks I finally got upset with state of developer documentation for Gammu and python-gammu. Not that it would be non existing, but it was spread over various places in various formats and partially outdated.

I decided to write all documentation in Shpinx as I know this tool and it seems to fit quite well in mixed C/Python environment.

The first step was to migrate existing docs into same format (reStructuredText) and create documentation structure. I believe this is now completed and you can check results here.

Yes there are still lot of rough edges and lot of work to do, but I anyway think that current state is better then mess we used to have before.

New Wammu and Gammu website

I just put online new Wammu and Gammu website at http://wammu.eu/. The reason for this change is that I want all relevant information about Gammu and related programs to be available in one place. You can find there information about Gammu, SMSD and python-gammu as well including some information and documentation which used to be spread in wiki and various other documents.

Also all Gammu and Wammu related announcements will be published only on that website and will no longer pollute my blog (and all planets where my blog is being syndicated). If you followed RSS feed, you should update your reader to http://wammu.eu/news/rss/.

The new website also includes updated Gammu Phone Database, which will look almost same to users, but has been completely rewritten underneath, what will allow some extensions in future and allows easier management of entries for me.

What currently lacks behind old website is Czech translation. The reason is in simple fact that new website contains much more texts and I did not yet have time to translate it. If you want to help, just go to l10n.cihar.com, or just follow translators instructions. This time it will be also possible to add other translations, so if you want to translate website to other language, you are welcome!

Gammu stable version 1.26.1

Gammu 1.26.1 is out! This release just fixes few bugs in AT driver.

Full list of changes:

  • CPIN reply is handled like regular one except in A2D case (bug #994).
  • Fix finding first empty position when memory is empty (bug #996).
  • Fixed parsing of SMS status reports.
  • Fixed parsing of text messages with new lines (bug #995).

You can download from usual place: http://cihar.com/gammu/.

Debian users will find packages in unstable soon, SUSE, Fedora and Mandriva users can check repository in OpenSuse Build Service and Ubuntu in my PPA.

Gammu stable version 1.26.0

Gammu 1.26.0 is out! There is reduced memory usage, tons of bugfixes, better support for reading messages from Motorola phones.

Full list of changes:

  • Fixed handling of RunOnReceive error code.
  • Fixed crash when encoding USSD dials.
  • Fixed decoding of phonebook entries on Motorola (bug #988).
  • Fixed decoding of long text messages (bug #990).
  • Fixed location of saved message (bug #989).
  • Added ID for Nokia 1681c.
  • Fixed reading of phonebook from Samsung (bug #980).
  • Add ID for Nokia 3390b (bug #982).
  • DCT3 dependent code reports error when phone is not DCT3 (bug #982).
  • Fixed reading of DCT4 file folders (bug #986).
  • Reworked RPM packages (separate libraries and SMSD).
  • Huawei E160 uses encoded USSD requests.
  • Better support for messages on Motorola, thanks to Quintin Hill.
  • Fix reading of SMS backups without text (bug #963).
  • Send message even if SendingTimeOut is null (bug #977).
  • Disabled automatic OBEX for Motorola phones.
  • Increased limits for message length, bump soname to 7 because of this.
  • Changed SMSD tables to be able to handle longer messages from Motorola phones.
  • Documented most commands in man page.
  • Completed Czech translation of Gammu.
  • Avoid crash on some Nokia smses (bug #959).
  • Added support for Bluetooth on more BSD systems, thanks to Iain Hibbert.
  • Added new command setsmsc.
  • Added option to disable checking for battery and signal in SMSD.
  • Fixed getting firmware revision on AT phones (bug #951).
  • Added support for home/work mobile number (bug #952).
  • Fixed handling of error response for security status in AT.
  • Fixed segfault on systems with very low memory limits.
  • Development now goes on in Git repository, please check README.
  • 6510 driver now dynamically allocates memory for file caches, what reduces Gammu memory usage by 800 MiB.
  • Added testcases for AT+CNMI replies.
  • Fixed range parsing in AT engine.
  • Added reconnect support in PostgreSQL driver in SMSD.
  • Gammu debug level no longer can be controlled separately in SMSD.
  • Fix loop when Nokia phone does not allow to access files (bug #954).

You can download from usual place: http://cihar.com/gammu/.

Debian users will find packages in unstable soon, SUSE, Fedora and Mandriva users can check repository in OpenSuse Build Service and Ubuntu in my PPA.

Gammu test version 1.25.93

Gammu 1.25.93 is out! This is just a bugfix release heading to 1.26.0 next week.

Full list of changes:

  • Fixed reading of phonebook from Samsung (bug #980).
  • Add ID for Nokia 3390b (bug #982).
  • DCT3 dependent code reports error when phone is not DCT3 (bug #982).
  • Fixed reading of DCT4 file folders (bug #986).
  • Fixed parsing of config file with whitespace (bug #987).

You can download from usual place: http://cihar.com/gammu/,

Debian users will find packages in experimental soon, SUSE, Fedora and Mandriva users can check experimental repository in OpenSuse Build Service.

Translate Wammu

I feel like I will release new Wammu version in two or three weeks, it would be great to improve some translations. All you need to do is to login into our Pootle server and translate these few (or not so few) strings missing in your language.

If you still prefer manual work, you can still just get po file from Git and send me updates.

PS: If your translation is missing in Pootle and you want to start it, just drop me a note.

Gammu test version 1.25.92

Gammu 1.25.92 is out! There are two bigger changes - the RPM packaging and much improved support for messages from Motorola phones.

Full list of changes:

  • Reworked RPM packages (separate libraries and SMSD).
  • Huawei E160 uses encoded USSD requests.
  • Better support for messages on Motorola, thanks to Quintin Hill.
  • Fix reading of SMS backups without text (bug #963).
  • Send message even if SendingTimeOut is null (bug #977).
  • Disabled automatic OBEX for Motorola phones.
  • Increased limits for message length, bump soname to 7 because of this.
  • Changed SMSD tables to be able to handle longer messages from Motorola phones.

You can download from usual place: http://cihar.com/gammu/,

Debian users will find packages in experimental soon, SUSE, Fedora and Mandriva users can check experimental repository in OpenSuse Build Service.

Gammu test version 1.25.91

Gammu 1.25.91 is out! The changelog is short, but all changes are quite interesting - thanks to Iain Hibbert we now have support for Bluetooth on other BSD variants and I spent time travelling around Spain in trains by writing documentation and translating Gammu to Czech language.

Full list of changes:

  • Documented most commands in man page.
  • Completed Czech translation of Gammu.
  • Avoid crash on some Nokia smses (bug #959).
  • Added support for Bluetooth on more BSD systems, thanks to Iain Hibbert.
  • Added new command setsmsc.
  • Added option to disable checking for battery and signal in SMSD.

You can download from usual place: http://cihar.com/gammu/,

Debian users will find packages in experimental soon, SUSE, Fedora and Mandriva users can check experimental repository in OpenSuse Build Service.