Project Idea: Dorm automation using an IRC network

I happen to have a lot of hackable wireless and networking equipment in my room at the moment: My desktop (of course), my phone, an unused wireless router, an arduino with an ethernet shield, a raspberry pi, Cerebot PIC trainer board with an ethernet port, and three laptops, in various states of repair.

I’ve been thinking about automating various aspects of my dorm. There are a bunch of related items in my room that I think could benefit by controlling each other:

  • Electric kettle
  • Lamps/overhead lights
  • Door lock
  • Window blinds
  • Alarm clock
  • stereo
  • smartphone

Having written an IRC bot for ECE2524, I’m now aware of how easy it would be to connect all of these things using nothing but an IRC network, with servers on the RPi and my desktop computer. I may need to start connecting things together in new and interesting ways :D

Linuxifying my PC ‘scope, Part 2: Beginning

Today I started the process of creating a third-party driver for my USB oscilloscope, the Velleman PCSGU250. I began reading up on Linux device drivers in general (in Linux Device Drivers, 3rd Edition). It doesn’t seem all that difficult, to be honest. Of course, I’m only on chapter two, so we’ll see.

More importantly for this project, I figured out a method of actually determining what data gets sent to and from the oscilloscope during normal operation. At first, I thought the simplest thing would be to reboot into Windows and find some USB introspection tools that work in Windows. So I did that, but I couldn’t actually find anything that seemed to work for examining USB packets. Did a bit of research, and found that it’s actually easier to sniff Windows USB packets in Linux than in Windows.

It’s pretty simple to set up. I have Windows running inside a KVM instance (I assume VirtualBox would work, too), with the USB device forwarded to the virtualized machine. It’s then possible to use what’s known as the “usbmon” kernel module to monitor the USB traffic on the port.

"But that’s a bit gross to wade through using the standard interfaces, isn’t it?" you ask. Yes, it is. But never fear! Turns out, libpcap, everyone’s favorite network packet analysis library, also supports USB packets! And as we all know, libpcap has an extremely user-friendly frontend known as Wireshark!

So here is a screenshot of my current setup:

You can download a couple of the captures I created, and read a little more about the project, here.

I hope that, over this break, I’ll be able to actually get a driver written for this device. By doing this I expect to learn how to actually write Linux device drivers, and hopefully also save myself some money when I would otherwise need to buy a new DSO or a better PC scope that would work with Linux.

List of Projects Past

I wanted to generate a list of Unix projects from last semester to provide a reference for what has been done before. The first complete list I found was in the forum of last semester’s Scholar site. There wasn’t a “download” option, and given the formatting I predicted that I’d spend more time writing a program to parse the raw HTML file and properly match up titles to urls than I’d save by just doing an old fashioned copy and paste operation for the 19 projects. So that’s what I did, and ended up with a file one title/url per line formatted like this:

Snake Game https://github.com/ccwertz7/2524snake
Go, Dog, Go https://github.com/rokthewok/ECE2524-Final-Project
...

Just white space separating the title and the url. I wanted to generate a nicely formatted list of links to each project and also filter out any urls that were no longer valid, so I wrote a short python script that read in lines of test, split them at the ‘http’ of a possible url treating everythign to the left of the split as the title and then used the urllib module to check for a 200 status before printing out a markdown formated line:

[Snake Game](https://github.com/ccwertz7/2524snake)
[Go, Dog, Go](https://github.com/rokthewok/ECE2524-Final-Project)

I have uploaded the source for this program to the examples directory in my ece2524 repository on github.  After checking the output of my program I decided that I’d like to create a bulleted list by preceding each line with a ‘- ‘ (this is standard Markdown syntax).  Rather than change my python script, which is already on the verge of being too specific to be useful for much else, I just piped the output through a simple sed command to tack on the dash:

url_200filter.py < Spring2012ProjectList.txt \
    | sed -r 's/^(.*)$/- \1/g' \
    | markdown > Spring2012ProjectList.html

To generate the HTML code that I then pasted here:

While you are thinking about project ideas keep in mind that the goal of the project is to apply and demonstrate understanding of the Unix design philosophy.  A project doesn’t need to be terribly complex to show this, but if you have a complex idea that you would really like to explore it may be sufficient to just implement a piece of it for this project.  I look forward to hearing about your ideas and discussing some details next week!