In a previous post I covered a binary installation of HouseMon 0.9.x on Linux. In this post we will do a similar installation, but for Microsoft Windows.
I will be installing on Windows 7 64bit (Actually inside a Virtual Machine) but the instructions ‘should’ be valid for a standard windows 7+ installation.
linux installation used some basic installation tools that were available on the command line. I have tried to keep this approach in Windows, but Windows does not have such a rich command shell and support tools (I ended up using powershell – but not for the reasons you think!!), so we need a little help with some external tools.
Additionally the linux install did not even touch a GUI, but windows installs are often built ONLY with a GUI shell in mind.
UPDATE: So…I got half way through this post, and noticed that WordPress strips out MSDOS back-slash from my paths, and frankly I just dont have time for issues like that. Rather than take on that fight now, and to keep paths relevant to all o/s’s I will be running these examples within POWERSHELL rather than the standard CMD prompt. POWERSHELL is part of Win 7+ and DOES support forward slashes in a more unix friendly manner. If you see a path with forward slash, things like the PATH variable below – it’s meant to be a back-slash, all other cases a fwd-slash will be fine.
We install this because we use
wget on linux, and this tool evens the playing field a little.
(Ironically, you will need to download this, and that probably means using your web browser……)
I pulled mine from here (I used 1.11.4-1): http://gnuwin32.sourceforge.net/packages/wget.htm
Note: As I moved to Powershell, I could have used that for url downloads, but lets stick with what I had already written.
(It is preferable to use the full setup installation, unless you know what your doing).
Once downloaded, double-click on the installation and follow instructions, (accept agreement, select and make note of installation folder).
wget to your PATH so you can call it from any console.
(Menu->rightclick on ‘Computer’, choose properties, then ‘Advanced System Settings’, then ‘Environment Variables…’ button in lower left).
Here is an example of a PATH variable on my Windows 7 x64 Virtual Machine I test this on:
(Yours may well be different, make sure you have a semicolon in front (;) and after you add your gnu path bits)
;c:/program files (x86)/gnuwin32/bin;
(You can see above I added the ‘bin’ folder which is where my
wget is installed.)
NOTE: You should use BACKSLASHES in the above path, not unix FWDSLASHES – WordPress makes it problematic to display them thats only reason why I used fwd-slash!!.
Save and exit the dialogs. Existing command shells will not pick up the change, so start a new one to test.
Open a command prompt to check wget is working:
> wget -V SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc syswgetrc = c:\program files (x86)\gnuwin32/etc/wgetrc GNU Wget 1.11.4 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Hrvoje Niksic . Currently maintained by Micah Cowan .
All looks good!
Install an unzip tool
(I will use 7zip commandline as it makes tutorials similar to linux, you can use winzip or winrars unzip command line tools also – adapt as needed)
7zip command line can be downloaded from here: http://downloads.sourceforge.net/sevenzip/7za920.zip
Ironic (again), but you must unzip the unzipper (use windows explorer).
Rename '7za.exe' to 'unzip.exe'
Copy the resulting unzip.exe and associated files from the unzipped folder to your c:/windows folder or where ever is suitable that is in your PATH.
Open a command prompt to check 7za(unzip) is working:
> unzip -? 7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Usage: 7za [...] [...]  ....
OK, we can now properly begin.
A Simple Binary Installation
We are going to do the following:
* Grab the latest Housemon + support files and install them beneath your home folder.
* Grab an appropriate binary file for your platform and install it in Housemon.
* run Housemon
This will mean you should not have to
build anything and it should work out of the box.
Open a command prompt, and change to your home folder, and switch into powershell:
> cd /D %userprofile% > powershell
At this point you will have a
PS before your prompt to tell you’re in Powershell
Backup any master.zip that may be present
PS > PS > # dont worry about missing file PS > move master.zip master.zip.bak -EA SilentlyContinue
Next we fetch the latest
housemon files from github. We dont need the source code, just the website and config files but we will keep it all together for simplicity’s sake. We installed
wget above, so we will use that.
PS > wget --no-check-certificate --content-disposition https://github.com/jcw/housemon/archive/master.zip
Now we will unzip, creating a
housemon-master folder. We use the renamed
7za (use other unzippers if you have it readily available).
PS > unzip x housemon-master.zip
We will create a specific Housemon folder, and copy files into it, we could rename the
housemon-master we just created, but its good as a backup source.
PS > mkdir housemon PS > copy-item housemon-master/* housemon/ -force -recurse
Remove the housemon
PS > del housemon-master.zip
Get the associated
PS > wget --no-check-certificate --content-disposition https://github.com/jcw/jeebus/archive/master.zip
Unzip to create a
PS > unzip x jeebus-master.zip
Again, will create a specific
Jeebus folder, and copy files into it, we could rename the
jeebus-master we just created, but its good as a backup source.
PS > mkdir jeebus PS > copy-item jeebus-master/* jeebus/ -force -recurse -verbose
We can now remove the jeebus zip file:
PS > del jeebus-master.zip
Lastly we will download the appropriate ready built binary for our os/platform. These instructions are for a windows 64bit intel o/s, so we will
be downloading the windows_amd64 binary. Use the appropriate link for your platform:
I’ll be providing these binary (tutorial) builds via bintray.com:
PS > wget --no-check-certificate --content-disposition http://dl.bintray.com/thedistractor/HouseMon/windows_amd64/housemon-chocolate
- Linux (Intel 32bit) (Mint16, Ubuntu 13.04 etc)
- Linux (Intel 64bit) (Mint16, Ubuntu 13.04 etc)
- Linux Arm (Raspberry Pi, BeagleBone Black, APC)
- Mac OSX (32bit)
- Mac OSX (64bit)
- Windows (32bit)
- Windows (64bit)
Finally, we remove any existing binary and rename the file we just downloaded and put it into our newly created housemon folder:
PS > del housemon/housemon.exe -EA SilentlyContinue PS > move housemon-*.exe housemon/housemon.exe
Note: A default housemon installation will only bind to
localhost, so if your on a headless device (without a GUI), you will not be able to access the housemon http interface remotely. To resolve this create a
config.txt in the
housemon folder as follows:
PS > echo "HTTP_PORT = 0.0.0.0:5561" | set-content housemon/config.txt
Now change into the housemon folder:
PS > cd housemon
Finally, we need to make a small adjustment to the default setup.json for windows users. I have made this change on my vanilla repo, and so we can pull the file(s) down from there (changed mqtt port from :1883 to 127.0.0.1:1833):
PS >del setup.coffee PS >del setup.json PS >wget --no-check-certificate https://raw.githubusercontent.com/TheDistractor/housemon/master/setup.coffee PS >wget --no-check-certificate https://raw.githubusercontent.com/TheDistractor/housemon/master/setup.json
Now we can run housemon:
PS > ./housemon.exe
You will now be able to access your device remotely using the url
NB:If you want to tell what version you are using, use
PS > ./housemon.exe -h
You should see something like:
HouseMon (0.9.1-jcw.chocolate+b001) + JeeBus (0.9.0) + Flow (0.4.0) 2014-05-16T20:31:08+01:00
In this default configuration, housemon will simply replay a
sample file, collect and process this data and present the information within the ‘readings’ page on the web interface.
I have started to create tutorials to help you construct your own circuits, you can find them here
In a future post, I’ll show you how to start housemon at windows bootup (as a service) so that it can be left running all the time, but first you’ll want to know how to modify housemon configurations – thats what the current set of tutorials are about.
NB: If you find any errors or simplifications (to make all the installation tutorials similar) please let me know.
PPS: I’ll be providing a Mac OS/X installation post shortly – along the same lines as the linux one.
Here is the full powershell script (with some bits commented out – tweak as needed):
installhm.ps1 – housemon-chocolate installer
cd $env:userprofile move master.zip master.zip.bak -EA SilentlyContinue wget --no-check-certificate --content-disposition https://github.com/jcw/housemon/archive/master.zip unzip x housemon-master.zip mkdir housemon copy-item housemon-master/* housemon/ -force -recurse del housemon-master.zip wget --no-check-certificate --content-disposition https://github.com/jcw/jeebus/archive/master.zip unzip x jeebus-master.zip mkdir jeebus copy-item jeebus-master/* jeebus/ -force -recurse del jeebus-master.zip wget --content-disposition http://dl.bintray.com/thedistractor/HouseMon/windows_amd64/housemon-chocolate del housemon/housemon.exe -EA SilentlyContinue move housemon-*.exe housemon/housemon.exe echo "HTTP_PORT = 0.0.0.0:5561" | set-content housemon/config.txt cd housemon del setup.coffee del setup.json wget --no-check-certificate https://raw.githubusercontent.com/TheDistractor/housemon/master/setup.coffee wget --no-check-certificate https://raw.githubusercontent.com/TheDistractor/housemon/master/setup.json ./housemon.exe