Matt Daubneys Blog

Fun

Arduinos, MQTT and Light levels

by on Sep.04, 2011, under arduino, EasyRadio, Fun, programming, ubuntu

Since watching Andy Pipers talk on MQTT at Oggcamp, I’ve been trying to understand and use Mosquitto with my Arduinos. I’ve got a few sensors lying around to test this with (and have ordered some more \o/ ) and have started to have some success.

Installing Mosquitto is a doddle. I added the ppa to one of my household servers, then just apt-get install mosquitto. MQTT broker up and running in a matter of minutes. The first thing I setup to check if it was working was a simple python program that would just connect to the broker and send “Hello World” to the “hello” topic. I wrote a second little python script to just listen to the “hello” topic and print out the message from any updates. Most of the code was borrowed from this blog post which was incredibly helpful :)

With that running happily, I moved on a stage. Digging out an old shield for my arduino that I made to control the lights in my flat using some home easy sockets and an RF chip, I added an LDR and used the thermister that was already on the board. This simple set of components means I can now monitor both the temperature and light levels in one of the rooms of my flat. Using an ethernet shield for the arduino also means that I can then report that information to my Mosquitto broker using the arduino mqtt library.

What will I do with all this information? Well, initially I’m going to write an mqtt to sql bridge (might use this an excuse to learn postgres now mysql has an uncertain OSS future) and will setup some scripts to graph the information. I’ll probably change this sketch to control the lights in the flat, so I could have a machine somewhere sending a message to the mqtt broker at a set time to turn the lights on in the bedroom (a simple mqtt powered alarm clock :) ). Hopefully I’ll write a small application using the app indicator framework for Ubuntu (and growl for OSX) to tell me when certain thresholds are passed, especially for the other sensors I have coming (Alcohol, Gas, Smoke and humidity). I might write another bridge to use the google cloud messaging system to add an alert on my phone as well.

There’s a whole world of possibilities out there, thanks to so many people building these various components and libraries that make hacking fun toys so much easier :) Many thanks to all those who have developed the frameworks, libraries and services that I’m using and for making the F/OSS to make life even easier.

1 Comment :, , , , more...

A quick hack to cheer up a rubbish couple of weeks

by on Aug.24, 2011, under Fun, life, linux, ubuntu

Simply apt-get install libnotify-bin and then add the following to your crontab

*/10 * * * * DISPLAY=:0.0 XAUTHORITY=~/.Xauthority notify-send “Don’t forget”  ”you’re awesome”

Then every ten minutes, this will happen:

Just to cheer yourself up after a really rubbish few weeks.

Leave a Comment :, , , , , more...

Banishing the demons of distraction

by on May.08, 2011, under Fun, learning, life, linux, ubuntu

For a little while now I’ve been getting quite annoyed with myself for being very easily distracted (be it with llamas, badgers, narwhals or whatever). This has meant that my general level of productivity has been somewhat…… low. I have a list of running projects as long as my arm, none of which get enough attention because I flit form one to the other almost hourly. The situation as is obviously needs addressing.

From what little intelligence I can bring to bear on the problem, this should be able to be broken down into a few different variables:

  1. Environmental
  2. Physical
  3. Grey-mushial (?)

Environmental

Fixing environmental problems is relativley easy. If I want to concentrate on a task now I use my Mac Mini. Not because OSX is any more productive than Ubuntu I hasn’t to add, but because it is in a room on a desk with a comfortable chair in a comfortable working position. There is no television, no games consoles or anything else around to take my attention away from what I’m attempting to do.

In the office at work, I try and keep my desk clear of clutter. When there is a lot going on, or a lot of noise around, the twin help of Spotify and a decent pair of headphones can help keep me inside my own head and in my comfortable work zone. Anything I would sit and watch constantly for updates or results is now being reworked to email me or notify my some other way so that I can carry on concentrating on the more important tasks rather than waiting for something else to finish.

Physical

With this I refer to my general physical fitness and general wellbeing. I am quite aware that I don’t get enough exercise, but have yet to generate a plan to resolve this. Until recently I had no idea how well I ate. Throwing together a nasty hackey database in Django (code), I actually discovered I don’t eat too badly… but can binge on chocolate when things get a bit stressful! This is quite easy to rectify by stopping buying lunch and making it in advance. I still crave the chocolate quite a lot during the day, but hopefully this will fade away given some time!

