Chef de Cambuse

...cooking, cruising and wine

A GStreamer based UPnP MediaRenderer with Coherence

written by Frank, on Jan 10, 2007 3:34:00 PM.

Over the last days I worked on the GStreamer  UPnP A(/V) MediaRenderer backend for Coherence.

The current objective is to obtain a certain base functionality that will allow us to test the renderer in more real-life scenarios and detect the points of contact between the MediaRenderer backend stub and the real media ‘device’, like the GStreamer playbin here or a MediaCenter like Elisa.

So far we can

  • access an audio file on an UPnP MediaServer
  • start, stop and pause playback
  • mute/unmute and change the volume

Controlling with the Intel AV Media Controller works reasonably well, although there is some issue with the volume control, it seems that the allowedValueRange for the volume is not respected by the controller.

I’ll  add the seek functions and the SetNextAVTransportURI action next, and then it is back to the MediaServer, trying to add media upload functionality (CreateObject/ImportResource) to it.

Coherence - a Python framework for the Digital Living

written by Frank, on Dec 31, 2006 4:51:00 PM.

As one of my last computer related acts this year I want to set Coherence free.

Coherence is a framework, written in Python and based on Twisted, enabling your application to participate in digital living networks. At the moment it is focused on the UPnP universe, but others will follow.

It is not (yet) for instance an UPnP MediaServer with all bells and whistles, although the enclosed device implementation is already quite functional.

But I see its utility in any case more as a bridging tool to connect something so far isolated straightforward e.g. to other UPnP devices. It is somehow part of a concept I’ve worked on in the home-automation area over the last years - a thing I called ‘Weltenkoppler’, building bridges between the (digital) islands.

Thus Coherence will in some future allow us to

But for now I wish all of you out there a truly Happy New Year and cu again in 2007!

some minor obstacles on the move to a new dedictated server

written by Frank, on Dec 23, 2006 12:41:00 PM.

A few days ago I had some time to choose a new dedicated server.

There is a more than two years old Celeron 2.40 GHz with half a GB sitting around, which I currently use to host some smaller projects.

After adding Coherence to them - the UPnP A/V framework in Python I’m working on – it became obvious very quickly that this would overheat that little box.

So I decided to move to a new one, which I tried to order this Thursday afternoon. There was the first hiccup, ordering via the web-interface was impossible, as they have already put up the new offers for 2007, with the one I wanted not being available anymore.

So I had to try phone-support, which was very helpful, competent and irritated about the time-warp in the web-interface too. They adviced me to order via fax which I did during the evening. Only a few hours later I got an email, stating that the server is activated and that I should login to the configuration interface with its hostname and the password defined during the order process.

Hmpf, seems I slipped with my fax order through the meshes.

Sure the configuration interface provides a method to generate a new password, but I need the order number -which I wasn’t informed about yet – and an attached domain – which I wasn’t able to do yet – to activate this.

So I had to file a ticket even before I had any chance to touch that new box.

That’s for today on the topic ‘process optimization’.

the "only" reason for Ajax and CSS

written by Frank, on Aug 8, 2006 4:46:00 PM.

Nearly two decades ago we had our first "LAN-parties" with our Atari STs and played Midi-Maze.
Sigh - those were the days.

Mmss_01

Now James Edwards@[brothercake] created a dynamic 3D maze solely with CSS and Javascript.

Using CSS for the 3D perspective drawings is one ueber-cool idea (read how it is done), overtopped maybe only by the gaming idea itself. ;-)
Just throw in some smiling sprites and the good ol’ times can return.

EIB time-signals

written by Frank, on Apr 27, 2006 1:27:00 PM.

Quite some EIB devices have time-controlled actions nowadays, for example the GIRA Tastsensor 2plus. But apparently their internal clock has its own interpretation of time and seems to lose any contact with reality shortly.

One way to get around this is to use an EIB time emitter, something with a buildin DCF77 receiver, cyclically sending a time telegram on the bus.

On the other hand, with our eibcontrol homeserver and a simple NTP setup, we can achieve the same with just a few lines of code.

We need to add a dummy group address to the homeserver’s xml-database, something like this:

<node name="0" alias="central functions">
    <node name="0">
        <node name="40" alias="timer">
            <node name="valuelength">3</node>
            <node name="eistype">3</node>
            <node name="curvalue">0</node>
        </node>
    </node>
</node>

Now armed with some knowledge about the time encoding in an EIS 3 type (p.15) writing a little (Python) script that, when invoked, sends the current time to the above defined group address isn’t a big deal anymore.

#!/usr/bin/python
#
# _example_(!) python program for eibcontrol communication
# (c) 2006 Frank Scholz, dev * netzflocken . de
#
# eib_sendtime.py -a 0/0/40 
#

import socket,string,time,struct

HomeServer        =       '127.0.0.1'
HomeServerPort    =       8081 
EIBaddress        =       (0,0,40)

write_request = """<eib type="write" path="/eib/groups/%d/%d/%d/curvalue" data="%ld"/>\n"""

