NanoNote: selecting of PDF file for viewing

There is one problem with the NanoNote: the PDF viewer (nupdf), the video player (mplayer) and several other programs have no easy tool for browsing and opening of files.

It is not a problem for most current user because the file to be opened can always be specified from the command line. But non-geek usually want to have something more “user friendly”.

So I have started to search a simple file browser (yes, there is at leat the Midnight Commander but it is too powerfull for such task). T Jlime has a very nice file picker ( a SDL-based fileselector). I have spent some time when attempting to make it work under the OpenWRT but without success, yet (it might be my fault).

The I have started to make a simple script which utilises the dialog program for actual file picking. It’s not that cool, it’s even somewhat ugly but it works (well, at least it works for me).

Simple list of files for NanoNote

I have had to make two files. The first one is the actual script (/usr/bin/pick-pdf):


#! /bin/bash

export CMD=nupdf
export EXT=pdf

export i=0

echo " "
echo "Searching for *.$EXT files. It may take a while..."
echo " "

rm -f /tmp/fsel.tmp 2>/dev/null
touch /tmp/fsel.tmp
for aa in `find . -name "*.$EXT" -print` ;do i=`expr $i + 1` ; echo $i $aa >>/tmp/fsel.tmp ;done
export B=`cat /tmp/fsel.tmp`
export A=`dialog --menu "Select a File" 0 50 20 $B --stdout`

if test $A > 0
then
export C=`grep "^$A" /tmp/fsel.tmp`
export D=`echo $C | cut -d' ' -f2 -`
$CMD $D
else
echo "No file selected!"
fi

And the second one is a starter for the Gmenu2x (/usr/share/gmenu2x/sections/applications/pickpdf):


title=PDF
icon=skin:icons/generic.png
exec=/usr/bin/pick-pdf
params=/root/

And that is all. There are many things to improve, of course. But it is also possible to modify the script for other programs and file types.

NanoNote: selecting of PDF file for viewing

Bard Storyteller text reader

There is another new and nice piece of software for our Ben NanoNotes – the Bard Storyteller e-book reader.

Bard Storyteller text reader on NanoNote

At the moment it can only read plain text files but a support for XHTML and ePub is planned. And it supports the voice synthesis CMU Flite software so it can also read the texts for you. I have been using the Bard with the default Flite wersion which is shipped with the OpenWRT. It is not recommended (a more recent Flite should be used instead) but it works very well for me.

The version 0.6 of the Bard allows to configure text and background colors for all windows. It has to be done inside the ~/.bard_config file but it is easy to do. For example, I have changed background color from white to light gray which is better for my eyes. As you can judge from the screenshot, font sizes can be easily changed at run-time.

Bard Storyteller text reader

Gtk+ file dialog on Ben NanoNote

I have tried to use the gtk_widget_set_size_request function to make the dialog more compact. Fortunatelly, it works quite well, as you can see. At the moment I only have tried the old (probably deprecated) file dialog (I think that this one is better and more usefull than the new one).

Gtk+ file dialog on Ben NanoNote

The actual code is (as you may expect):


gtk_widget_set_size_request (dialog, 320, 240);

And that’s all.

Gtk+ file dialog on Ben NanoNote

Gtk+ application on NanoNote: OpenWRT vs JLime

Recently I have compiled my small Gtk+ program for both available linux systems for the Ben NanoNote: the OpenWRT and the Jlime. So below are my experiences.

OpenWRT Port

Microdef on Ben NanoNote

The OpenWRT has no X11 server and no windowing environment at all. It means that Gtk+ applications directly use the Linux framebuffer via the DirectFB library. So one can not run more than one application. This is not a big issue, I think.
But there are other issues:

  • File selection dialog does not fit the screen. I tried deprecated type of dialog and new one and both are near useless (the older one is better).
  • I have had no success in drawing of lines with different thicknesses (all have the same thickness, as you can judge from the screenshot).
  • The Gtk+ ignores numeric input on NanoNote. It’s possible to write any symbol or letter but not numbers. I use a simple but not very elegant workaround – a simple routine that transforms corrwsponding letters to numbers.

I also have had to shorten the menu in order to fit it into the screen.

Jlime port

MicroDef on Ben NanoNote

The Jlime is a different story. The program works as expected, the file dialog fits in the screen and they are useable. No code changes were needed at all. The correct thickness of the lines is respected, too.

From my point of view the main problem is the Jlime itself. It uses the X11 (the X Window System) which makes it much more “normal” and better working. But it also makes it quite slow and also somewhat unresponsible. There is also one problem which can be noticed on overloaded NanoNote: some letters written on keyboard are not passed to applications and sometimes it repeats one letter many times. This makes the Jlime uncomfortable to use. Please don’t mind the different fonts in the drawing area – I used an older (deprecated) font drawing routine when I made screenshots on the Jlime. This does not work in the OpenWRT version so I have replaced it with the more recent one. It of course works in both environments.

Conclusions

It is possible to use the Gtk+ for Ben NanoNote applications. But there are minor problems with the OpenWRT’s version of the Gtk+ which still have to be solved: the numeric input and the size of file dialogs. It will br also usefull to make a Gtk+ theme which will be more obtimised for the Ben (smaller fonts, more dark colors and so).

Gtk+ application on NanoNote: OpenWRT vs JLime

MicroDef on Ben NanoNote (almost done)

I finally have managed to do a functional port of my Microdef program to the Ben NanoNote.

Microdef on Ben NanoNote

It’s written in the Gtk+ and it was my first attempt to port Gtk+ code to the OpenWRT. So first I compiled the program for the JLime operating system (it has the X11 like all “normal” desktop Linuxess have). Then I have started to make possible to control the program exclusively from keyboard (because the Ben has no pointing device). To make the porting more easy I also have written scripts for GNU Autotools. So now I is possible to use ./configure ; make ; make install, too.

