Michal Čihař - Archive for 12/2010

Automatic configuring of Gammu

I bear in my mind idea for automatically configuring Gammu for some time. It should not be that hard using udev, Bluez and other tools which we already have available on average Linux system.

Today afternoon I've finally found some time to play with that and it's almost done. Well it's not fully automatic right now, it will just generate configuration file with possible choices, but at least some help. For now only udev and Bluez is supported, but I will add support for libusb soon as well.

The new tool is called gammu-detect and looks at devices available in the system and outputs something, what can be used as configuration file (you can find example in the documentation).

Once it will make reasonable guesses what user actually wants, it might get integrated into libGammu so that other applications like Wammu can benefit from it as well.

Temperature monitoring on OpenWrt

My OpenWrt box has for some time connected TM - RS232 sensor. However for some reason I did never find time to setup it. However as the node is already running lite version of munin, it was really easy to do so. All what was needed is to add another plugin into the /usr/sbin/munin-node script and add temp to list of plugins at top:

config_temp() {             
  echo "graph_title Temperature"
  echo "graph_args --base 1000 -l 0 -u 40"    
  echo "graph_vlabel room temperature"                                                                                        
  echo "graph_category other"                                                                                                                   
  echo "graph_info This graph shows the room temperature."
  echo "temp.label temperature"
  echo "temp.draw LINE2"                             
  echo "temp.info The current room temperature."
fetch_temp() {                                        
  read RES < /dev/ttyUSB0                        
  echo "temp.value" $(echo $RES | tr -d C+)

PS: It looks like reading sometimes produces just bogus results, so here is improved version, which does some level of filtering:

read RES1 < /dev/ttyUSB0                       
read RES2 < /dev/ttyUSB0                 
read RES3 < /dev/ttyUSB0                 
if [ "x$RES1" = "x$RES2" ] ; then                  
    echo "temp.value" $(echo $RES1 | tr -d C+)                          
elif [ "x$RES1" = "x$RES3" ] ; then                                 
    echo "temp.value" $(echo $RES1 | tr -d C+)                 
elif [ "x$RES2" = "x$RES3" ] ; then                        
    echo "temp.value" $(echo $RES2 | tr -d C+)                                    
    echo "temp.value" $(echo $RES2 | tr -d C+)                                                                                            

CTest not submitting to IPv6 dashboard

For some time, I observed that Gammu test dashboard does not get updates from my Debian box. Looking the CTest logs, the problem was in using IPv6 even when the box does not have it enabled:

Failed to connect to 2001:1528:136:dead:beef::1003: Network is unreachable

Due to lack of time I ignored it, but it looks all what was needed is to update curl. The bug was caused by using c-ares resolver, which for some reason favors AAAA records even when the system has no IPv6.

Save as WWF, Save a Tree?

I know ecologists often come with great ideas how to save some random resource. There was a "green" font, which contained holes and was supposed to save ink/toner from printers. It turned out not to be that big saver as the font itself was actually a bit wider than usual...

Today I got to know about "new" file format called WWF. Technically it is just a PDF with disabled printing. Well at least it is not a new format, so users of other operating systems (WWF software is available for Mac OS X only right now) are not lost and can use existing tools to view the files (on Linux you can for example use Evince).

And if Evince rejects to print this document, just disable these restrictions:

gconftool-2 -s /apps/evince/override_restrictions -t bool 1

Is it really helpful for environment to spend resources on creating yet another useless file format?

New features in Gammu

I've just released new version of Gammu, which comes with some things, which are worth mentioning.

First thing is m-obex support (which I've already announced). Since last announcement, there were some improvements, but I'm affraid it still does not work, because it was not completely tested. So the very same request applies - testers welcome and we need feedback.

The second big change is universal SQL backend for Gammu SMSD, which consolidates code of former MySQL, PostgreSQL and DBI backends. It also adds option to configure SQL queries it will use. This was tested using usual testsuite, so it is working, but there still might be some glitches, which will need polishing before we can declare it stable.

Cleanup of personal Debian repository

When I accidentally looked at my personal Debian repository, I realized that it is time to remove obsolete things from it.

There were packages for polld, for which which I don't see need anymore (it is now properly handled by kernel), hacked acpid packages, which were doing special things for Toshiba M30 notebook (which I don't use with Linux anymore and nobody else probably knew about these packages) or wmmp, a Window Maker applet for MPD, which I haven't used for quite a long time. All those are gone now and I don't think anybody will miss them (if you do, please tell me).

What stayed there are daily snapshots of dictionaries for StarDict and gnaughty package, which was rejected as possibly causing troubles.