Skip to: Site menu | Main content


>> Status screen for Shopify orders

Sun, Dec 26th 7:22pm 2010 >> DIY

The status screens I set up for IVT have turned out to be really useful: they keep critical information right where you can see it, rather than buried somewhere on an intranet page or financial report. So I decided to have a go at building something similar for Shopify orders.

After my 5th book, Practical Arduino, came out almost exactly a year ago, I had a few requests for hardware related to the projects featured in it. I did a blog post asking if anyone would be interested in book-related kits and the response was amazing. Because I'd designed some prototyping shields and had 100 of them fabricated while I was working on the book it seemed like a reasonable idea to try selling the ones I had left over and see if anyone would really want them, so I put together a little online store called Freetronics and starting selling bits and pieces related to Arduino. Something extra to do on the weekend, really.

Now that the product range has expanded and orders are coming in at a fairly steady pace I want to know immediately if there were any orders waiting to be fulfilled, and a status screen seemed like a cool way to do it. I already had a 22" LCD mounted on the wall in our half-renovated kitchen (which is currently also my workshop!) with a DVI cable running through the ceiling to an eeeBox running Ubuntu/MythTV, so the hardware was all in place and all I had to do was muck about with a bit of code.

For this status screen I used the same basic architecture as for the IVT status screens, which separates the system used to collect data from the system that displays it:

The display itself is simply the Google Chrome web browser running in full-screen mode, pointing at a web page served off the internal intranet server which runs Linux, Apache, and PHP. The datastore is a set of tiny text files, each containing a value for a specific parameter. The collectors on the right are run periodically using CRON, with each collector operating independently and designed to talk to one specific data source.

The top of the screen shows the current date and time, along with a summary of order status. The bar changes colour depending on order status: red if there are new orders that have not yet had payment accepted; yellow if there are orders that have had payment accepted but have not yet been fulfilled; and green if there are no orders requiring any action.

The middle of the screen displays the last four orders in Shopify which are collected using an authenticated RSS feed. The collector implements a very simple parser that extracts some basic information from the RSS feed. One thing that tripped me up initially was that the RSS feed seemed to take many hours to reflect changes in the order list, and it turned out there was some heavy-duty caching happening somewhere between me and Shopify. That was solved by appending a dummy variable to the request URI with a random number as the value, forcing the offending cache to re-fetch the feed every time.

The bottom of the screen displays the number of unread emails in a couple of mailboxes, and the current weather conditions in Melbourne taken from the Google Weather API.

The result: at-a-glance display of the most important information in Shopify's orders interface, letting me put it out of my mind and stop obsessively checking the order list while knowing that I'll see immediately if there are orders waiting to be processed.



Bookmark and Share


>> Virtual buttons, real appliance

Sun, Feb 10th 9:07am 2008 >> DIY

Following on from my tutorial at linux.conf.au on hardware / software hacking to join Second Life to the real world, I've now put up the first of a series of step-by-step instructions. This one is to create a couple of virtual buttons inside Second Life that control an actual physical appliance in the real world when they're clicked: Virtual Buttons Real Appliance I still need to add a bit of stuff at the end about connecting relays and modifying an appliance remote control, but most of it's there.

Bookmark and Share


>> What I did in the holidays, part 3

Thu, Jan 4th 8:34pm 2007 >> DIY

Built a new bathroom (almost)

bathroom in progress

Like all good renovations this one started with a chainsaw.

I started by ripping out the old bathroom, the toilet, and the laundry, including all the adjoining walls, the ceilings, the old windows, and even the floors, leaving us with a passage with half a wall missing and the only thing stopping people stepping off into the void being a piece of plastic tacked in place.

It was only after the old floorboards were gone that I realised what a bad state the old subfloor was in. The joists were more twisted than a basket of Queensland bananas with vertical variations up to about 17mm so I started by triming down the worst of the high points and then laid a second set of joists alongside the old ones to provide a flat top surface. I also layed thicker sheets than are typically used for domestic flooring so the end result is an extremely strong floor: jumping up and down on it shows no give at all, it's like jumping on a concrete slab.

