mod_python to the stars…

… but not (yet) on RPi :(. I hatched a plan to investigate server-side CGI scripts with Python by developing a web version of tkinter to the stars , replacing tkinter with the Python Image Library (PIL) and using its ImageDraw module to generate graphics on the fly for web use.

All went quite well and I installed mod_python on my development system, Archie, which runs Arch Linux, like my RPi.  That forced me back to python2.7 unfortunately… but needs must.  The result is little more than a proof of concept really, but it works quite well.  The constellation images are created on demand when the user clicks the View button, and delivered to the browser via mod_python CGI and client-side JavaScript with jQuery.  No image file is ever created, the image is embedded via Ajax injection of ‘<img src=”data:image/png;base64,’ + imagedata + ‘”/>’.   It still uses exactly the same data source that I developed for java-gnome to the stars, a Postgres database to store records of 119,617 stars downloaded from the HYG Database, and PostGIS to do stereographic projections (after Ptolemy, 2000 years ago).

Unfortunately I failed at the last hurdle when I tried to install it on RPi –

[john@pixie mod_python]$ makepkg
==> ERROR: mod_python is not available for the ‘arm’ architecture.
    Note that many packages may need a line added to their PKGBUILD
    such as arch=(‘arm’).

So all RPi can do is show you this screenshot from the bigger computer beside it:

cgistars

 

tkinter to the stars

I got pp4Programming Python for Christmas, a hefty tome weighing in at 2.3 Kg, with1584 pages!

It has inspired me to get over my reluctance to learn Python 3 and to try it with a new GUI, using tkinter instead of PyGTK.  It’s good to have something to compare and contrast so I re-engineered Python to the stars – again.  Last time it was Java to Python 2, this time it is Python 2 / PyGTK to Python3 / tkinter.


vnc4 Now we’re back in business with an improved GUI – and balloon text help! This screenshot is actually of the new program running on Raspbian –  via a TigerVNC client on my Arch Linux PC and a TightVNC server on the Raspbian RPi.

It runs just as well when RPi runs Arch Linux, which it usually does.  I suppose I should add that the development was actually done (as usual) on my Arch Linux PC in Eclipse, using the PyDev plugin.

Dalriada Pi loses its head

I had been connecting my Keyboard and Mouse to RPi via a KVM switch to share them with my regular desktop PC.  There’s no need to switch the Video because the PC uses VGA directly and RPi uses HDMI directly.

But switching is tedious, and RPi gets tired running the display – so I decided to try a VNC approach.  I installed TightVNC on RPi via pacman -Sy tightvnc on Pixie (my RPi), and on Archie (my desktop PC running Arch Linux) – for the vncviewer client.

The result is fine, if a little confusing at first.  See below and try to figure out what you are looking at:

vncThat’s even more confusing in my browser, because then it looks like this:

vnc2Finally: TigerVNC turns our to be a bit better, so I have switched to that.  First thing I noticed was that I can run the Xfce Terminal Emulator without difficulty via TigerVNC, but it fails via TightVNC – I had to use vanilla XTerm instead (which is OK).