Grey-mushial

This is what’s going on in my head and possibly the hardest part of the whole cycle to change. When I get frustrated with something I lose the will to carry on with something. This is normally the major factor in why I jump from project to project, task to task without completing things. I get frustrated and annoyed that I can’t do something so move onto something else I can do. This has a lot of negative impact as it means that sometimes I struggleto learn something new and overcome certain issues. This is quite hard to change, but I’m attempting to bring some positive re-inforcement to bear on the problem. Craving chocolate when being frustrated isn’t helping things, however, if I now manage to solve a problem that’s frustrating me then I can have some chocolate. This helps me motivate myself to push through the problems that keep me stumped, frustrated and annoyed.

Actually keeping my mind on task is another seperate problem. This, at the moment, I have no idea how to solve. I’ve started reading around this and started reading up on Zen as a lot of Zen practice seems to be based on either keeping your mind on a single thing or emptying your mind of all things completley. This may help, this may not help! Anything I struggle to concentrate on I make a note of what it is, hopefully some kind of pattern will emerge from the mess over time. For some reason, one thing I really can concentrate on without being distracted is painting my 40k models. I have no idea at all why this specifically is so easy to concentrate on, but an interesting observation none the less.

Why bring all this up on here? Well, for a start this place is one of my projects that gets overlooked quite frequently, and secondly so that if anyone does have any dealings with myself where I start something and don’t necessarily stick to it for a period of time….. let me know in case I haven’t noticed. There is a lot of Ubuntu stuff I’d love to do if I could just get over these daft concentration issues!

 

Leave a Comment :, , , , more...

Chillis!

by on Jan.31, 2010, under Fun, learning, life, ubuntu

Having seen other peoples success of growing chillis from seed (specifically theopensourcerer) I thought this year I’d have a go. So in what could possibly be said to be a familiar style…..

Packets of Chilli Seeds

Packets of Chilli Seeds

I’m only attempting three types of chillis this year, cayenne long hot, navaho and scotch bonnet. In the interest of science I’m trying theopensourcers method of germinating the seeds, and tomorrow evening will be attempting some in plain pots with compost in a heated propagator. This may mean I end up with an absolutley enormous glut of chillis, but I’ll burn that bridge when I come to it.

Here are the seeds ready for the airing cupboard.

Seeds in trays

Seeds Ready for the airing cupboard

I’m also in the process of building an automated watering system for these once they’re in the greenhouse using arduinos, and hopefully connecting to a server in the house using an easy radio link to report the conditions in the greenhouse :) Many thanks to theopensourcerer for the information he’s posted on his blog.

Leave a Comment :, , , , more...

The Code Book by Simon Singh

by on Sep.14, 2009, under Fun, learning, ubuntu

In a fit of overwhelming generosity, popey lent me a couple of books, The Code Book by Simon Singh and a python book, which is downstairs so I don’t have the title to hand. Ignoring the python book for the moment, I’ll concentrate on The Code Book.

The Code Book is an overview of the history of codes, ciphers and code cracking. Encryption in all its forms is incredibly interesting to me, simply because some of the methods involved are incredibly clever and very subtle. The book goes through the evolution of codemakers and codebreakers from it’s very beginnings  with Ceasers’ cipher through to some predictions on quantum computing and the effects of this.

The book starts with the story of Mary Queen of Scots. She was put on trial for Treason, but her cousin, Queen Elizabeth I, would only convict and execute her if it could be proven without doubt. This story of how code-breaking had been a life or death situation is continued through out the book. These stories in themselves are intriguing for the huge effect codes and code-breaking have had in our history. The constant creation of new codes and the subsequent breaking of them changed various events in our history.

The author leads us through history, story by story, cipher by cipher, talking about various famous cryptogrophers including Turing, Vignere, Zimmerman and many others.

The book is very easy to read and incredibly insightful. It’s certainly made me a bit more paranoid about security of my various machines!

Thanks again to Popey for lending me this book, and also allowing me to pass it on if anybody else would like to delve through it! Just drop me an email and let me know you’re interested :)

