FHEM on the Fritz!Box
Description
This document describes how to install FHEM on the
fritzbox. The document and the port itself is in a very beginning stage.
What works:
- The basic fhem.pl server with at commands, notify, logging (tested)
- FHZ1000 and FHZ1300 (both tested)
- FS20, FHT and KS300-2 (tested)
- HMS (untested, but should work)
What does not work right now:
- Automatic startup after reboot of the fritzbox
- SunSet/SunRise modules (planning a lightweight alternative).
- HTML Frontend. Planning a webfrontend/pgm2 "fhem" module, as do not
know how to start CGI programs from the builtin web browser.
- Gnuplot. No idea how to replace it, perhaps we compile a fritzbox
version
- EM1010PC. I tried it without batteries, and I think the USB interface
cannot power an USB hub, an FHZ1300 and an EM1010PC together. The fritzbox
resets when trying to initialize the devices. More experiments needed.
- WS300PC. Untested, don't have one.
Howto
Tested on the fritzbox 7170, with Firmware 29.04.33.
Note:The kernel modules are for kernel 2.16.13.1, and perl is compiled
for uCLibc 0.9.28.
Prerequisites:
- you need a fritzbox with an USB host port. Check your kernel version.
If it won't match the version above, see the "Compile tips" in this
document.
- an USB hub (a small passive one is enough).
- an FHZ1000 or FHZ1300
- an USB stick, at least 64MB. As the fritzbox is USB 1.1 only,
the slowest is fast enough.
- telnet access for the fritzbox. See the links on how to enable it.
- the complete fhem package from the links section.
Installation:
- Connect the USB stick to a PC, and unpack the content of the
fb_fhem_x.y.tar.gz in the root directory of the USB stick. You'll
get a perl 5.6.2 installation with just those modules wich are needed
by fhem, an empty 32MB swapfile with a swapon/swapoff command,
the fhem server with an empty configuration file, and an rc.fhem
script which should start everything.
- Connect the USB stick and the FHZ1x00 via the USB hub to the
fritzbox.
- Log in via telnet to the fritzbox.
- Change into the directory /var/media/ftp/*Partition*/usr/fhem .
- Execute the command rc.fhem.
- Now you can login from your PC to this fhem server via:
and configure it.
Compile tips
Note: You don't need to compile anything if you have the correct
kernel and uclibc version.
I compiled the ftdi_sio module with the help of the ds26-15.1 packages, see
the links.
The ftdi_sio module had to be modified, as 2.16.13 does not contain the USB
ID's of the ELV devices.
Compiling a working perl for the fritzbox was a nightmare. After compiling
5.8.8 I dicovered it has a strange bug: Appending numbers to strings won't
work on the fritzbox. This is why I compiled an "old" (5.6.2) one, which
seems to work perfectly.
Links