Case Study: BeakPi

The large companies that use Dojo are widely known. This series features lesser known users of Dojo, and their stories. This time, we interview Iain Hamilton from Esri, creator of BeakPi, a home automation system using Dojo and Raspberry Pi.

BeakPi Desktop

BeakPi iPhone BeakPi iPhone Screenshot

Q: How did you first learn about Dojo?

A: I first ran into Dojo when I began working for Esri seven months ago. Until then during my years of freelancing I’d only ever dabbled with frameworks when a job called for some bug resolving. I had developed applications using other language frameworks, but when it came to JavaScript, for some unexplainable reason I always enjoyed the challenge of reinventing the wheel and using small libraries I’d devised for handling tasks.

Q: Why did you choose Dojo?

With enjoying the daily exposure to Dojo at work, the reasoning became obvious and the madness of my previous years became clear. Seeing how rapidly it allowed for you to accomplish tasks and not require thoroughly testing in every browser on every 17th line was impressive.

Both the code and styling uniformity the Dojo Dijit widgets offer makes even the smallest of interactions look polished and professional, my favorite styling being the Claro theme. The XHR handler and deferreds remove a lot of ache that would have cropped up if attempting to handle my project without Dojo. I knew developing my project with Dojo would guarantee a smoother experience and a final product less prone to problems requiring fixing.

Basically I chose Dojo as all the more tedious issues that I had experience of handling could be dealt with in a less barbaric form, allowing me to smartly put together a neat application.

Q: How does your application use Dojo?

A: As seen in the video, the application user front-end is built using mostly Dojo 1.9 in AMD format. There are a few wee PHP scripts for system communication with the Raspberry Pi as well as the Mopidy JS websocket script, but apart from that it’s purely Dojo. It makes good use of various Dojo Dijit widgets for the interfaces as well as the XHR tools for communication.

Anyone connected to the local network can load the Raspberry Pi IP in their browser and through the Dojo interface begin controlling the Pi audio output. The interface seamlessly works on all devices, from laptop to smartphone. Via the offered interactions of the browser application, the Mopidy service backend, the Spotify Rest API and MPC application users can search, queue, skip and view tracks.

Q: Overall what is your experience with Dojo?

A: I’d say that considering I use it at work everyday and also in my hobby programming its pretty clear that I love it! It did take me a short time to get to grips with some of the practices used within Dojo in reflection of coming from the blank canvas approach with my JS programming, however it really was worth it. I look forward to moving my project to the next stage with Dojo.

Q: What’s your favorite thing about Dojo?

A: Being able to get your ideas on page fast and with no cross browser stress. For example I wanted to add a seekbar and volume bar to the interface, I pull in dijit/form/HorizontalScrollbar and periodically update its position by polling and filtering the media player system response. Some slight modifications to the style and done. It’s rapid, stress free and looks pretty damn sweet instantly.

Q: What are your future plans with Dojo?

A: Apart from working on some more of the audio player features, the next part of my home automation project is controlling household devices. I’ve just recently got communication between the Dojo application, a PHP TCP socket streamer and a RF controller plugged into the Raspberry Pi working. This currently allows for turning a lamp on and off via XML packets. My plan is to setup a back-end database and add some timer controls with Dojo, allowing for a bedside fan to be toggled on and off in the middle of the night.

Thanks!

Thanks Iain for telling us about your experience with Dojo. If you are interested in getting involved, fork the BeakPi GitHub project. If you would like to share your experience, please contact us.

One thought on “Case Study: BeakPi

  1. Hello,

    I really need some help with Dojo to do a school project. I have searched the web for days but no luck. I need to connect to a folder. Can you please help. If so please throw me an e-mail so that I can give you some more detail.

    Thanks

Comments are closed.