The photo is actually a bit out of date. There's been a lot of progress since then. The center hole you can see is where the old toilet window used to be, but it's now boxed up as a cupboard and the vanity plumbing is in place directly below it. We had a builder install the windows on the left and right, and you can also see just in from the windows the cabling for a power point (left) and switches (right). The ceiling has now been hung and all the walls have been lined with Villaboard and just need to be tanked so we can start tiling.

For tech geeks though the interesting thing in the picture is the cable to the right of the vanity. Yes, that's Cat-5, and it's everywhere in this place. Everything in the new bathroom is going to be computer controlled or sensed, and I mean *everything*. The window winders will be electric, as will the curtains. Sensors will include ambient light, humidity, temperature, motion, door position, toilet flush, water flow, flowing water temperature, bath water temperature, and anything else I can think of. There won't be a single electrical item cabled in the usual way with a manual switch in line with the device: everything other than basic power points is cabled from a central termination point where it can be computer controlled, and switches themselves are replaced with home-made touch sensitive control surfaces that communicate via Cat-5 back to the automation controller.

Which will run Linux, of course.

I'll be doing a talk at linux.conf.au called Making Things Move: Finding Inappropriate Uses for Scripting Languages which covers some of my home-brew automation / hardware hacking insanity, so if you're interested in this sort of stuff please register for LCA and come along!



Bookmark and Share


>> What I did in the holidays, part 2

Sun, Dec 31st 11:18pm 2006 >> DIY

Installed a window in the laundry

The new laundry is right at the back of the house and very elevated but it doesn't take advantage of the location by having a window overlooking the back yard, so when we ordered windows for the new bathroom we also got one for the laundry.

Installing a window into an existing wall is actually an interesting exercise. The window needs a support frame around the window frame itself, and when building a new house the support frame is just constructed as part of the wall structure then covered with plasterboard. With an existing wall the options are either to rip off the plasterboard and replace it afterwards or do a "ship in a bottle" exercise and build the frame inside the wall cavity without removing either the plasterboard or any weatherboards.

The photo shows the job not quite finished. The plaster still needs patching, there's no architrave fitted and the frame isn't painted. What's interesting though is it shows some of the cuts that had to be made through the plaster to remove the center of an existing stud and remove some noggins. Cutting the hole in the plaster was a simple job of a few minutes, then the stud had to be cut 45mm *lower* than the bottom of the hole so a horizontal brace could sit on top of it. So how do you cut a stud inside a cavity only 90mm wide? Easy, just use a circular saw to cut the stud directly through the plaster from one side and through the weatherboards from the other side. Kinda like keyhole surgery, because the stud inside the wall is cut through but externally it leaves only a small slot which can then be easily patched. Yeah, I know, it's probably an obvious solution to everyone else in the world but I thought it was neat.

Then I built the side frames by attaching spacers to the studs on either side, which meant lots of hammering in a space barely wider than my arm but eventually resulted in a sturdy frame that ended up just barely proud of the hole. Sliding the window assemby into place and attaching it to the support frame was a piece of cake and voila, one new window!



Bookmark and Share


>> What I did in the holidays, part 1

Sun, Dec 31st 10:49pm 2006 >> DIY

Converted an antique dresser base into a vanity

We're doing some renovations at home at the moment including converting the bathroom in the flat into a combined laundry / toilet (since the old laundry has been subsumed by the new bathroom, but that's another installment!) and we needed a vanity for it. Ann found a dresser base in an antique shop but it was too high so yesterday my Dad and I did a bit of plastic surgery: we removed the top and the surrounding frame, cut down the body to remove the top row of drawers, and reattached the top. What you can see is the post-surgery version: originally it had three full-width drawers and a pair of half-width drawers. That actually would have made it the perfect height for me, but the rest of the family would need a chair to wash their hands!

Ann managed to get hold of the very last stock in Australia of a certain rare Kohler vessel basin and we've mounted it in the top but none of the plumbing has been done yet. I still need to modify the top drawer by partitioning it and cutting a section out of the rear center to clear the waste outlet from the basin, then the plumber can come in and fit the taps, outlet and waste.



Bookmark and Share

1 of 1