MQTT Caller Display – Hacking the BT Caller Display 50 Serial Port

This post describes a recent project I completed to display caller id information for incoming calls on my computers. The project uses a BT Caller Display 50 connected via an optoisolating bridge to an arduino with an ethernet shield. When an incoming call is received the telephone number is transmitted via MQTT to a python client on any computer I happen to be using at the time. This project is a great example of someone putting great effort into being lazy, the caller id data is alredy displayed on my phone but the phone generally resides in the next room so this avoids me needing to run for stupid cold callers. Initially I’d wanted to do this project just using the arduino, which may have been possible but using the CD50 makes it a huge amount easier.

Read more ▼

Simple sitemaps in codeigniter

Creating sitemaps is a bit of a hassle for any site bigger than a couple of pages, especially where a database is involved. While working on a recent project I created a library for codeigniter which allows the simple creation of sitemaps either by manually adding pages which might be appropriate for a blog, or allowing the library to scan controllers and adding all pages defined by methods. Common search engines can also be notified.

A simple example of it in use is shown below:

//if you're using sparks
$this->load->spark('codeigniter-sitemaps/0.0.1')

$this->load->library('sitemaps');

//assuming a hypothetical posts_model
$posts = $this->posts_model->get_posts();

foreach ($posts AS $post)
{
$item = array(
"loc" => site_url("blog/" . $post->slug),
"lastmod" => date("c", strtotime($post->last_modified)),
"changefreq" => "hourly",
"priority" => "0.8"
);

$this->sitemaps->add_item($item);
}

// file name may change due to compression
$file_name = $this->sitemaps->build("sitemap_blog.xml");

$reponses = $this->sitemaps->ping(site_url($file_name));

You can download the spark from: http://getsparks.org/packages/codeigniter-sitemaps

Or get the code from my github: http://github.com/chemicaloliver/codeigniter-sitemaps

Simple documentation is included and should be self explanatory.

This library is based on work by Philipp Dörner 2010 http://signalkraft.com/google-sitemaps-for-codeigniter

Double sided male headers – ease your FTDI cable to breadboard connections woes!

When prototyping circuits I often use a breadboard and an FTDI cable which usually leaves some kind of hacky looking unstable connection using wires stuck into the FTDI cable female header connector. This arrangement often leads to failiure as the wires fall out. After much searching I’ve managed to locate a solution to allow neat connection of a female header to the breadboard.

See below for details:
Read more ▼

Creating a Remote Webcam using NodeJS, Android, Opera Mobile, Web Sockets and HTML5

Recently I’ve been experimenting with using webcams in the browser with Javascript, while I was browsing Google on related topics I came across an interesting video on youtube. As I couldn’t find any code for how the demo had been created I decided to create my own (see below). The idea of streaming video from a phone to a server via a websocket had occurred to me before I viewed this video but I dismissed it as impractical, an opinion which has only been reinforced after testing it myself.

This is the video that gave me the inspiration (my code replicates this exactly so I didn’t see the need to recreate the video too), the only difference is I used linux all round rather than windows:

Read more ▼

Enabling web sockets on Opera Mobile

A little project I’m working on requires the use or websockets in Opera Mobile, I’d read they were supported but when I tried it just threw an exception, then I discovered you have to enable them in the config:

  1. Browse to opera:config in opera mobile
  2. Open the User Prefs section
  3. Check the enable websockets box
  4. Scroll right to the bottom of the page and select save
  5. Enjoy much websockety goodness

Easy Menu Formatting in Codeigniter

Formatting menus with appropriate CSS classes to define their state is messy and cumbersome at best, especially when not using a CMS, but something that is very much required to make websites usable. As a regular user of codeigniter it’s something I’ve been searching for a solution for (before bothering to roll my own) and fortunately I found a great solution: Steal the menu library from FuelCMS, full documentation here.

In this post I will give a simple example of generating the menu below using the FuelCMS Menu Class in Codeigniter.

Before (Plain HTML):

Basic Tabbed Menu

<nav id="main">
    <ul class="clearfix">
        <li><a href="/">home</a></li>
        <li><a href="/customers">customers</a></li>
        <li><a href="/jobs">jobs / orders</a></li>
        <li><a href="/basket">basket</a></li>
    </ul>
</nav>

After (Generated):

Tabular menu with CSS classes generated by Codeigniter

<nav id="main">
<ul>
    <li class="first active">
        <a href="/" title="Home">Home</a>
    </li>
    <li>
        <a href="/customers" title="Customers">Customers</a>
    </li>
    <li>
        <a href="/jobs" title="Jobs">Jobs</a>
    </li>
    <li class="last">
        <a href="/basket" title="Basket">Basket</a>
    </li>
</ul>
</nav>

Read more ▼

getUserMedia(), the device API and the state of the webcam in browser using javascript and html5 video

Since first considering web camera applications during my MSc thesis I’ve be fascinated by different uses and application of webcams on the web. I believe outside of skype they are a very under utilised tool for both communication and interaction and despite their long existence I believe there is still a very long way to go in what they can do.

Android camera live view in a webpage getUserMedia

In this post I intend to summarise recent developments surrounding using a webcam within web applications and go on to discuss current implementations available for using a webcam with javascript.

Read more ▼

Customising Netbeans for better performance and ease of use as a PHP IDE

For all my day to day development work, be it in php, html, js and even when I branch out into Java or C/C++, I use Netbeans as my IDE of choice. I first got into it when coding Java at university but since then I’ve moved into mainly working on PHP web apps and it has proved to be, in my opinion, the best PHP IDE available. In this post I’m going to highlight a couple of customisations I’ve made to make it’s use easier.

For the past couple of years I’ve used Netbeans on Ubuntu, previously I used Visual Studio on Windows but then I was developing C++ Applications. When I moved to Ubuntu I looked for a new IDE to patronise, I’ve never really got on with VIM or emacs.

Read more ▼

Oggcamp 2011

Casting aside my fears of writing ‘just another blog post about Oggcamp’ in this post I’ll give my thoughts on what was my first Oggcamp.

Read more ▼

Backing up my world – Online back ups for work and play

For a good while I’ve been meaning to get around to backing up my data properly. I’ve always had an external hard disk on which I backed up my important data periodically but that only covers the most basic of situations. If my house burnt down, or more likely somebody broke into my house,even just a power surge, I could conceivably loose both my real copy and the backup. From this I decided the only sensible way was to explore an offsite backup solution to use in addition to local backups. I’ve also been spurred on after buying an SSD and being unconvinced about their reliability. Indeed since starting to write this post my new SSD was recalled by corsair…

Daily backup drives

In this post I’ll describe what I backup and the online services and software I used.

Read more ▼