February 2018

Something that shows up in a lot of my projects is my FloatingStatusWindow library. It allows the creation of something akin to a desktop widget that displays simple text and blends in with the Windows desktop. This is what several of them look like in the corner of my secondary monitor:

Each one is a separate project that uses the core library to create and manage the window. The code for a few of these is on GitHub and I’m working to add more.

The windows are locked by default to prevent accidentally moving them but they can be unlocked in order to move or resize them. When moving or resizing the windows will snap to each other and the sides of the screen. This is what the example above looks like unlocked:

Basic appearance settings are built into the library itself along with a dialog to change them:

Each individual project is responsible for the text, the text layout, using a non-default text color, and keeping the text up to date. Some projects will update using a timer while others will wait for some sort of event and update as needed.

I had tried a number of applications that could do custom widgets but none of them quite worked the way I wanted. I read an article about transparent WPF windows and decided to create something myself.

Originally it was implemented as a single application that could load a number of plugins but that ended up being a bit of a pain – when working on a new window I had to close and restart everything and if a plugin crashed it’d take down all of the rest. I decided to convert it into a library that could detect other instances of the window so they worked together but were implemented as separate binaries.

There will be more about the library later when I write about the various applications that use it.

One of the oldest projects I’m still working on today is my weather station. I had always wanted a weather station but it seemed boring to just install something on the roof, stick an LCD display on the wall somewhere, and then forget about it – I wanted something I could build, expand on, and write my own software for.

At some point I ran across a weather station from AAG Electronica – it was relatively cheap, had a bunch of sensors, and ran on the Dallas Semiconductor (now Maxim Integrated) 1-Wire network. It was pretty much everything that I was looking for so I bought one, mounted it on the chimney, and set about writing an application for it.

At the time I was starting to learn C# and decided this would make a perfect learning project. There were a few examples for using the 1-Wire hardware (mostly in Java from what I remember) but I was able to access the driver functions from C# and started to get things working. At the lowest level there was a lot of bit manipulation but once that was going I was able to start building the application up from there.

The code and application has changed quite a bit over the years. Originally it was split into two libraries – one for the 1-Wire network and one for weather devices like temperature and pressure – and a WinForms application that displayed the current readings and graphs of the last 24 hours of readings.

Eventually I wanted to view the readings remotely so the application was refactored into a service that ran on the server with the hardware connection and a viewer that could run anywhere. It used .NET remoting (the recommended technique at the time) to connect the two pieces. This worked okay for a while and I created a few different applications to view the data – more about them in later posts.

Later when I got a smartphone it made sense to create something that would let me view things from my phone. I started down the path of creating an Android application but then decided that it’d be better to create a web application that could be used everywhere. I added a SignalR interface to the service and created a basic AngularJS 1.x web application as the viewer.

The AngularJS 1.x application worked well for a while but started to show its age so I decided to re-write it with Vue.js and that’s where things are now. The new web application also integrates with some of my more recent projects like the laundry monitor that I’ll write more about soon.

At this point the WeatherService project is responsible for reading the sensors, writing the readings to the database, and providing historical data for charting. It still uses my original OneWireAPI library to access the 1-Wire network.

Unfortunately AAG seems to have gone out of business so it is probably impossible to create the same setup or for me to get replacement parts. I’ve been looking at some off-the-shelf weather stations that I can read in a similar way but I haven’t found anything I like so far. I’ll probably be forced to find something soon since I’m starting to have some problems that look like hardware issues.

Being a programmer at heart it seems appropriate to stick with the classic “hello world” for starting off!

I’ve been programming in one way or another since my dad bought a TRS-80 Model I many years ago. My first real project was a BASIC program that would convert text to pig Latin and it all took off from there. Now that I think about it there’s even a chance that I still have that original code – I should go look for it!

Recently I was adding a new project to my Bitbucket account and realized I had a lot of code in there that might be useful for other people and it was a shame to keep it locked up. I had been hording it as if it was something secret but it really didn’t need to be. I decided that I would made as much as possible public on GitHub and write a little bit about each project. Some of it is certainly a bit crusty but there’s a chance some of it might be useful. I’ve only managed to move a little so far so expect more to show up as I make progress.

We also have a small collection of critters (hermit crabs, African clawed frogs, a bunch of freshwater tropical fish, two cats, and a dog) and are planning to add some new ones (axolotls and White’s tree frogs) in the near future – so plan on seeing some posts about them as well.