Wiring the house, part 3: Planning the 1-wire sensor network

September 2, 2009 by gsander

When ordering the needed hardware new possibilities came to mind, as they so often do when you are browsing catalogs of companies selling cool gadgets…

The first version of the 1-wire network will look something like this, possibly with some of the sensors furthest away from the server installed at a later time. Some of these sensors are after all pretty expensive (just the humidity sensor, HIH-4000-001, got it from Digikey, that is attached to the DS2438 AD converter cost around €20). Getting the all the cables in place have also turned out to be a bit tricky, the tubing in the walls back in –65 just weren’t made with cat-6 networks, phone lines and 1-wire networks in mind…

SP53 1-wire network

The Linux server will run either temploggerd and owfs (if I can get it to work on the small Bubba Linux server that I am using, so far it compiles ok but doesn’t seem to respond properly to the sensors), or thermd.

I verified thermd runs (it does work as expected but it takes 15-20 seconds or so to update the graphs) on the Bubba server as long as you install the perl runtimes and quite a few Perl packages, but as owfs offers a better client-server approach it would be the preferred solution.

Wiring the house, part 2: Buying 1-wire sensors and accessories

August 25, 2009 by gsander

So, having moved from a flat to a house a couple of months back it was time to do some actual work on a home monitoring system.

First task: to find a good source for the needed 1-wire sensors and other electronics and hardware.
Some digging around, comparing a lot of prices resulted in the matrix below.
I then ended up buying my 1-wire products and components from Homechip and Hobby-boards, with some additional components from Electrokit.

Please note that prices and other aspects of the stores are expected to change, the data below represent a snapshot as of August 2009. They should in any case provide some starting points for your own 1-wire online shopping adventures.

Vendor Country Comment
Homechip UK Good prices and fast, affordable delivery across Europe, they don’t have quite the selection of 1-wire products as for example Hobby-Boards or DigiKey (who are outstanding when it comes to components).
But with Homechip offering the core component I needed while also being European the first batch of 1-wire sensors were bought from them. Might try other providers later.A good thing about Homechip is that they carry the
T-sense (made by IButtonLink) at an affordable price. VERY convenient temperature sensor! Ok, a bit more expensive than buying the components, but oh so convenient..
Low shipping costs also to rest of Europe outside of UK.
Hobby-Boards US Nice store with some assembled and ready-to-go 1-wire sensor modules, such as the 8 channel relay board or the nice little DS2423-based dual counter (Note: Homechip carries a similar counter).A GREAT thing about Hobby-Boards is that they offer both schematics and PCB layout for free on their web! This gives some very good inspiration for those of us who like to build things from scratch but have spent the last fifteen years doing other things than designing electronic circuits.Reasonable prices but longer/more expensive shipping if you are in Europe.

Embedded Data Systems US This company among other things makes the HA7Net, which is an Ethernet equipped 1-wire master controller with some real intelligence in it. It contains a web server, upgradable firmware, various tools for reading/writing/maintaining a 1-wire network. The HA7Net also has three 1-wire ports, making it dead simple to create a star-formed 1-wire network.The HA7Net acts as the 1-wire centre point in my network, it is then read by various other software on the internal TCP/IP network.
Temperatur.nu Sweden temperatur.nu contains both temperatures across Sweden updated by people’s personal computer connected weather stations, as well as an online shop and a good forum for Swedes interested in home and weather monitoring systems. Quite a few good 1-wire related threads in the forums.The store has a fair number of components as well as pre-assembled sensor modules. Prices are a bit high compared to for example Homechip but if you are in Sweden and need fast delivery it may be worth it.
The store also has various home automation products, such as radio controlled 220V switches.
IbuttonLink US Makers of some good 1-wire products, such as the LinkUSB 1-wire interface, which can be used instead of the standard DS9490R from Maxim. They also make the very convenient T-Sense temperature sensor, but as this is available from HomeChip at the same or even better price (given the current USD to EUR exchange rate), I’ve got my T-Sensors from Homechip.
1.wire shop Germany Expensive German online store
Fuchs Shop Germany Expensive German online store
SparkFun US GREAT company with a fantastic amount of cool gadgets and electronics kits in the store, usually with very affordable prices. If you like fiddling around with electronics and microcontrollers you’ll love SparkFun. SparkFun offer free schematics for many of their kits, they also have good tutorials and forums. Great site!
Digikey US
Intl
Giant retailer of electronics components. More than 1900 employees, more than 450.000 products in stock. If you need an electronics component, Digikey is likely to have it, and at a good price. Based in US means longer delivery and higher shipping costs though.
Edit: Turns out Digikey has a great international service as well! For their Swedish customers they even offer free shipping on orders of more than €65, which is pretty easy to reach when looking through their catalog…
Electrokit Sweden Probably Sweden’s best online store for electronics components and Arduino microcontrollers. Good prices, very affordable shipping costs.
Lawicel-shop Sweden Sells various embedded systems products, including Arduino boards. Seem to be more expensive than Electrokit.
Maplin UK Sells all sorts of electronics and components. Might be worth considering for UK people.
Energibutiken Sweden Online store with a small but fairly good selection of products relating to energy monitoring. They among other things have an interesting data logger for those who don’t want to be bothered by running a server for their 1-wire projects.

