Raspberry Pi PBX

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

I’ve been looking at a cheap and flexible solution to having a separate phone number for business calls. I recently came across a post detailing how to use the Raspberry Pi as a PBX. It seems like it will more than cover my needs and as it comes in at under £50 for everything I figured it was worth a go.

I had planned to write a detailed post explaining what was involved in setting it up but it was much easier than I expected.  Essentially you download the image for the SD card use PiWriter to copy img to SD card from the Mac.  Plug in power and ethernet, SSH into the Pi to make a few changes and then everything else can be done via the web interface.

I followed the instructions for installing Incredible PBX on the Raspberry Pi from Nerd Vittles.  Next I needed a VoIP account and as I’m in the UK sadly google voice wasn’t an option.  So I signed up for a free SIP account at Sipgate and then followed these steps to set up a Sipgate trunk.

I’m using X-Lite on my macbook air as my soft phone at the moment.  I have incoming and outgoing calling working perfectly.  Currently calls do go to voicemail if unanswered but no messages are recorded.

The next plan is to set up a VPN tunnel into my home network so I can run a SIP client on my iPhone that will work as an extension of the PBX.  The upside is that as it’s an internal extension there won’t be any charge to pass the call on.  The downside is that it requires my phone to have an internet connection which is a rare thing in Thanet.

Ultimately I want the system to recognise if I’m home or not and automatically divert calls to the appropriate extension.  I’m sure this should be possible by looking to see if my iPhone’s MAC address is connected to the network.  Now I just need to figure out how to make a change in asterisk based on network information.

The project continues…

White MacBook vs Samsung TV

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

A few years ago I bought my parents a Samsung TV as a Christmas present.  Recently they have started watching more content on their laptop and my Mum asked if there was a way to connect it to the TV for easier viewing.  They have a somewhat ageing MacBook, the white plastic model (long since discontinued) which has a Mini DVI output.  So we purchased a Mini DVI to HDMI adapter and some HDMI cables from amazon and with my Mother being a slight technophobe I was invited over to “set it up”.

For anyone reading this you’ll be thinking exactly what I was, plug the cables in, select the HDMI input and Robert’s your Dad’s brother.  This is exactly what happened when I plugged it into the small, cheap TV in their bedroom.  However the larger, more expensive Samsung TV in their living room refused to behave itself.  I tried various menus on the television to no avail.  I googled the problem with every keyword combination I could think of and eventually gave up.

The MacBook was clearly recognising it was plugged into an external display as the screen flashed as it should but the TV stubbornly continued showing the No Signal message.  I admitted defeat and headed home.

A considerable amount of searching later I found this post on the AVS Forums which seemed to describe a similar issue.  Fortunately I had access to a PC laptop that offered an HDMI out so I visited my parents again and gave it a go.  Success!

The TV detected the PC’s output immediately.  I changed the Picture Size to Screen Fit as directed, disconnected the PC and then connected the MacBook which then worked faultlessly.

I have written this here in the hope of directing anyone else encountering the same problem to this hard to find gem of information.  It’s a very peculiar issue but armed with the instructions and a Windows laptop it is solved in minutes.

Typing Symbols on a Mac

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

Something that has always bugged me is the way that you enter symbols on a Mac.  I can never find what I’m looking for and tonight was no exception.  I wanted to type a musical note earlier this evening, couldn’t find it so I had a quick look online.  I found an article that mentioned opening the Special Characters window, which I had already looked in but then it said to choose the Symbols section.

Special Characters in Pages
Special Characters in Pages

As you can see I don’t have a symbols section.  I casually clicked the cog at the top left and suddenly was able to enable all the sections that I previously couldn’t find including the Musical Symbols.  I’m not sure how long it’s been like this but I’m glad I’ve finally got access to all the symbols again.  I’m posting this on the off chance it saves someone else some time.

Raspberry Pi as a Car PC?

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

A few years back, before the iPad was announced, I installed a Mac Mini in my car.  It worked fairly well but it was limited by the available technology at the time.  The touchscreen was purely a touchscreen so you couldn’t use gestures, no flicking to scroll for example. See the video at the end for a demonstration.

It just occurred to me that the Raspberry Pi might be the ideal small scale PC for a car install.  With XBMC available for the Pi it is clearly capable of delivering all of the audio and video you could want although the interface would need rethinking for in-car use.  Although perhaps the idea of a car pc had become redundant considering the plethora of ever more advanced headunits on the market and the abundance of tablets available.

UPDATE 01/10/13: Looks like someone has been working on it after all and a nice job too.

Car Buying Compromises

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

Performance, economy and price, you can’t have all three, there’s always a compromise. The difficulty comes in deciding where to compromise and figuring out which is best in the long run. For example lets budget £3,000 for a car, it needs four wheels and preferably four seats.

Compromising performance gets you a 2002 Ford Fiesta 1.4 Diesel, 64mpg and 68bhp. Compromising economy gets you a 1996 Skyline 2.5 Turbo, around 20mpg and over 250bhp. Compromising price gets you a 2006 Alpina D3 2.0 Diesel, 47.9mpg and 200bhp but for three times the budget at £9,000.

Personally I wouldn’t drive the Fiesta, couldn’t afford to run the Skyline or buy the Alpina but they illustrate the point nicely.  I’ve been looking at the total cost of ownership over a few years for a variety of cars that I’ve been considering. What I’ve found is that it’s cheaper over three years to buy a less economical car than to pay the premium for the “economical performance cars”. It’s food for thought so now I just have to make a decision.

