Matt Daubneys Blog

Author Archive

Training vs Teaching

by on Dec.11, 2010, under learning, life, programming, ubuntu

Today I’ve been mostly teaching myself the oddities of C++. Now C++ is an object orientated language that’s an extension of C. This has led me to a revalation.

Recently at work I’ve been doing masses of OO stuff (as a change from the previous stuff I was writing which was largely linear) and as a result of that I’ve started seeing the world in terms of objects. Now in order to achieve what I needed at work, I ended up reading up on the theory of objects and what they actually are. In times past when I’ve been “taught” how to program (rather than teaching myself) , the content of the classes where more designed for a specific language on how to solve a specific problem. I think I only once sat in a computing based lecture that talked about the more abstract issues in programming. Whenever I start designing a program I always go back to that single lecture, and a few books that have a higher level stance on problems (such as Design Patterns)  and then once I’m passed that do I go to the language specific things.

The reason I digress this far is that after learning all this meta-stuff, learning another language is actually relatively easy. Now everything is falling down to syntax rather than subject. Going back to the title, I think that those lectures that taught me to do this in this language because it does that has got things backwards. They were doing the training first in the hope it would teach you something. What they should be doing is teaching you the concepts (all the “meta”) and the train you in the language.

Teach and then train, not train and then teach. Something I shall have to try and follow more often in the future.

(Many thanks to Alan Bell for the inspiration in the title :) )

1 Comment :, , , more...

Arduino powered lights and heating!

by on Nov.07, 2010, under arduino, learning, ubuntu, Uncategorized

Over the past few weeks as it gets colder, I’ve really started to notice the significant bite in heating costs from our flat being largely electrically heated. The main issue with this system is that none of the heaters have thermostats, they are either on, or off. As each heater is 2kW or greater, and there are 4 of them in the flat, that means at any one time we could be using 8kWh of electricity. Which is a lot of money during the day!

The solution? Build a thermostat for them (and replace 2 with a gas convection heater). The circuit for this is quite simple thanks to the fantastic home easy set of sockets. I bought a pack of three sockets (with a remote) and a light bulb holder (we’ll come back to that later). On top of this I needed a temperature sensor (tmp36), a 433MHz transmitter , a 433MHz reciever and an arduino uno.

Thanks to the lovely folks at the Home Easy Hacking Wiki getting this lot to work together with an arduino is easy as anything! Here is the basic circuit:

Home Easy Transmitter DiagramThis is only the transmitter/temperature sensor part. Initially you’ll need to build a receiver to get the ID of your remote. This can be found at this page in the arduino playground. Once you have your remotes ID, you just need a simple arduino sketch to turn the socket thats plugged into the heater on/off! Here it is….

HomeEasy homeEasy;
boolean isOn;
int incomingByte = 0;	// for incoming serial data
float timeOn=-900000;
int myCode = 1595082;  
 
void setup()
{
       Serial.begin(9600);
       homeEasy = HomeEasy();
       homeEasy.init();
       isOn = false; // 1 = On, 0 = Off
}
 
void loop()
{
  float temp = getTemp(0);
  Serial.println(temp);
  if (Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();
    // say what you got:
    if (incomingByte == 111){
      //turn on the group
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true );
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true );
    }
    else if (incomingByte == 102){
      // turn off the group
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true );
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true );
    }
  }
  if (temp < 18.0 && isOn == false && millis()-timeOn > 300000 ) {
     //turn on the heaters
     homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false );
     homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false );
     isOn = true;
     timeOn = millis();
  }
  else if (temp > 18.0 && isOn == true && millis()-timeOn > 300000 ) {
    homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false );
    homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false );
    isOn = false;
    timeOn = millis();
  }
}
 
/*
* getVoltage() – returns the voltage on the analog input defined by
* pin
*/
float getTemp(int pin){
return (((analogRead(pin) * .004882814)-0.5)*100.0); //converting from a 0 to 1023 digital range
                                        // to 0 to 5 volts (each 1 reading equals ~ 5 millivolts
}

This code ensures that there is no change in status for at least 5 minutes, basically so the socket doesn’t go continuously on/off and damage something! There is also a hook for a serial input to turn on the “group” of the remote. This is to turn on the light in my bedroom. I’m in the process of writing two simple bits of python to turn a light on/of depending which is run. This means I can set up a cron to turn on a light at a given time! Simple alarm clock :)

To get this code to work you’ll need the homeeasy library from here. You may need to alter the pin allocation in homeeasy.cpp, but that shouldn’t be too hard to do!