Syncing Firefox sessions across computer and platforms

August 21, 2009 by gsander

I regularly use 3-4 different computers, from time to time also guest operating systems running in virtual machines. For years I have been thinking it would be great if you could bring your current Firefox status with you to a different computer, for example between a Mac and PC.

After recently actually looking into this topic I found the new Mozilla Weave Firefox extension. It is in beta and have some bugs, but is very promising even in its current state. However, it doesn’t sync sessions.

I recently also started using the nice Dropbox service for file syncing. Dropbox has both Windows and Mac clients and works fully transparently: any file you put in the dedicated Dropbox folder on your local computer is automatically synced to the Dropbox service and from there propagated out to your other computers where you have Dropbox installed and running. As you get 2 GB of free storage that is more than plenty for storing session information.

Only thing missing now is to find where Firefox’ sessions files are stored. As I am using the excellent Session Manager Firefox extension, a quick look in the Advanced tab of its options dialog revealed that you can indeed specify where Session Manager’s session files should be stored. Change this to your local Dropbox folder and you are set! As soon as you save a session in Session Manager it will be almost instantly available on your other computers. To use them on these other computers you use the “Load session…” command in Session Manager’s menu, which in turn is found in Firefox’ Tools menu.

Have been using this setup for some weeks now, works flawlessly.

Wiring the house

August 18, 2009 by gsander

Moving to a house from an apartment made me realize you have new things to consider.

- How much money is spent on heating?

- We have a 45-year old, huge waterboiler in the basement, how much does it cost to keep it running? Would we save money by replacing it with a modern one?

- It is said that return-on-investment on air-air heatpumps is quite short, around 18 months is often mentioned. But before installing such a pump to reduce the need for electrical heating it would be great to have a system in place measuring how much electricity is used for electrical heating before and after the pump is installed, and how much energy the pump itself uses.

- How do you measure the above, collect the data and present it in a good way?

- After installing radio controlled switches across the house, how do you control them in a good way? The included remote works ok, but a computer interface is really what is needed to create more advanced lightning setups.

In the coming posts I’ll sum up the experiences made in planning, building, configuring and running the above services. Having searched the net for information and experiences from others I have found some, but not a whole lot. Hopefully my findings will help others with similar plans and ideas.

iPhone/iPod Touch 1.1.2 hacked – before it is released. Or is it..?

November 9, 2007 by gsander

The title says it all. Before Apple has even started shipping the updated 1.1.2 firmware, it seems some people have been able to unlock (=Jailbreak) it. Kudos to these people, but I just can’t help wondering how long Apple will be able to keep this game running. Eventually they must (??) understand that keeping the platform too locked down is generating significant badwill. And with something like 25% of all iPhones being unlocked, why not just accept the fact that people want to install their own apps?

True, there is an SDK coming that will allow for third party, native apps.
The answer probably lies in the fact that Apple gets a piece of the revenue generated by AT&T and other carriers offering the iPhone. Recent numbers indicate that Apple gets USD 18/month from AT&T for each iPhone user in the US!! With 1+ million iPhones sold in US alone (probably 1.25 by now?), and 200k estimated before end of year in UK, this is big money for Apple. Even if they wanted to open up the platform for third party apps, the operators wouldn’t like that and Apple would loose some significant, low-risk revenue.

Finally: The image showing an unlocked 1.1.2 also shows 14 GB memory – but the iPhone comes in a maximum of 8 GB, to my knowledge. So this may very well be a Photoshop job. Still, it is probably just a matter of days before the real 1.1.2 firmware is hacked.

[Edit: Now that was a very late night post done by a brain which had already called it a day.... as some people correctly pointed out, the image clearly says it is an iPod Touch. Which comes in 16GB version. My mistake - me bad]

iPod Touch = Sysadmin console deluxe

November 8, 2007 by gsander

I just love the iPod Touch. Very, very sexy device. It gets a firmer and firmer grip on me by each passing day…

