Skip to content

UPnP/DLNA clients in Ubuntu 13.04

Banshee and UPnP remoteStream­ing con­tent from a UPnP server (in my case, the XBMC media centre in my lounge room) to an Ubuntu machine is fairly simple. But there didn’t seem to be any doc­u­ment­a­tion that I could find, and I ended up spend­ing a sur­pris­ing amount of time futz­ing around mak­ing it work. This is how I did it in Ubuntu 13.04. I use GNOME for my desktop, but con­firmed that it also works just fine with the default Unity desktop. Other envir­on­ments may need to tweak how the ser­vice starts, as well as clients.

Install soft­ware

We’re using the Rygel UPnP pack­age, spe­cific­ally its MPRIS inter­face to enable UPnP ren­der­ing to desktop media play­ers. In addi­tion, we install GUPnP to provide a UPnP Con­trol Point, and finally ban­shee. I had a crack at using Totem as a ren­derer, as of April 2013 the ver­sion in Ubuntu registered as a Medi­aR­en­derer but quietly refused to play any con­tent I asked it to. The upnp-inspector pack­age is nice for check­ing everything works.
sudo aptitude install rygel rygel-preferences gupnp-tools banshee upnp-inspector

Con­fig­ure rygel

Open Rygel’s con­fig­ur­a­tion file:
nano ~/.config/rygel.conf
And enable the MPRIS inter­face by adding the fol­low­ing at end of the file:
[MPRIS]
enabled=true

Rygel is designed as a UPnP media server, and by default will start offer­ing up local video, music and pic­ture shares as media serv­ers. If you don’t want this, it can be dis­abled by run­ning the Rygel Pref­er­ences GUI tool, or by adding this to the [gen­eral] sec­tion of your rygel.conf:
interface=
upnp-enabled=false

Auto­start Rygel at login

cp /usr/share/applications/rygel.desktop ~/.config/autostart
Log out and back in to start the Rygel service.

Con­fig­ure Banshee

Finally, the MPRIS inter­face needs to be enabled in Ban­shee. Start it up, nav­ig­ate to Edit -> Pref­er­ences. Click the Exten­sions tab, scroll down to the util­it­ies sec­tion, and ensure the MPRIS D-Bus Inter­face is enabled.

Play­ing things

UPnP Inspector window

Inspector win­dow show­ing my XBMC server, the local Rygel share, ban­shee, and BubbleUPnP on my android phone.

Start UPnP Inspector. It should list any avail­able Medi­aServ­ers on your net­work and, if you didn’t dis­able them, local shares from Rygel. Start ban­shee, and it should also appear as a Medi­aR­en­derer in the inspector window.

Any UPnP con­trol point on the net­work will be able to send con­tent to ban­shee (I’m fond of BubbleUPnP on Android). Or start the UPnP AV Remote con­trol pro­gram. I’ve only been play­ing with it for an hour or two, but get best res­ults from external con­trol point soft­ware. The GUPnP remote occa­sion­ally stalls try­ing to play things.

 

Hacking the Ikea DIODER in ten minutes flat

Last week I bought a set of DIODER lights from the Ikea down the road, pretty much on a whim. They’re not the cheapest way to buy RGB strip light­ing, but I did like the mod­u­lar design. And it’s remark­ably easy to modify the con­trol­ler to drive the sys­tem with an arduino.

The sys­tem comes with a con­trol­ler that allows you to set a col­our manu­ally, as well as pre-set col­our change and fade func­tions. Rather than build my own cir­cuit I wanted to save time by reusing this con­trol­ler. Open­ing it up revealed a PIC micro­con­trol­ler, and three MOS­FETs for the red, green and blue channels.

First thing to do is dis­able the micro­con­trol­ler by cut­ting through the power track. Cut­ting through the big pad I’ve marked on the dia­gram means it’s easy to then wire a switch across it if you want to be able to use the con­trol­ler as normal.