Next thing to do on this project is to get my Revo setup as a little wireless server box to graph the temperature changes and run the alarm clock. Conveniently it’s being replaced with a mac mini this week so has become available to complete the project. This will be a simple ubuntu box, running ubuntu server and little else really. Thought it may gain an ldap database for another, slightly different project.

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

Ubuntu UK Support

by on Aug.07, 2010, under ubuntu, Uncategorized

OK Ladies and Gents, having been away for a little bit for various reasons, it’s time to get the support ball rolling. First things First, a date for your diaries.

On the 26th of August I’m organising a meeting to formally create the group from those interested parties and to set out some priorities. Initially we need to focus on some given areas where people ask for support. Once we have one or two of these running we can then branch out into other areas and help improve things where necessary.

I’ll stick a formal agenda on the UK Wiki, but if people want to start thinking about the following things it would be appreciated.

  • How to report (issues/progress/problems fixed) for statistical purposes
  • Initial Targets (UK Section of the Forums/IRC/Stack Exchange/Mailing Lists?)
  • Blogging problems and resolutions
  • Training
    • How
    • Where
    • What to train on (problem solving techniques/diagnosis howto/?)
    • What materials do the training team have for this
    • Mentoring?
  • How to put people in contact with the correct person to solve their issue

This is not a comprehensive list of the issues we’ll need to cover, but gives a good starting point to mull over. If you want to do a mini implimentation of something yourself, have a go and let us know how it goes at the meeting.

If people want to get hold of me individually to go through any issues, you can get me in jabber (daubers at REMOVE THIS jabber dot org) or on irc.freenode.net in #ubuntu-uk (nick of daubers) or by email on (matt at REMOVE THIS TOO daubers dot co dot uk)

Leave a Comment :, , more...

Community Roulette

by on Jul.17, 2010, under ubuntu

Alan Bell of The Open Learning Centre has set up an Ubuntu-UK Community Member Profile Roulette . This stemmed from the Ubuntu Irish Teams Profile of the Day, which is part of a masters project by a Dublin student to get people within the Irish community to get to know each other better. Both of these projects are fantastic ideas, and will hopefully help get more people to create Lanchpad profiles and wiki pages!

Oh, also, todays entry of the profile roulette was me!

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

What Drives You to Support Others

by on May.25, 2010, under ubuntu

If anyone doesn’t already know, I’m on a push to see if community support can be improved. When I gave a talk at Oggcamp on this, someone suggested that the solution might become more apparent if I could understand what drove people to help support others.

I’ve sat and thought about this for a couple of weeks now, and as I sit here with a mug of tea mulling this over a bit more I think this is actually a very hard question to answer. I think it boils down to the following.

I help other people because I dislike feeling useless, and the people I look up to in the community helped me feel less useless by providing that support when I was learning.

I have a terrible habit of projecting my own feelings onto others. If I feel useless about something, then without thinking, I believe that other people would feel the same way. Due to the way I felt in that position, and how I that was solved. It seems fair to me that I do the same for others as others had done for me.

Now, that is my view, what I really need to know is why other people support new users. What is it that drives you and what could be done to help encourage people to improve the way in which they support others.

Please, please let me know. The more data I can collect, the better the solution I hope I can present back to the community to help improve things.

Leave a Comment :, , more...

Improving Community Support

by on Apr.10, 2010, under ubuntu

For a little while now I’ve noticed that the community based support for Ubuntu is a little patchy. Admittedly, this is largely in reference to IRC, but I think there are some simple things that could be done to improve this situation. In consultation with the Ubuntu-UK Loco and a few other groups, an etherpad session was started and some discussion has gone on around that. What has come from this exercise is a general set of guidelines for supporting new users. At the last Loco meeting I was actioned to create this into a wiki page to see if some more discussion can be formed, and then a vote will be taken at the next meeting to see if the Loco should adopt them.

Now, to me these seem fairly sensible guidelines, but what would be better is if people took just a few minutes to read over them and comment on whether or not they think they are feasible. The more eyeballs that see this document, the better it can be and the more consistent support we can offer new users. Having something like this would also help set users expectations of community support, which should help us to get users expecting an instant solution from volunteers.

So, please just spend a few minutes looking these over and let me know what you think.

Leave a Comment :, , , more...

Acer Aspire Revo R3600 and Mythbuntu

by on Feb.27, 2010, under linux, ubuntu

Having had MythTV running on a monitor for a little while, complete with it’s scheduling fantasticness, I finally caved to getting a machine to play it out to the big TV. An obvious candidate for this was the, very affordable, Acer Aspire Revo.

