Rocode >> Hobbies >> Elvin

Elvin Event Router

At DSTC Pty Ltd I was employed within the ENE project to perform maintenance of Elvin before it was commercialised under Mantara http://www.mantara.com/.

The commercial version of the Elvin event router is written using GNU C and was developed on Solaris servers.

An open source Java port of the Elvin event router was developed by DSTO and is called AVIS. It is freely downloadable via http://avis.sourceforge.net/.


AVIS Event Router

Below are details my residential installation of the AVIS event router.

I installed AVIS on my Zentyal router.
You must add some iptables filters to allow avis to work.
Put these in a new file called:
/etc/zentyal/hooks/firewall.postservice

iptables -I INPUT -p tcp --dport 2917 -j ACCEPT

Put an entry in rc.local to open the firewall.

/etc/zentyal/hooks/firewall.postservice

Then finally put an entry in rc.local to start up the proxy.

/usr/local/sbin/avisd &

Tickertape

I use the free sticker Elvin tickertape application that is downloadable via http://www.tickertape.org:8080/projects/sticker/.

My Producers

I have added the following Elvin producers to my AVIS server.

  • My TICK producer for Linux or Windows.
    rocode.com/elvin/#TICK
  • My Bible Verses.
    rocode.com/elvin/#Bible
  • My installation of The Dude and AVIS.
    rocode.com/thedude/
  • My VK3RTV ON or OFF Air checker.
    rocode.com/amateurradio/VK3RTVOnOff.html
  • My Door checker.
    rocode.com/sensors/#ReedSwitch
  • My PIR checker.
    rocode.com/sensors/#PIR
  • My Mat checker.
    rocode.com/sensors/#PressureMat
  • My Temperature Sensor.
    rocode.com/sensors/#Temperature
  • My Phone checker.
    rocode.com/phone/
  • My Freeview EPG producer.
    rocode.com/elvin/#EPG

    My Consumers

    I have added the following Elvin consumers to my AVIS server.

  • My LED Display Tickertape.
    rocode.com/phone/#LED

    Tick Producer

    I have made a simple adaption of the freely available example client application so that I may produce Tickertape events in my Linux shell scripts and DOS batch files.

    Screencast 1: AVIS and Tickertape

    Here is my source code adaption to the supplied example. This allows a script to produce Elvin tickertape events.

    My Elvin Tickertape Producer

    Screenshot 1: My Elvin Producer

    On Linux, I renamed and saved the producer as /usr/local/sbin/tick.


    Bible Verse Producer

    I have added a new Elvin producer to display bible verses at half past the hour of: 8am 10am, 12pm, 2pm, 4pm, 6pm and 8pm.

    This how the Elvin notification looks on my Windows 7 desktop using a "Bible" group.

    Tickertape with Sword Verse

    Tickertape with Sword Verse

    The software to generate this notification is detailed below.

    Using yum I installed bibletime and sword.

    Bible Installation

    See the Crosswire Bible Society web site for details about these packages. http://www.crosswire.org/applications.jsp

    After installation I then started bibletime and installed the KJV bible using the "Bookshelf Manager".

    I have taken the code from http://crunchbang.org/forums/viewtopic.php?id=4294 that generates a random verse selected from a defined list.

    Firstly, I took the list of verses and put them in /usr/local/bin/bible/verse.list. For example:

    /usr/local/bin/bible/verse.list

    Then I created /usr/local/bin/bible/random.sh:

    /usr/local/bin/bible/random.sh

    Finally I created a script /usr/local/bin/bible/verse.sh

    :

    /usr/local/bin/bible/verse.sh

    I then added a cron entry to call this script each half past the hour of: 8am 10am, 12pm, 2pm, 4pm, 6pm and 8pm. i.e in /etc/crontab:

    /etc/crontab


    Freeview EPG Producer

    I have connected DVB-T television to my computer and have added a Freeview EPG producer to my Elvin service. The online version of the EPG may be found at http://freeview.com.au/epg/.

    Freeview Logo

    Using the code by Mark Bryars http://bryars.eu/projects/tv_grab_dvb/ to connect to the DVB tuner and save the EPG data as an XML file. I have added a C++ filter program that reads the EPG data and passes it to a shell script that sends it to Elvin.

    The DVB-T tuner is located on my Zentyal gateway. The following screencast of sticker is on my desktop. The AVIS router forwards the EPG data over my LAN.

    DVB-T Freeview Reception

    Diagram 1: DVB-T Freeview Reception

    Screencast 2: AVIS with Tickertape and Freeview EPG

    The following screenshot of sticker is on my desktop. The AVIS router forwards the EPG notification data over my LAN to the local tickertape. An Apache web server forwards the EPG description data over my LAN to the local web browser.

    Sticker Tickertape with EPG data

    Screenshot 3: Sticker and EPG

    I use a ram disk to store the captured EPG data. This is so that I don't hammer the hard disc with continuous reads and writes. The ram disk is mounted under the /tmp folder and I add an EPG directory and point a symbolic link from the web server to this.

    Sourcecode 2: Ram Disc Setup

    Here is the shell scripting code to process the EPG data of the Seven Network.

    Sourcecode 3: EPG Script (Seven Network)

    My xmltoflat program saves the EPG data in to a file with the format of channel name, program time and program title. This shell scripting has been combined with the VK3RTV checker and was duplicated for each of the Freeview Networks.

    Unfortuately the code provided by Mark does not work with our local community station C31. It is unable to capture their EPG transmission.

    Sourcecode 4: /tmp/epg-seven.txt

    I have disabled the radio and duplicate TV channels. The disabled.txt file contains the channel id of feeds to disable.

    Sourcecode 5: /usr/local/bin/tv_grab_dvb/disabled.txt

    I purge the /tmp/ramdisk/EPG/ folder every 24 hours.

    Sourcecode 6: /usr/local/bin/purgeepg.sh

    Sourcecode 7: Purge EPG Crontab Entry

    TODO: I would like to merge my xmltoflat program and the tick program.

    TODO: I want to write a translator that watches for a list of my favourite programs.