Three out­put pins from the micro­con­trol­ler drive the MOS­FETs, but only two of them have big friendly solder pads, so I soldered wires on to the three res­ist­ors just below the MOS­FETs (R5, R6 AND R7). Then soldered the other ends of these wires to a short strip of header pins. These are then plugged straight in to pins 9, 10 and 11 on my Ardu­ino. I’ve labelled the pic­ture with which MOSFET drives which LED chan­nel, but they match what’s prin­ted on the PCB where the input cable is connected.

Finally, we need a ground wire. Easi­est way to con­nect it is to solder a wire on to the –ve wire on the input cable. The other end of that is again soldered on to a header pin, which is con­nec­ted to the ground pin of the Arduino.

And that’s it. I hooked these up to my LeoStick the Freet­ron­ics guys gave away as swag for LCA 2012 and loaded up some demo code I had sit­ting around from the last time I played with an RGB LED.

Right now I’m using this setup as a light con­trol­ler for bob­light on my XBMC media centre. Set­ting up the con­trol­ler, writ­ing my own single-channel bob­light sketch, installing soft­ware and con­fig­ur­ing the XBMC addon was all done in a single even­ing. It was a lot of fun, and even with a single chan­nel the res­ults are pretty awesome.

Controlling external lighting with Arduino

The path to my front door is long and very poorly lit. There’s a sensor light moun­ted above it, but that’s never worked and, liv­ing in a rental, get­ting it fixed has been a bit of a task. So I bought a roll of 3-wire LED rope light on eBay. Cable-tied it to the under­side of the bot­tom stretcher of the fence run­ning along­side the path. The power cable was fed in through a win­dow by the front door, and I had nice, bright, even illu­min­a­tion. But it was still kind of bor­ing. So I bought an ethernet-capable ardu­ino. (Con­tin­ued)

Jackson PT9723 remote power control and Arduino

Jackson blister pack
The Jack­son PT9723 is yet another 433MHz remote power con­trol sys­tem. I picked mine up on sale from Office­works last month, who don’t seem to sell them any more. But they’re still read­ily avail­able online for a fairly mod­est price.

I bought it with the inten­tion of con­trolling it with an Ardu­ino. How­ever, inter­fa­cing with it proved to be a little more dif­fi­cult than most other sys­tems around, and nobody else seems to have done it yet. So here’s how I man­aged it.
(Con­tin­ued)

