Michal Čihař - Blog Archives for Gammu

Lack of time

You can see it from my blog activity as well, I simply lack time for lot of things.

My Gammu mail folders are horribly full of unread mail, it took me there three months to release a new testing version and there are still some patches pending for review.

On phpMyAdmin side I spend most time with my GSoC students, who progress really well, but that's pretty much all I can do there. The good news is that phpmyadmin.cz website has new maintainer and is again getting new content. Hopefully it will stay alive for longer time to bring back lost visitors.

My Debian contributions are in still pretty good shape and I manage to fix important bugs, though my MPD related packages are still for sale. Still considering whether to go or not to go to Debconf, my decision will be probably based on fact whether I will get travel sponsorship or not (and when it would happen).

Besides these free software activities I began to be more active in Společné aktivity (in Czech) project for organizing various activities to spend free time.

Occasionally I also contribute to OpenStretMap, but it's more or less random time when I notice something is wrong or when I manage to visit some place which is not that good mapped. The good thing is that Prague is pretty good shape there, so it does not motivate me to spend too much time on this :-).

And of course there is my work at SUSE, working on usual L3 front and improving our Django based incident tracking tool.

Maybe I should step down from some of these, but it would be pretty hard for me to choose which one...

GPL violation - getting more sources

It has been some time since I updated information about Gammu usage in proprietary software, so here it comes (see other posts tagged with gpl for more information).

I still have troubles to explain Anwsoft what they are supposed to release. The good news is that they are still communicating and even providing some updated sources (see git repository), unfortunately they still construct fake projects rather than providing real sources of the application.

Anyway if anybody is interested in digging in the sources and finding bits which might be interesting for porting to current Gammu code base, please go ahead, I probably won't have time for that in near future.

Fun with MinGW64 and ODBC

The test suite for recently added ODBC support in Gammu was consistently failing on Win64 platform (all others were just fine). It took me some time to figure out why. The reason is SQLLEN type, which is in some sort special, that generated code for it is broken.

All started with pretty much standard retrieving value from ODBC result:

SQLLEN size;