The spec of the machine itself is not that impressive when compared to modern desktops, a 1.6GHz single core Intel Atom, a lonely GB of RAM, a 1Gb LAN connection, an atheros 802.11n wireless chipset and no real expansion capabilities. The saving grace of all this is he Nvidia ION chipset inside the box. Using a media player that can utilise libvdpau this means that using the onboard hdmi port it can play HD video quite happily at 1080p \o/

The machine I purchased supposedly came with Linux pre-installed, but when I first switched it on all it did was through a screen full of “99″‘s . This didn’t bother me overmuch as I’d already intended to stick Mythbuntu on it. Sticking Mythbuntu on a bootable USB stick and then installing it took about an hour in total using the fast connection in my office. Once installed, I plugged it into my TV at home, booted it up and …. nothing. It just didn’t appear on the TV. A little reading around the interwebs and it appears that the HDMI connection is not discovered unless the TV is switched on before the machine is booted. So switch on the telle, stick it on the correct channel, reboot and it just works!

After connecting it to the wireless network and letting the mythtv frontend find the already running backend. Turns out the onboard wireless doesn’t play nice with my existing router. While playing back SD stuff was fine, there just wasn’t the bandwidth stable enough to stream HD stuff across the network. A little research and a touch of thought later, I had my hands on 2 Devolo 200Mbps ethernet over powerline adapters. These have allowed me to watch HD content I can get from the BBC iPlayer on the big TV!

How cool is that \o/

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

Arduino and Easy Radios

by on Feb.04, 2010, under arduino, EasyRadio, programming, ubuntu

A few days ago I received a pair of Easy Radios to help with a project I’m working on. Since I’ve never used these before (having only got my first arduino a couple of weeks ago) I had a dig on the net for information on how to use them. Since this information was quite sparse, I thought I’d put up my experimental rig to show it working. This setup requires 2 arduinos, an easy radio transmitter and an easy radio receiver.  First, the transmitter layout.

Transmitter Layout

Transmitter Layout

Now the receiver layout.

Receiver Layout

Receiver Layout

and finally the code.

#reciever code

1
2
3
4
5
6
7
8
void setup() {
    Serial.begin(19200);
}
void loop() {
    if (Serial.available()){
        Serial.print(Serial.read(), BYTE);
    }
}
1
2
3
4
5
6
7
8
9
#transmitter code
void setup() {
    Serial.begin(19200);
}
 
void loop() {
    Serial.write("Hello\n");
    delay(1000);
}

This should result in the receiver outputting “Hello” over and over across the USB serial in the arduino environments serial monitor. If you have any problems, feel free to give me a shout! Oh, make sure you unplug the easy radio receiver from the arduino before flashing it, it’ll throw nasty errors otherwise. (Simply unplug digital 0 pin on the arduino board)

1 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...

Packard Bell Easynote TJ65

by on Jan.16, 2010, under linux, ubuntu

A couple of weeks ago now I bought myself a new laptop. My poor Dell had been battered too much and was finally giving in to it’s poor treatment. Dead pixels, missing keys, noisy fans, it just had to be put out of it’s misery. So now I have a shiny new Packard Bell.

I’d actually been in the market for a Thinkpad, based on their reputation of being practically indestructible. I soon chaged my mind after being promised deliveries that never arrived by a few online retailers. I ended up going to PC World, pretty much ignoring the sales staff and wandering around with my Pre checking compatibility and pricing on the interwebs. I’ve been a bit skeptical of the build quality of Packard Bell for a little while, but this seems quite a solid machine. Time will tell whether it remains that way or so I must admit, but one can hope!

Spec wise, the machine is a 2.2GHz Core2Duo (T6600), it comes with 4GB of RAM, a 320GB HDD and an nvidia Geforce G210M card with 512MB of dedicated graphics memory. It’s got a broadcom wireless chipset (b/g/n) and a gigabit ethernet port. All of this works out of the box with Ubuntu bar one. The driver for the NVIDIA card has a nasty bug. It doesn’t seem to detect the EDID information correctly for the monitor, so some hackery is required in the xorg.conf to prevent you getting 6 miniscreens instead of 1, or for getting a horribly fuzzy screen. Nvidia has recognised this bug, so hopefully it’ll get fixed soon. The open source nv driver doesn’t have this bug, but you lose a lot of the shiny 3d effects and so on, which is a bit of a downside.

The webcam in he lid also works out of the box.

All in all, it seems quite an able machine, but time will tell if I made the right decision or not!

2 Comments :, , , , , 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...