From 3fe669af1e961662e9d5e0bdcd709134bbf01690 Mon Sep 17 00:00:00 2001 From: pest <> Date: Sun, 11 Feb 2007 22:37:31 +0000 Subject: [PATCH] pest: - Added doc/linux.html (multiple USDB devices, udev links) - Linked fhem.html and commandref.html to linux.html git-svn-id: https://svn.fhem.de/fhem/trunk@12 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/HISTORY | 4 ++ fhem/docs/commandref.html | 3 +- fhem/docs/fhem.html | 1 + fhem/docs/linux.html | 110 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 fhem/docs/linux.html diff --git a/fhem/CHANGED b/fhem/CHANGED index eab703268..02d8b6a3c 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -306,3 +306,4 @@ - feature: defattr (default attribute for following defines) - feature: added em1010.pl to the contrib directory - TODO: bugfix: more thorough serial line initialization + - doc: added linux.html (multiple devices, udev-links) diff --git a/fhem/HISTORY b/fhem/HISTORY index 27f7b6390..e61e8a933 100644 --- a/fhem/HISTORY +++ b/fhem/HISTORY @@ -10,3 +10,7 @@ of devices. - em1010.pl added to the contrib directory. It seems that we are able to read out the EM1010PC. Not verified with multiple devices. + +- Pest, Thu Feb 11 23:35 MET 2007 + - Added doc/linux.html (multiple USDB devices, udev links) + - Linked fhem.html and commandref.html to linux.html diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index 97448bc1f..ab7d8274e 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -314,7 +314,8 @@ split in multiple lines

from a FS20 repeater. In fact we are not sure that they are repeater messages, we just ignore messages which were sent out by our device for the next 3 seconds (or configured otherwise by filtertimeout). - +
+ For GNU/Linux you may want to read our hints for GNU/Linux about multiple USB devices.
diff --git a/fhem/docs/fhem.html b/fhem/docs/fhem.html index ea64c8f97..8881fa2a6 100644 --- a/fhem/docs/fhem.html +++ b/fhem/docs/fhem.html @@ -82,6 +82,7 @@ description and faq.html for the F.A.Q. If in doubt, look at the id of the device with lsusb. For older kernels apply the patch from the doc directory to your kernel.
Recompile your kernel and reboot or load/reload the ftdi_sio module. +
See also our hints for GNU/Linux.

Perl modules

diff --git a/fhem/docs/linux.html b/fhem/docs/linux.html new file mode 100644 index 000000000..ee9e2d632 --- /dev/null +++ b/fhem/docs/linux.html @@ -0,0 +1,110 @@ + + + + + + fhem.pl - Hints for GNU/Linux + + + + +

fhem.pl - Hints for GNU/Linux

+ +

One device
+If you connect one USB device (FHZ1000PC, FHZ1300PC, EM1010PC, WS300, ...) +to your GNU/Linux server you can use the regular ftdi_sio kernel module. +However, it may not recognize our device. Therefore you need to get the +vendor and product codes: +
+# lsusb
+...
+Bus 002 Device 002: ID 0403:e0e8 Future Technology Devices International, Ltd
+...
+

+Now you need to edit your /etc/modprobe.conf or +/etc/modprobe.conf.local file (depending on your distribution). +Add the following line to it:
+ +
+options ftdi_sio vendor=0x0403 product=0xe0e8
+

+Replace the vendor and product code with the output of the lsusb command. +The you load the module using:
+
+# modprobe ftdi_sio
+

+ +

Multiple devices
+If you're using multiple USB devices (FHZ1000PC, FHZ1300PC, EM1010PC, WS300, ...) +you cannot use the methode above. You need to modify the ftdi_sio kernel module +to make it work. The following example was done with openSuSE 10.1:
+You need to have the kernel-source-version RPM of your +current kernel (see output of uname -r) installed.
+
+# cd /usr/src/linux
+# make cloneconfig
+# make modules_prepare
+# cp /boot/symvers-2.6.*-default.gz /usr/src/linux
+# mv symvers-2.6.*-default.gz Module.symvers.gz
+# gunzip /usr/src/linux/Module.symvers.gz
+# make modules_prepare
+# cd drivers/usb/serial
+
+For the EM1010PC you (may) need to add the following line: +
+# vi ftdi_sio.h
+...
+#define FTDI_ELV_WS500_PID 0xE0E9 /* PC-Wetterstation (WS 500) */
+#define FTDI_ELV_EM1010PC_PID 0xE0EF /* EM 1010 PC */
+

+Now we need to uncomment some lines to enable all of our devices. +
+# vi ftdi_sio.c
+...
+ { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
+...
+

+Remove the /* and */ of your devices and save the file. +
+# cd /usr/src/linux
+# make modules
+...
This may take a while. Go read a book, have lunch or ...
+
+# cd /lib/modules/yourKernelVerion/kernel/drivers/usb/serial
+# cp ftdi_sio.ko ftdi_sio.ko_backup
+# cp /usr/src/linux/drivers/usb/serial/ftdi_sio.ko .
+

+To make it become active you may need to stop applications (like fhem) who +are using the /dev/ttyUSB device and unload the module and load it again.
+
+# rmmod ftdi_so
+# modprobe ftdi_so
+

+You should now see multiple ttyUSB devices: +
+# ls -l /dev/ttyUSB*
+crw-rw---- 1 root uucp 188, 0 2007-02-11 23:00 /dev/ttyUSB0
+crw-rw---- 1 root uucp 188, 1 2007-02-11 23:00 /dev/ttyUSB1
+

+ +

Device links
+If you're using multiple USB devices (FHZ, EM, WS...) it might occur that the +enumeration of the /dev/ttyUSBn numbers get mixed up if one of the +device is missing or after a reboot.
+Starting with kernel 2.6 the UDEV implements means for using virtual names +instead of the bare numbers.
+Edit the file /etc/udev/rules.d/50-udev-default.rules +and append the following lines in the block labled as serial devices: +
+ +KERNEL=="ttyUSB*", SYSFS{product}=="ELV FHZ 1300 PC", SYMLINK+="elv_fhz1300pc"
+KERNEL=="ttyUSB*", SYSFS{product}=="ELV EM 1010 PC", SYMLINK+="elv_em1010pc"
+

+Now you need to reboot your box (unfortunalty) and once the system has come up +again you can use the device paths /dev/elv_fhz1300pc or +/dev/elv_em1010pc in your FHEM configuration file. + +