I realized something neat the other day. After unlocking it at jailbreakme.com I installed various apps, including the BSD subsystem and a VT100 terminal emulator. When traveling out of town during the last few days, I decided to try the new SSH server I had set up at a computer at home, to allow for some remote backups and admin.

And it worked just like expected: After starting the VT100 terminal it was simply a matter of typing “SSH computer.my.domain”, enter the credentials and I was in. Very cool, I could do everything I could do while at my desk at home.

It’s only a matter of time before sys admins and network engineers are running around with shiny iPod Touches as their main work tool while on a service mission… Seriously, could very well work as a compliment for them, especially considering many of the usual, very powerful Linux tools are available.

iPod Touch – first impressions

October 18, 2007 by gsander

Got my iPod Touch a week ago. Ordering it was an impulse decision when I realized it had been released in the US. Rarely have I anticipated a gadget so much… And it pretty much lives up to expectations, at least when it comes to the first impression. I won’t put any pics here, there are plenty of those already on the net.

First, when it comes to box design the guys at Apple have really outdone themselves. The Touch comes in a small, sturdy, compact little matte black box. Very nice. Unpacking and setup is a breeze, I made a point of eying through the manual, just to realize it didn’t really contain any actual usage instructions, only some installation instructions. The user interface is pretty intuitive, but to learn the more advanced commands (like double tapping on the screen to bring the device out of locked state and show the play controls) you have to go Apple’s web site and read the tutorials. A bit silly, but works ok.

16 GByte sounds like a lot compared to the 4 GB in my old Nano, but as soon as you start adding video podcasts or movies those 16 GB disappear quickly. Given that the Touch is so much bigger than the Nano and that miniaturization has advanced since the Nano was designed, wouldn’t 32 GB in the Touch be possible? Maybe it’s coming.

As for other hardware aspects of the Touch, the screen is simply outstanding. Very, very nice. Great colors, contrast and a real hard glass surface makes it a lot less scratch sensitive than the Nano, which almost scratched simply by looking at it. The mirrored back side (same as on earlier iPods) is however just as sensitive as before, and even though I’ve kept my Touch in a cloth bag at all times, it is already scratched. Bummer. Buying a hard/soft case to the Touch at the same time as buying the Touch is highly recommended! Unfortunately, it seems as the case manufacturers haven’t kept up with Apple – you can’t find any Touch cases at all for sale in Sweden. Ok, the Touch hasn’t started selling here yet, but given that there are plently of iPhone cases for sale here (and the iPhone for sure isn’t even close to have launched here yet – any iPhone used in Sweden has to be hacked). As for

Finally, the good, the bad and the ugly:

The good

  • User interface is slick, responsive and simply gorgeous.
  • Cover Flow is awesome!
  • Watching video on the iPod is great, but also requires a totally different kind of attention than for example listening to an audio podcast. It is for example hard to walk to the subway and watch video at the same time – but listening to a podcast at the same time works great.

The bad

  • 16 GB memory is twice as much as 8 GB (which is was the smaller Touch has), but still only half of 32 GB…
  • Stability. On several occasions the Touch has almost hung when watching a video podcast and switching to some other application. There is a Linux system somewhere beneath that shiny surface and it promise a lot of stability and good multitasking, but there obviously are some bugs that need to be fixed.
  • I would really have liked the Touch to be GPS enabled.

The ugly

  • Apple has done it again – crippling the feature set of their products. There is absolutely no reason what so ever why the Touch couldn’t have more of the same application set as the iPhone. The Touch has great WiFi connectivity and a nice web browser – but no email client!
  • Not possible to install third party applications. This is by far my most serious concern about the iPod Touch! Given the form factor and great implementation of a touch interface, the iPod Touch has a fantastic potential beyond just being a portable media player. I would personally love to use it for reading emails, having a client to connect automatically to FON access points, having a ssh client to allow for remote management of Linux boxes, … And imagine a restaurant equipping the staff with iPod Touches, taking the orders in the devices, sending them via WiFi to the kitchen…

The explanation to most of the above concerns is probably that Apple didn’t want the iPhone and iPod Touch to be too close to each other, from a feature point of view. Still, after Apple’s reduction of the iPhone’s price, the price tags aren’t that different. I’d really expect more features in the Touch, given it’s price point. Still, it’s a nice device that replaces my Touch in all occasions except when out running, working out, biking, skiing etc. For those activities the Touch is too big and sensitive, whereas the Nano is perfect.

Update 2007-Oct-18:
Apple has announced they will make an SDK available, to allow for third party native applications to be developed. Most likely some kind of certification similar to Symbian Signed will be needed, to protect against malicious software.