I have experienced several problems: the first one was the method of text rendering in the drawing area. I used the deprecated procedures which don’t work in the OpenWRT version of the Gtk+ library. So now I’m using Pango library for the test. The second problem is harder: the Gtk+ ignores numerical symbols from the Ben’s keyboard. They have to be input with “fn” but it does not work. So I have written a small workaroud for this – it is now possible to enter some letters instead of numbers (for example, the “n” key should generate a “1” if used with “fn” switch; so Microdef now reads “n” as “1”).

MicroDef on Ben NanoNote (almost done)

Milkymist One

Milkymist One

Let me introduce my new toy: the Milkymist One video synthetiser. Actually, it is a reconfigurable computer which use a FPGA instead of a traditional CPU. S o it’s something really interesting. It uses the RTOS as it’s operating system. That’s also unusual (ant thus very interesting) for me.

MilkyMist One: Flickernoise GUI

The device ships with nice and easy to use GUI and with several tens of pre-created visual effects. It is very impressive, I must say. Unfortunatelly, I still didn’t find enought time to play more with the Milkymist.

Flickernoise visualization

For now, I nonly have tried to connect with the telnet; and the ftp to the Milkysist (I used it to made screenshots) and I also tried to create simple visual effect directly on the Milkymist (using the GUI). It’s surprisingly fast (the visual effects are execuded in real time) and unusually quiet (it has no moving parts – no fans and it also uses very little power).

Milkymist One

Weather forecast from command line

Lysá hora from Smrček

In some cases it is usefull to get a forecast from a command line.
So I have this code in my ~/.bashrc file on my Ben NanoNote:

forecast(){
curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-}"|perl -ne '/([^<]+)/&&printf "%s: ",$1;/([^<]+)/&&print $1,"\n"'|sed "s/&/\ /g"|sed "s/deg;//g";
}

Then I can invoke forecast info with the command “forecast Prague” where the Prague is a name of the city.
The result can be like this:

January 10, 2012: Fog. High 4 C (39 F). Winds 21 kph West
January 11, 2012: Partly Cloudy. High 5 C (41 F). Winds 25 kph WNW
January 12, 2012: Clear. High 6 C (42 F). Winds 21 kph West
January 13, 2012: Scattered Clouds. High 7 C (44 F). Winds 28 kph SW
January 14, 2012: Chance of Rain. High 3 C (37 F). Winds 32 kph WNW
January 15, 2012: Clear. High 4 C (39 F). Winds 28 kph NW

Of course I use the same thing on my desktops. The code is based on this. It uses date from the Weather Underground site.

Weather forecast from command line

GTA04: new life for Neo Freerunner

There is a very interesting effort: the GTA04 mainboard for the Neo Freerunner smartphone. As you may know the Freerunner is quite oudated by today standards and also it has several design bugs which made it even more slow and annoying (unsuccesfull integration of the graphics accelerator or the well known problems with a deep leep mode or with the sound).

So guys from the Golden Delicious decided to make the new internals for the Freerunner. The result of their effort is called the GTA04 (the original freerunner was called the GTA02 by the OpenMoko and its cancelled successor was called the GTA04). The GTA04 is a new mainboard for the Freerunner so one will be able to keep the rest of yhe phone (a case, antennas, a speaker and a microphone and a display). Or it is possible to buy a complete phone.


GTA04 from Golden Delicious

The advantages are obvious: the hardware is much more up to date (an 800 MHz CPU, a 512 MB of a RAM and a 512 MB of an internal flash space, a digital compass and a barometer and of course a GPS and the 3G modem). The whole thing should run smoothly and it is expected to have less hardware bugs.

There are also disadvantages. The biggest one is the price. One can buy a mainboard for 666.66 EUR or a complete phone for 749 EUR. Obviously it is not cheap. The main problem is that the Golden Delicious can not obtain hardware components in large qountities which means that they have to pay much more than large phone makers.

Anyway it is possible to get it for a much lover price – for 474 EUR or 499 EUR. There is something called a “GTA04 Group Tour”: you may order it for the price right now. If there will be enough buyers (350-400) then the GTA04 board will be produced. If not then the money will be refunded. You may find more details here. It is an interesting possibility so I ordered one.

GTA04: new life for Neo Freerunner

QtMoko and Neo Freerunner

I finally have got an another Neo Freerunner. It’s a basic one, without upgrades and bugfixes. I have no plan to use it as a mobile phone.
I have got it because I think that is is a better GPS device than other ones. It fits in my hand and it is quite durable.

Recently I have tried to install a QtMoko Linux on it. Just to try it because
the SHR Linux with the TangoGPS sofware has been just enough for me. But current SHR version has several problems (for example, the alarm clock does now work, the time in GUI doesn’t update after resume from suspend – it needs some time to update – and so on). So I decided to try the QtMoko.

English dictionary on QtMoko

I’m still (positively) surprised: it is not very elegant and some thing are overcomplicated but it works. It just works and everything can be done withing the GUI (I generally prefer a comand line approach – but it is not wery sane to control a touchscreen-only device from a text terminal…). The only problem that I still don’t have a wirkting X server (so I can’t use the FBReader or the TangoGPS at the moment). But it is probably my fault.

Now I’m trying to learn the native NeronGPS application. It’s similar to the TangoGPS but it’s designed for the QtMoko. It’s younger so some features are still missing but the basic things works as expected.

P.S. Sorry for no informations about the Ben Nanonote. It have become a very boring device – I recently have had no issues to solve. It just works…

QtMoko and Neo Freerunner