I am no longer able to reproduce the problem. It seems to work fine now. I do have another problem that may be related: I have 2 USB devices plugged into my Raspberry: P1 cable and RFXcom tranceiver. With each reboot of the raspberry the allocation of ttyUSB0 and ttyUSB1 is kind of random. This means that if Domoticz is configured to use ttyUSB0 for the P1 cable, the device may show up at ttyUSB1 after the next reboot. This means the P1 connection no longer works. I fixed this using the following procedure:
(see
http://unix.stackexchange.com/questions ... tatic-name for more info)
from a terminal window:
1. find out what's on ttyUSB:
Code: Select all
pi@raspberrypi:~ $ dmesg | grep ttyUSB
[ 4.074363] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0
[ 4.075590] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB1
Take not of the node numbers: 1-1.2 and 1-1.3
2. list all attributes of the devices (in my case USB0 and USB1):
Code: Select all
pi@raspberrypi:~ $ udevadm info --name=/dev/ttyUSB0 --attribute-walk
...
pi@raspberrypi:~ $ udevadm info --name=/dev/ttyUSB1 --attribute-walk
...
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2':
KERNELS=="1-1.2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="1.2"
ATTRS{idVendor}=="0403"
ATTRS{speed}=="12"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{busnum}=="1"
ATTRS{devnum}=="4"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="90mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="a0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0600"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="A1LPXWF"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="179474001"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="RFXCOM"
ATTRS{removable}=="removable"
ATTRS{idProduct}=="6001"
ATTRS{bDeviceClass}=="00"
ATTRS{product}=="RFXtrx433"
...
Look at tree leaf matching the node name from the prior step. I my case ..../usb1/1-1/1-1.3 en ..../usb1/1-1/1-1.2
The RFXCON and P1 both had the same
idVendor (0403) and
idProduct (6001), but they had different serial numbers. That part matters, because we are now going to create a new USB device linked to that specific serial number
3. Create a file /etc/udev/rules.d/10-usb-serial.rules with rules for all USB devices in it:
Code: Select all
pi@raspberrypi:~ $ sudo nano /etc/udev/rules.d/10-usb-serial.rules
type the following in the editor and then save the file (ctrl-o) and (ctrl-x):
Code: Select all
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTR{serial}=="P11234567", SYMLINK+="ttyUSB_P1"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTR{serial}=="RFX1234567", SYMLINK+="ttyUSB_RFX"
Note: the serial numbers, idVendor and idProduct shown need to be replaced by your ids
4. Load the new rule:
Code: Select all
pi@raspberrypi:~ $ sudo udevadm trigger
5. Verify what happened:
Code: Select all
pi@raspberrypi:~ $ ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Nov 11 10:29 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Nov 11 10:00 /dev/ttyUSB1
lrwxrwxrwx 1 root root 7 Nov 11 10:00 /dev/ttyUSB_P1 -> ttyUSB1
lrwxrwxrwx 1 root root 7 Nov 11 10:00 /dev/ttyUSB_RFX1 -> ttyUSB0
As you see we still have the existing USB0 and USB1 devices, but also have 2 symbolic links to devices that are match the right hardware. These symbolic links will be created at each reboot or when the USB device is plugged into an USB port.
6. Now in Domoticz below the Hardware menu change the device for the P1 cable to
ttyUSB_P1 and the one for RFXCOM to
ttyUSB_RFX1