Tweaking Bubba

September 27, 2007 by gsander

I realized the other day that it is only a matter of time before I loose track of what changes have been made to the Bubba’s original configuration. What applications have been installed? What config files are being used? If I ever had to re-install the Bubba, or were to configure a Bubba for someone else, it would take a lot of time to get it going.

Enter this post. Ok, keeping track of all config files may be too ambitious, but it feels like a good idea to at least keep a log of what packages are installed. It will evolve over time, maybe some key config files/data will be included as well. And if it turns out to be a handy resource for other Bubba users – even better.

  1. Slimserver. If you have a Squeezebox media adapter, the Bubba is a fantastic match. Put your mp3s on the Bubba, install Slimserver (which is the server-side companion to the Squeezebox), hook up the Squeezebox to your stereo and you have a very nice, silent, always-on, low-power solution for listening to your mp3s. No more booting of the desktop PC, or having a power-hungry, loud server sitting in a corner somewhere. The guys at Excito has made a complete package available for download, including a Slimserver version that runs ok on the Bubba (the latest Slimserver versions are a bit too demanding for current generation Bubba, so you have to live without some of the latest features. I have never missed anything though, so it’s not a problem). More info here.
  2. Using SMART to monitor health of hard disk. Smartmontools is a very nice little package that monitors the health of your hard disk(s). Fairly small footprint, good feature set. Very flexible scheduling options allow you to do (for example) a basic test on a daily basis, and a more thorough test once a week, month or whatever. Once again, the Excito forums provide good info. More info here and here.

TODO list

With the Bubba having such limited memory and processing power, you really can’t put too many applications on it. So it is a bit of a balance act to decide which ones of the built-in features to enable, and what new packages to install. Below follows the current candidate list of nice-to-haves..

  1. Webmin. Very nice and extensible browser based server management solution. Kind of demanding on system resources, so it is likely to run slowly on Bubba. Also, it is a bit tricky to set up under Apache (by default it comes with its own web server, which in the case of Bubba just eats up precious resources). Some discussions (here and here) on Excito forums indicate it is indeed possible to use Webmin on Bubba.
  2. Some good, lightweight system monitoring server. With the limited process speed and amount of memory in the Bubba, it would be nice to have a way of monitoring system resource usage, and ideally warn by an email when some threshold is passed (too much swapping to disk, for example).
  3. Setting up secure tunneling to allow for access to Bubba (SSH, http, https) from very within very restrictive firewalls. Starting points for more info are found here and here (and many other places). Tinyproxy also seems to be a good, lightweight solution. Remains to be seen if it works on Bubba.
  4. Hardening of SSH. More info here and here (good one).
  5. Backup, backup of backup, and backup of backup of backup. So I am paranoid – I admit it. I want triple backups of my data, with the last backup being physically separated from the first two. My vision is to have the Bubba back up photos, documents and other valuable stuff normally residing on my desktop PC. The decTop then will backup the Bubba (decTop is another small, fan-less system, similar to Bubba). The decTop will then finally replicate its hard drive to some external site, possibly another Bubba placed at some friends house, maybe using this approach. Could also use a service like Mozy, I am however not sure what the backup performance would be like from Europe, and as they don’t have a Linux client it would require the PC to drive the backup.

Using Bubba as media server

September 6, 2007 by gsander

After testing a lot of different media center solutions for the PC, as well as trying to convert an ASUS WL-500g Premium running OpenWRT into a media server, I realized I’d like to listen to some music and watch some movies, and not just try to get the underlying technology working.

So I bought a Bubba. Nice little box, I especially like that there is no fan and that power consumption is low. I have placed in the closet next to the wireless router and modem, so whatever little noise it makes no-one will hear it.

An important reason for choosing the Bubba was the very active and helpful community around it. I have several times been very pleasantly surprised at the speed with which Excito’s (the company behind Bubba) staff reply to questions. A bonus is that it runs pretty much a standard Debian, so there is plenty of software to play around with.

On the negative side… Well it only has 128 MB memory, which is really on the low side if you want to run a LAMP server together with some media streaming software. As I have a Squeezebox connected to the stereo, running Slimserver on the Bubba was high priority. Initial tests weren’t too successful, but the good people at Excito helped out and even put together a full Debian package with Slimserver and other needed software. The web interface to Slimserver is a bit sluggish and indexing of lot’s of mp3s isn’t lightning fast, but it works and does what you expect it to do.

As for media and other features the Bubba comes pre-configured with UPnP and DAAP, a real mail server, print server etc. Good stuff!

To sum things up, I now have a really small, energy efficient, secure, silent backup/file/media server that is running 24/7.