def eib_set( server, port, address, value):
    result=""
    state="false"
    s=socket.socket( socket.AF_INET, socket.SOCK_STREAM)
    s.connect( (server, port))
    request = write_request % ( address[0], address[1], address[2], value)
    s.send( request)
    result = s.recv( 1024)
    s.close()

    if( string.find( result, "state=\"true\"") != -1):
        state="true"
        result=result[ string.find( result, "data=\"")+6:]
        state=result[ 0 : string.find( result, "\"")]

    return( state)

def eis3_build( day, hour, minute, second):
    r = day<<21|hour<<16|minute<<8|second
    return struct.unpack("L", struct.pack("!L", r))[0]>>8


t = time.localtime(time.time())
value = eis3_build( t[6]+1, t[3], t[4], t[5])
eib_set( HomeServer, HomeServerPort, EIBaddress, value)

Download: a slightly longer version with parameter handling

Now put this in a crontab and you are all set.

Currently the eibcontrol homeserver whinges about not receiving an ack from the bus for his “write”-request. As there is no “send-only”-request we need to simulate this for now and live with the otherwise effectless nagging.

How to eat sushi in Japan...

written by Frank, on Apr 5, 2006 10:48:00 PM.

In our little sushi sequence we learn today - with the help of a very illustrative video - the proper way to eat sushi in Japan.

Enjoy, and may you always have ohtoro on your fresh sterilized geta.

The worlds #1 Sushi Eating HOWTO (at least sometimes)

written by Frank, on Jan 29, 2006 12:31:00 PM.

IMG_0398.sizedIt’s a hard task to stay on top - at this very moment only on the second place - the Sushi Eating HOWTO.

IMG_0399.sizedEugene Ciurana does a great job with that HOWTO, that tries to teach us non-Japanese people how to eat sushi. It is a worthwhile reading with much more than just the usual sketchy babbling, with a lot of respect for the sushi history and the itamaes, and with gems like the walmartdotcomaki.

Itadakimasu Yuji-san - thx and please keep that great work going!

Quotes and pictures from Eugenes site are under his ©.

worldclock pimp-up with javascript

written by Frank, on Dec 20, 2005 11:15:00 PM.

This morning I’ve read a posting about a little html worldclock, putting the airport code and the local time for some cities on top of a picture with an equirectangular picture of the earth.

Wc01
 Equirectangular projection of a composite satellite image (NASA)

Some words in advance - the guy who made this explicitly says that it was only a quick fun thing, so my babbling isn’t meant in any way as any kind of offence against him!

When I looked at the picture I thought: “nice”, and remembered one of my sons asking me for something similar a few weeks ago, to pin places where we’ve been or where friends live – something like a mini-frappr. Reading the comment of the posting where somebody asked for the source I thought by myself “why doesn’t he look at the html code” and as I was curious I did.

Wohoh, that was very 80s - if we would have had html then already.
Hey, we are in the 21st century, we are living in Web 2.0 wonderland, a place where JavaScript is meant for other things than just for the – aehm – reloading xxxxxx (censored by the ajax-department) of a page.

So I had this little idea of a web-service providing city names, latitude and longitude, timezone offset, maybe even more, and a JavaScript client fetching that data on startup, with a way to define and persistently store the personalized places you want to see, perhaps in a cookie (4k limit?) or on a server, dragging them to where you think they are if you don’t know the exact coordinates, which by the way seems to be a funny excercise to convert them to the corresponding ones on the picture…

After waking up I at least started with the JavaScript client, still with predefined cities, but no relo – aehm – ing after all.
Any suggestion is of course appreciated, as this was a quick one and for fun too.

modifying a wrong commit message in a svn/trac combo

written by Frank, on Dec 17, 2005 2:13:00 PM.

With svn and trac, the use of TracLinks is a brilliant and simple solution to document relations e.g. between a changeset and a ticket.

But what if the stupid thoughtless and unobservant developer mixes up these few little numbers that represent a ticket?

With direct access to the system where the subversion repository and the trac instance reside there is an easy way to correct this misery:

svnadmin --bypass-hooks setlog /path/to/the/svn-repository \
         -r  

trac-admin /path/to/the/trac-instance resync

And another layer 8 issue solved.

The -bypass-hooks option is necessary if the "pre-revprop-change" hook is not in place, albeit this has to be used carefully as it may bypass such things as email notifications of the change, or backup systems that keep track of revision properties.

progress with the new html SimpleVisu

written by Frank, on Dec 14, 2005 10:43:00 PM.

Visu-alpha-20051214More than a year after I started with the simple html based visualisation of our home-automation system I finally found some time to reimplement it.

But now based on the uebercool, all singing and dancing Ajax technology.
The picture is probably boring as I havn’t really worked on the widgets yet, but I tried to resemble the visu I’ve done in 2004.
Most of the interesting things are under the hood:

  • nearly everything is Javascript generated, meaning on loading of the page only some Javascript is bootstrapped which then requests the visualisation objects and generates the html code
  • CSS based, layout and appearance can easily be customised
  • no page reloads, all communications with the server part are made with XMLHttpRequest
  • better separation of presentation and application layer, despite the initial html/javascript bootstrap only events (e.g. object xyz has changed its value to n) are exchanged between the visu app in the browser and the server part
  • and in the end the best: EIB events are processed in realtime, a press of a sensor button immediately changes the representation of its object(s) in the browser