Leave a Comment :, , , , , more...

Mobile Broadband!

by on Sep.13, 2009, under Fun, linux, ubuntu

I finally got one of those mobile broadband dongle thingies in the post this week, and I’m impressed. Admittedly I don’t get any 3 signal at home, so it’s a bit useless there, but once I’m out and about its fantastic. I’m sat in
starucks writing this on my eee and it’s really quite quick. Much quicker than hanging the eee of my mobile, whic
h I used to do previously.

The dongle I’ve got is a ZTE MF627, which was a bit of a fiddle to set up on chruncheee, but I’ll do a screencast
later on showing how to do it. Anyway, my coffee is getting cold!

1 Comment :, , , , , more...

USB Fun!

by on Jul.23, 2009, under FOSS, Fun, learning, linux, ubuntu

I’ve been playing with a velleman k8055 USB experimentation boad and think I’ve finally come up with a use for this first board. I’m going to attempt to automate a few things in my room using a Linksys NSLU2.

The first thing to attempt is a nice simple one and does not involve touching any household electrics. A simple motor arrangement on the curtain rail to open the curtains in the morning and force me to get the hell out of bed!

The second thing I intend to do with it is a little more complex and will require some more research. I intend to somehow replace the dimmer switch in my room using the analgue output from the board. If anyone has any good references on what I need to read up to do this, let me know!

2 Comments :, , , , , more...

What does…

by on Mar.06, 2009, under Fun, life, linux, ubuntu, webbyness

your workspace look like? Just because I’m interested really, heres the mess that is mine.

My Workspace

My Workspace

I generally use the laptop to show notes and slides I’m working from, and do my work on the desktop.

So what does yours look like?

Leave a Comment : more...

Langland to Oystermouth

by on Mar.01, 2009, under Fun, life, Photography, walking

Today I started the first fact finding mission for my new project. The Mrs and I went for a walk from Langland Bay,long the cliff tops to Mumbles.

This walk was in the end about 3 miles in length. The start was on the route of the number 12 bus from the Quadrant Station in Swansea town center. We got off the bus near Caswell Avenue and walked along the Langland Golf course, avoiding the occasional golf ball and made it down to the bay.

A Panorama of Langland Bay

A Panorama of Langland Bay

This is quite a nice little place for rockpooling at low tide, and the rock formation on the east side of the beach are very interesting to say the least.

We walked across the bay, wandering through the various rockpools and taking a gander around before heading up the cliffs along the footpath. One thing we really didn’t expect to find was a toy fire engine wedged between two rocks. Wonder if it was a native one or was lost at sea.

The path along this cliff top was edged with gorse, some of which had already started to flower, and the views from the top where amazing. Pick a nice day to go this way and the views will literally knock your socks off. This path splits into two half way along, one goes up along the top, and the other skims along the base of the cliffs. We started on the top one, then half way along that dropped down to the bottom one to watch the coast guard doing exercises.

Helicopter Rescue

After this we wandered along the cliff tops to Mumbles, stopping at the cafe near the pier for a mug of hot chocolate and some lunch. Then we pottered along to Verdis for a breathtakingly tasty icecream to munch on while we walked around the Bay to Oystermouth, where we caught the bus back to the bus station.

A nice short walk, with some breathtaking views.

Leave a Comment : more...

Home

by on Feb.22, 2009, under Fun, life, walking

Just had a really nice weekend at home, away from the noisy, horrid traffc. Just the lovely smell of clean air and the sound of the wind, the birds and , on occasion, the church bells.

Did start recording walking tacks today. Went for a short walk up and around Coombe Gibbet, got a lovely picture of the landscape on the way up. Will have to get a wiggle on and build the walking site now. Hopefully get a nice walk around the gower this weekend too.

I’m sat writing this on the train back to Swansea, with my phone on charge through my freeloader. Technology is wonderful!

Back to work when I get back to Swansea. Finish off my report and print it off this evening, and then comment my code ready for it to be submitted for assessment. Hopefully I’ll get my laptop hard drive back relativley soon, but I’m not sure I will after the bizzare packaging standards of Western Digital!

Picture to come later……..

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...