/* Figure out string length */
ret = SQLGetData(res->odbc, 1, SQL_C_CHAR, NULL, 0, &size);
if (!SQL_SUCCEEDED(ret)) {
    return NULL;

/* Did not we get NULL? */
if (size == SQL_NULL_DATA) {
    return NULL;

/* Allocate buffer for string */
out = reallocate(out, size + 1);

The first problem was comparing of size against SQL_NULL_DATA. It simply always failed even if size did contain -1 (what is actually value of SQL_NULL_DATA). Yesterday, I've come out with typecasting magic that worked fine for this case.

However what I've missed is that even reallocate is failing with this parameter. No matter what the size would be, it would return NULL. Typecasting again did help here. Hey, should not be compiler clever enough to typecast this for me? It turns out that in case of MinGW64 it is not. Anybody has suggestion why?

At the end I ended up with pretty ugly duplicating of the variable just to avoid mixing it up in future changes (as would happen with typecasting everywhere).

I'd really like to know why my assumptions are wrong in this case.

Gammu has ODBC support

One of features for Gammu SMSD which was for quite a long time in my head was ODBC support. With unified SQL backend we have right now it should be pretty easy to add support for it so I gave it a try.

It really did not take to long and the ODBC driver is committed to git and will be part of next release. The great benefit of this is that we get native database support on Windows without need to linking against database libraries, which is always painful.

The ODBC driver behaves like any other SQL based driver for SMSD, so if you are familiar with it, the configuration won't surprise you:

service = sql
driver = odbc
host = dsn_of_your_database
user = username
password = password

All important information about the driver should be available in the manual.

Screenshot support for Nokia DCT4 phones

After implementing the screenshot functionality for S60 phones, I wanted to add same thing for other phones as well. As there were some basics of the code for Nokia DCT4 phones, it was obvious place where to start.

After little of hacking, screenshots are working, for example this is screenshot of my Nokia 6234 I use for testing:

Nokia 6234 screen

Support for Sony-Ericsson phones should follow soon, Németh Márton is working on it.

Gammu supports Symbian (and going for Android)

Hackweek 6 is over and my project is done - Gammu can now talk to Symbian phones. All the work is based on Series60 - remote applet. The changes on Gammu side were not just to implement new protocol, but also some more general improvements it enforced. I think the diffstat summary tells how much was changed:

166 files changed, 23126 insertions(+), 15738 deletions(-)

All code is is available in our Git repository and check documentation for information how to set it up. There will be testing release incorporating these changes next week to give broader audience chance to test it.

So now Gammu has long requested support for Symbian and we need other challenge. That seems to be Android right now and there are already two approaches which might help there. One of them is porting Series60 applet to Android, what is planned by Series60-remote author. There is also other promising way, where I can not share much details right now, but I can give you a little teaser:

$ gammu identify
Device               : 5210
Manufacturer         : HTC
Model                : unknown (HTC Nexus One)
Firmware             : FRG**
IMEI                 : **************8
SIM IMSI             : **************7

Yes, getting basic information already works for the developer working on it :-).

Installation of S60 applet to the phone using Gammu

I've (again) changed schedule of what to implement and I've spend fourth Hackweek 6 day by doing more cleanup and documentation work than real coding.

The major new feature is support for direct installation of the applet to the phone, so the installation is now easier. There were minor improvements on the both sides to allow support for calls and deleting of SMS messages. Adding calendar and todo entries is still left for future (hopefully tomorrow).

I've done (more or less) final cleanup of my changes in the applet itself and I've sent changes back upstream hoping for merging them (I'd give you link to the mail, but the archive does not work).

Rest of the time was spent collecting feedback from users testing the code (surprisingly there are already few brave users who gave it a try). It resulted in few bug fixes and improved documentation.

Last but not least - all code is is available in our Git repository and check documentation for information how to set it up.

Sending SMS on Symbian phone using Gammu

Third Hackweek 6 day went a bit differently than I planned, but there is still lot of progress.

I've added some more calls to the Series60 remote protocol, so that some things now work much faster (eg. getting number of contacts, calendar entries). The applet now also has a function to toggle Bluetooth so it does not have to be done elsewhere in phone menus.

On Gammu side I focused on messaging support, so now Gammu can list messages in the phone or send new message.

Modification of calendar entries is left for tomorrow, hopefully I will get to it and the support will be more or less complete and I will have Friday for final cleanup.

And as usual - all code is is available in our Git repository and check documentation for information how to set it up.

Gammu has calendar and screenshot support for Symbian

I've spent second day of Hackweek 6 on more different tasks.

First I tried to add some improvements to Series60 applet. First things to fix were crashes on requesting non existing contact or calendar entry. After that I started to improve user experience a bit, for example by making the menu work and contain some useful things. After that I've added new functionality to capture screenshots of the device. So you can see how the applet actually looks like:

S60 main screen

S60 menu

On the Gammu side, I've implemented reading of contacts and todos. No write support yet, that will be done tomorrow. And of course counterpart for the screenshot function.

I've also spent some time on writing documentation, so now there is some documentation on setting up the S60 connection or the new gammu screenshot command.

All code is is available in our Git repository.

Gammu can read and write contacts from Symbian

First day of Hackweek 6 is almost over and my progress is quite good so far. The first step wat to make Gammu connect to the Series60 applet and retrieve basic information:

$ ./gammu/gammu identify
Device               : 5C:57:C8:xx:xx:xx
Manufacturer         : Nokia
Model                : E52 (RM-469)
Firmware             : 3.0
IMEI                 : 359000000000000

That was pretty easy. If you want to try it, you need to install Series60 applet into phone (manually for now, but autoinstallation is planned for future) and configure gammu to talk to it:

connection = blues60
device = 5C:57:C8:xx:xx:xx

Second thing I choose to implement was manipulation with contacts. There are some oddities in the applet (like it simply crashes when giving it wrong contact ID to retrieve), which I will try to fix in future, but for now I stick with existing applet and code functionality only in Gammu. And it works:

$ ./gammu/gammu getmemory ME 215
Memory ME, Location 215
Last name            : "Gammu"
First name           : "Test"
Mobile number        : "123456"
General number       : [home]"654321"
Email address 1      : "gammu-users@lists.sourceforge.net"

0 entries empty, 1 entries filled

Tomorrow I should be able to implement calendar, let's see how will it go.

PS: All code is is available in our Git repository