I’m running all Windows machines at home (Server 2012, Windows 10 desktops/laptops and a couple of Windows 10 tablets), so I wanted to see how I could install FHEM on my Windows 2012 R2 server at home. Since this server is running just fine, I didn’t want to go experimenting on it. As a first step into installing FHEM on Windows server, I’m going to install it on Windows 10. Yes, I could try to install it on Windows Server 2012 in a VMware workstation, but something is telling me I’ll run into a lot of problems with the USB virtualisation layer.
As I’ve mentioned in other pages, FHEM has a LOT of documentation, unfortunately most of it is in German. I’m writing this documents to help people who, like me, aren’t native german speakers. I myself speak Dutch, but thought I’d help a bigger audience if I write these pages in English.
As my main resource for installation I use the Wiki page of FHEM, Windows – FHEM installieren.
The FHEM Wiki starts with the purchase and installation of a 868Mhz CUL (CC1101 – USB – Lite module), which is used for communication with several 433 and 868 Mhz systems. Since I’m building my own DIY CUL, which isn’t ready yet, I’m skipping this fase for now.
Apparently FHEM is build in Perl. The Wiki gives you 2 options, ActivePerl for ActiveState and Strawberry Perl. Since ActivePerl is mentioned as a first example, I started installing this, just to see if it will work in Windows 10.
First of all download the 32bit/x86 MSI installer (64bit version is sometimes giving some issues with FHEM) at ActiveState. The version I installed is 184.108.40.2061. Start the downloaded .msi.
If you agree with the License then select I accept and click Next
Leave all these option, unless you have limited space, in which case you could remove Documentation and Examples or just buy a bigger disc 😉
If you don’t like a messy root of you disc, select another installation target.
Leave these settings and click Next.
Are you sure? If so click Install.
Now we wait.
The installer has now finished installing Perl and we can testdrive. Open a command prompt and execute “perl -v” to show the version of the installed Perl.
Congratualations. Perl is working.
Because FHEM has to communicate with some sort of device to control your home automation, we have to install a serial communication library. This library isn’t a standard part of Perl and can be installed by executing: ppm install Win32-SerialPort
Now we have a way to communicate with USB and other serial devices.
Because the installation of ActivePerl went just fine, and there apparently are some bugs in the Strawberry Perl installation package, I decided to skip testing the latter. Also when you google for which of the two is actually best, the majority of articles say to use ActivePerl.
Now that we have a functioning Perl interpreter we can “install” FHEM. The installation is mostly just unpacking the download, which can be found here. Download the .tar.gz file to your computer. Extract the downloaded file to a folder named C:\FHEM\ using your favorite unpacker (7-zip will do just fine, I myself use Ghisler’s amazing Total Commander). It’s not really Windows-like to make folders in the root of a disc, but for testing it’s more convenient is my opinion.
Now FHEM is ready to be started. First we will test with a manual startup.
- Open a command prompt
- Go to the directory where FHEM is installed, in my cas C:\FHEM\
- Start FHEM by executing perl fhem.pl fhem.cfg
When a Windows Security Alert pops-up, check if it’s the Perl Command Line Interpreter, if so select both networks (Private and Public) and press Allow Access.
FHEM should now be running, to make sure open your favorite Internet Browser and enter the url http://localhost:8083/fhem
Congratulations. FHEM is up and running.