So long, momo :-(

Yes­ter­day I bricked my phone.

I bought a HTC Dream on an Optus plan the day they released it in Aus­tralia. Out of the box it was awe­some, pretty much everything I wanted out of a smart­phone. But as time passed, the Cup­cake android release became wide­spread, and Optus lol­ly­gagged about push­ing the update out to their users. One by one my favour­ite applic­a­tions released updates that made them incom­pat­ible with my phone, until even­tu­ally I gave up and found a good guide on root­ing G1s.

With an up-to-date firm­ware and Mar­ket Ena­bler to get around Optus’ other major prob­lem of not mak­ing paid applic­a­tions avail­able, I was in smart­phone heaven. That was until I heard wind of ROMs based on the Android 2.1 release (as seen on the new Nexus One hand­set) run­ning on the G1. It looked like it might be fun to try, so off I went.

One of the steps involved in ini­tially root­ing a hand­set involves load­ing a new SPL to bypass region check­ing and enable boot­ing unsigned ROMs, so I’d done it a couple of times before and was fairly com­fort­able with it. Unfor­tu­nately, newer builds need the Haykuro SPL, which is sup­posed to be more aggress­ive with how it deals with the internal stor­age space (lead­ing to more size for big­ger images), but also kind of dan­ger­ous. I double– and triple-checked everything, but still seem to have screwed some­thing up flash­ing the SPL, and now I have a phone that is basic­ally dead. The 1st boot­loader screen comes up, but I can’t get in to the fast­boot menu or the recov­ery image. My poor little momo (my com­puters are named after Samurai Champloo char­ac­ters) was no more.

Luck­ily my birth­day was yes­ter­day, so I don’t feel too bad about treat­ing myself to a new phone. After a morn­ing of read­ing reviews, I think I’ve decided on a Motorola Mile­stone. I’m a little wary of Motorola — my last Moto hand­set was an abso­lute dis­aster, and work­ing for a mobile com­mu­nic­a­tions com­pany means I’ve had a chance to tinker with newer Motorola hand­sets that were sim­il­arly dis­ap­point­ing. But the Mile­stone seems to be a very impress­ive and solidly-built phone. The jury is still out on whether the Mile­stone or the new Nexus One would win for Best Android Phone right now, but I for one am swayed by a good hard­ware keyboard.

So, momo is dead, long live… uh… momo?

Spontaneous travel

I’ve been on hol­i­day for most of the last week. One of my broth­ers in Adelaide was get­ting mar­ried in a beach-front cere­mony in the small town of Port Rickaby, a few hours drive west of Adelaide. I took some extra time off work, because I wanted a hol­i­day, and wound up spend­ing a couple of days in Coober Pedy. Coober Pedy is a very very strange place, and well worth a visit. The opal industry is fas­cin­at­ing. I might write some more about Coober Pedy, not just because I like say­ing Coober Pedy. But the point of this post is a very brief rant about spon­tan­eous traveling.

I flew out of Sydney on Tues­day even­ing. On Tues­day morn­ing I real­ised I should prob­ably think of some­thing to do with my hire car and my three bliss­ful days of noth­ing before I had to be at Rickaby, so spent some time with google maps. Even­tu­ally picked Coober Pedy because:

  • I’d never really been to cent­ral Aus­tralia before. Seen some bits of desert while tool­ing around in WA, but not true outback.
  • My vague recol­lec­tion was that it was a pretty inter­est­ing place.
  • I like say­ing Coober Pedy.
  • It was about as far away from any­where I’ve been before, that I could reas­on­ably get to in the time I had.

I tried explain­ing this to a bloke I met in the pub in Coober Pedy. He was abso­lutely amazed, and couldn’t quite com­pre­hend that some­body would just, on the spur of the moment, get in a car and spend ten hours driv­ing to Coober Pedy, just because.

Last year I went to Cowra because on a Fri­day morn­ing I thought “hrmn, I want to go some­where this week­end, where should I go?”, and pick­ing Cowra because I hadn’t traveled West of Sydney much, and Cowra seemed about as far as I could reas­on­ably drive on a Fri­day night. I got there and had a con­ver­sa­tion with a bloke in a pub that went some­thing like:
“So if you’re from Sydney, what are you doing out here? Work?“
”*shrug* Just hav­ing a look around. Wanted to get out of town for a week­end, and wound up here.“
”…bull­shit.“
Incid­ent­ally, the Japan­ese garden at Cowra is the largest in the south­ern hemi­sphere, and abso­lutely amazing.

By the time I’d got­ten to Taralga six months ago, I’d given up and just told people that I was on my way to Yass but had to go via Bathurst because *mumble*mumble*. That seemed like a much more real­istic explan­a­tion than want­ing to see more of inland NSW (and telling them I’d taken a two-door hatch along Wombeyan Caves Road would have prob­ably been pretty damn embarrassing).

What’s the big deal? Do people not just travel for the hell of it any more? Maybe they think it only counts if you’re going over­seas? Have we for­got­ten how much of the new and excit­ing is sit­ting right at our door­step (and if not there, def­in­itely a two hour flight and ten hour drive from it)? Maybe small town inhab­it­ants just don’t believe their par­tic­u­lar small town is worth vis­it­ing (I know I still think this about Yass).

When was the last time you threw the fig­ur­at­ive dart at a map?

Can I fit the words “Coober Pedy” in to this post one more time?

PXE booting using OpenWRT Kamikaze

My net­work gets its addresses from dns­masq run­ning on the Kami­kaze 8.09 release of Open­WRT. This oper­at­ing sys­tem uses an unusual sys­tem for con­fig­ur­a­tion, and get­ting dns­masq set up for net­work boot­ing took a little bit of effort. So I’m doc­u­ment­ing it here, for either any­body else who’s stuck on it, or for when I inev­it­ably forget.

Edit /etc/config/dhcp, and in the config dnsmasq sec­tion add a line like this. The format is as per the dns­masq man page:

    option dhcp_boot	pxelinux.0,tftp_server_hostname,tftp_server_ipaddr

The init script does all the pars­ing of the dhcp con­fig file, con­vert­ing things in there to cmdline argu­ments to dns­masq. So you need to edit /etc/init.d/dnsmasq, and in the dnsmasq() func­tion add this line:

	append_parm "$cfg" "dhcp_boot" "--dhcp-boot"

The func­tion already has a bunch of append_parm lines. Just search for those and add your new line imme­di­ately under them.

Restart dns­masq and you’re good to go.

Belated Ada Lovelace day post

I know I’m run­ning late, I’ve barely had time to think lately, let alone try to assemble a coher­ent blog post. But yes­ter­day was Ada Lovelace day and I wanted to draw some atten­tion to one of the less vocal but def­in­itely no less import­ant mem­bers of the Sydney IT com­munity; good friend and crack geek fem­in­ist ninja Alice Boxhall.

Alice
(appar­ently I don’t have a pic­ture of her doing any­thing par­tic­u­larly nerdy)

I first met Alice[1] not too long after she was hired by Google, as the sole female engin­eer in their Sydney office. Hap­pily, that doesn’t seem to be the case any more, but she con­tin­ues to do a lot of great work as an IT evan­gel­ist. Along with Pia Waugh, Alice works with school-age girls encour­aging them to get involved with com­put­ing, most recently at the Go Go Girl for IT event. She’s also been involved with local Aus­siechix events, help­ing run the micro-confs in Sydney and Mel­bourne last year, as well as being involved in Linux­chix miniconfs at recent LCAs.

I’m always impressed by her encyc­lo­pedic know­ledge of the issues women face, both in the pro­fes­sional IT sphere and else­where, and the pas­sion and clar­ity she brings to defend­ing her rights and the rights of other women. I listened in on Alice’s group dur­ing the Evan­gel­ising IT work­shop at the Linux­chix miniconf this year, which came up with some excel­lent strategies for try­ing to keep girls (and boys as well!) inter­ested in com­put­ing. It was one of the high­lights of LCA for me this year.

Linuxchix miniconf: Evangelising IT workshop

On a com­pletely unre­lated note, Alice is a very tal­en­ted pho­to­grapher who shares my love for old-school pic­ture mak­ing. Hav­ing a chance to learn from her both behind the cam­era and in the dark­room is just another reason for me to feel inspired by her work.

[1] For the record, I believe this happened shortly after my then-housemate, Jamie also star­ted work at Google. I arrived home one after­noon to find half the Google office in our pool.

1234567890

Well, that was fun.

peter@fuu:~$ date +%s
1234567890

Appar­ently the next big event is 0×50000000 seconds since epoch, due to hap­pen shortly after 9pm on the 13th of July, 2012.

Finally framed

I really wanted to bring my LCA auc­tion print to the SLUG meet­ing week before last, but I’d already taken it to the framer and spent a good hour or so try­ing to decide how it should be framed. The Fram­ing Fact­ory in Roseville do con­sist­ently excel­lent work, and I’m always happy with them. Unfor­tu­nately they have a two week turn­around (although I did get a rush job out of them a few days before Christ­mas, but my mind has blanked out how much extra it cost). Well, today I finally picked it up. And once again they didn’t disappoint.

"Neptune's Fury", framed and hung.

We went with a 100mm (3.9″) flat white matte, sur­roun­ded by a 70mm (2.8″) plain black frame. Apart from a slight bevel on the inside edge, the frame is plain and square. All told, this thing is 1070mmx870mm (42.1“x34.3″), eas­ily the biggest and most impress­ive print I own.

I couldn’t be hap­pier with the way it’s come out, and I’m incred­ibly proud to have such a beau­ti­ful and pres­ti­gi­ous print gra­cing my lounge room.