GPS Quadcopter Servers

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

Wow. Hack a Day made mention of The Pirate Bay’s suggestion that they were going to turn to Low Orbit Server Stations as a way to avoid being shutdown in future.

With the development of GPS controlled drones, far-reaching cheap radio equipment and tiny new computers like the Raspberry Pi, we’re going to experiment with sending out some small drones that will float some kilometers up in the air.

Linked from the comments on The Pirate Bay’s blog was a project that created temporary filesharing networks in public spaces using a swarm of GPS quadcopters.

It’s fascinating to me how far we have come in such a short space of time.  They made it clear that The Pirate Bay’s project is at it’s very beginning but what an amazing concept.  I’ve been wanting to build a GPS Quadcopter for a while, with a view to shooting video and stills but this really intrigues me.

I presume that similar things could be achieved, albeit over a much shorter distance, using an Arduino with a wireless shield and an SD card for storage. There is already a very active community building copters and gliders powered by arduinos so adding on the ability to run a simplistic fileserver would presumably not be beyond the realms of possibility.

The problem, as ever, is powering the device.  Being airborne the logical choice would be solar power but as far as I understand it we are not yet at a place where high efficiency solar panels are plentiful or affordable.  There is an interesting article from DIY Drones which was published two years ago and concludes.

Considering these factors, building a bigger solar airplane is probably harder than building a small solar airplane. Based on the successes referenced above, I must conclude that it is possible, but not easy (or cheap).

Hopefully I’ll have some time to research this further and find out how the technology has progressed over the last couple of years.

Photo Credit: Mad Props UK Aerial Photography and Aerial Video

360 Controller with Lion Continued

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

Following on from yesterday, I downloaded Borderlands from the Mac App Store along with Half-Life 2 Episode 1, Half-Life 2 Episode 2, Portal and Portal 2 from Steam.

Borderlands worked immediately with the 360 controller.  A good start.

Portal 2 also worked straight away but sadly none of the other Steam games recognised the controller.  I tried the exec 360controller command in the developer console but that didn’t make any difference either.  Having done more reading online it appears that the Mac version of Steam doesn’t support gamepads with the source games.  An article written in May 2010 mentions:

Gamepad support, despite it being listed in the options menus for games, is not something the beta has. I was told by Valve earlier that this support is definitely on their to-do list.

Unfortunately it looks like that may not happen as it has now been a year and a half since the article was written and it’s still missing.  I suppose it comes down to the fact that Half-Life 2 is now over eight years old so it predates the xbox 360, Steam and Lion. I’ll keep my fingers crossed that someone will work their magic and make these things talk to one another but I think the chances are slim.

Image Credit Disney

360 Controller + Mac + Steam != Fun

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

I saw a lady on the gadget show playing games on a MacBook Pro with a 360 controller and as I already have two wireless controllers for my 360 I thought it was worth investigating.  A little bit of research online told me that you need a Microsoft dongle to make the wireless controllers work with a computer or I could buy a wired controller for less than the cost of the dongle.

I bought a wired controller this morning and I have spent all afternoon fiddling about but it doesn’t seem to work with Steam.

I installed the driver from here: http://tattiebogle.net/

The preference pane installed perfectly and all the buttons of my controller were recognised including the force feedback rumbles.  This was encouraging.

So I tried GTA Vice City which I had purchased from the Mac App Store.  The camera just span around and around.  I pulled out the controller plugged it in again and it worked briefly before the camera started spiralling again.  I pulled it out and tried again.  This time it worked a little longer but immediately started spinning while I was in a shoot out with the cops.  Not ideal.

Next I tried Half-Life 2 purchased on Steam.  At first the controller did nothing so I triedGamepad Companion which made my character intermittently walk into walls and then refuse to respond anymore.

I looked on Steam’s Support pages and found this article on using and xbox 360 controller with source games.  They mention using the configuration files with Half-Life 2 so I tried that.  Still no joy.

I have now read so many articles and watched about ten videos where teenagers tell me how easy it is to get the 360 controller working on the mac but I still can’t figure it out.  Perhaps it’s the fact that I’m trying it with old games?

I purchased Borderlands from the Mac App Store but I can’t download 9.51Gb on my 0.2Mbps connection so I’ll download it at work in the morning and try again tomorrow night.  Hopefully that will work otherwise the controllers going back and I’m giving up on portable gaming.

jQuery mousemove project.

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

I set myself a little project yesterday to make an image where the head follows the cursor around the screen.  I thought it would be an interesting way to learn jQuery.  I got Shelley to take nine images of me and then I put together a simple test.

The image was set to absolute positioning, 200px from top and 200px from the left.  This allows me to set up a series of if statements that find out if the cursor was in a specific sector.

The example is here: http://clients.imagecircus.com/jquery/

The next step is to make all the measurements relative to the image.  With the current version the image must be absolutely positioned which is limiting.  Ultimately I would like to be able to place the image within a fluid layout and still have the interaction work.

Having done some research online it looks like I need to use minus offsetLeft and minus offsetTop to set the origin to the top left of the image.  I am having some trouble figuring out the code though.  Hopefully one of my developer friends will point me in the right direction.

Other improvements to make are making sure that the sectors overlap as currently there are dead spots between them that show the straight on image and perhaps more importantly preloading all the images.

UPDATE: A photographer friend of mine took some better headshots (seen above) so the example has been updated with those.