Oh yes, a bonus with the Bubba is that it is quite easy to set it up to automatically back up your PC (or Mac). With a 500 GB drive in the Bubba and using rsync to copy only changed files from the PC to the Bubba, backups are easy and invisible. I had a recent bad experience with some spyware that crippled the PC, and that got me thinking about good backup solutions.

How hard can it be? I can do that… Mounting a ski binding the easy way

March 30, 2007 by gsander

Introduction

The other day my girlfriend bought a new pair of touring skis, to replace the old, borrowed ones that just didn’t quite survive last winter’s week long trip through Lappland:


When winter was approaching a few months ago, and we dug those skis out of the closet, I thought that “hey, there are few things a serious amount of epoxy and proper tools can’t fix”! Turned out to be really tricky to apply just the right pressure on that delaminated tip, no matter how much epoxy was used. It looked really good for a while, then the tip inevitably came apart again. Bummer.

So when there was a 20% sale at the great outdoor store “Playground” here in Stockholm, a pair of really nice Fischer BCX 109 tour found a new owner. Half an hour and some haggling later, we also had a pair of classic telemark style cable bindings. All that remained was then the assembling of it all..

Last winter I went through the same process with my own skis, so I took those experiences and applied them once again. So far my skis have both worked very nicely and not fallen apart, so I think this is pretty safe to do yourself.

First, the tools you need are really quite few:

  • A drill/driver (cordless or not doesn’t matter), with bits suitable for the screws that comes with the binding. My DeWalt cordless drill/driver has been fantastic during the past 6-7 years. It’s starting to sound a bit strange and smell of toasted dirt, but it’s still pretty much doing its job.
  • Some good glue. I use ordinary water based wood-glue, after talking to several experienced people working in ski rental places up in northern Sweden. A lot of people use epoxy when mounting alpine, randonnee and Telemark bindings, and yes – epoxy is really strong, but also a bit messy to work with and smells like poison (probably not good for you!). But if ordinary glue intended for wood works for those rental skis that are totally abused all season, it works for me..
  • A drill suitable for drilling in wood, and with a diameter a bit smaller than the binding screws. I used a 2.5 mm drill.

A matter of religion: where on the ski should the binding be mounted?

When I did my own skis a year ago I spoke to lots of people, checked forums on the web etc to find out if there was any common suggestion about where on the ski the binding should be mounted. Lot’s of opinions about this, but the most common (and logical) one seems to be that the ball of the foot should be above the center of gravity (I call it the “balance point” or “balance line”, lacking a better word for it) of the ski. The reason of using the ball of the foot as a reference is that this is the point where almost all of the pressure from your body weight will be transferred to the ski.

How to mount the binding

Here is how to do it:

Balancing the ski isa bit tricky, but possible The balancing point of the ski found

The dashed line indicates balancing point

  1. Start by finding the balancing point and mark it. In the big picture it is marked as a dashed line. I used the back of a chair to do this.
  2. Place the ski on the floor (use some old newspapers or a carpet so you don’t scratch the floor with the steel edges of the skis!).
  3. Put the boot in the binding, and try to visualize where on the binding the ball of the foot is. If you find this hard you can try to put the boot on, then fasten it in the binding, and finally “feel” where the ball of the foot is, and make couple small marks on each side of the binding, to mark this. Do remember that many (most?) bindings are asymmetrical, and require the left boot in the left binding etc. The “L” on the picture above just tells this is the left ski.
  4. Remove the boot and place the binding on the ski. Those small marks you made on the binding in step 3 should be lined up parallel to the balancing point/line of the ski. This is where people have different opinions – I recommend placing the marks on the binding (i.e. the ball of your foot) ca 2-3 cm behind the balancing line. In my experience this gives a good balance to the ski.
  5. Mark the screw holes of the binding on the ski, look at the small circles on the big picture above and you will understand.
  6. Drill holes for the binding. It is a good idea to place a piece of tape on the drill, to avoid drilling too deep into the ski. The small picture below to the left shows how to determine where on the drill to put the tape.
  7. Drill the holes, fill them with plenty of glue, and fasten the binding tightly. I have a torque control on my cordless driver, very convenient but not necessary. Just pull the screw as hard as you can, more or less. No, you shouldn’t force the screw in so that you break the ski, other than that you really want a firm fit.
  8. Finish off by mounting the heel support pad. The position of it is not in any way critical, and the same techniques as describes above are used.


Voila! Here is the final result, ready for next week’s back country trip!

Edit: A five-day trip later (in some seriously hard weather) the verdict is that the skis worked great and the bindings are still there.