Ok, this is a hard one to search the forums for…
I’ve created a device that will act as the parent for other devices. Let’s say the device is a PLI interface for X10, so this parent device will handle all the IO for the children. However, I want this parent to not be responsible for implementing the service actions for the children (0). This way a child of any type can use the interface in a generic way. The child device implements a generic service action for receiving status from the parent.
So far, so good, the parent device seems to be working fine.
Now, I’ve created a test device based on the binary switch. It basically has all the same service ids as the normal binary switch but has an additional service file for receiving info from the parent interface. Because of this, I need to have an implementation file for it, which I would think should be fine.
The trouble is I don’t need these children to do any IO of any kind, but it appears just the fact that I have an implementation file causes vera to try and connect to an IO port. Since I haven’t specified any tag in the device file, or any tag in the implementation file, it tries to connect to the same port as the parent. This, of course, leads to “Port already in use” messages coming in.
I don’t want it to connect to anything. How can I stop it from doing this? Why is it that just having an implementation file makes vera think that this device needs to do IO of some sort?
I tried putting an 0 in the implementation file, but that didn’t do anything.
The log below shows device 124 (the parent interface) connecting to the port. Then it shows device 124 again trying to connect, though the implementation file is that of device 125 (the child switch).
25 02/02/14 17:50:46.668 LuImplementation::StartLua device: 124 file:I_X10PLI.xml startup:startup pLuaInterface: 0xb9b3d8 ip: 127.0.0.1 port 3481 protocol: raw <0x2b7fb680>
25 02/02/14 17:50:46.671 IOPort::ConfirmSocketHandle device 124 waiting up to 30 seconds for connection <0x2b7fb680>
25 02/02/14 17:50:46.673 IOPort::Connect device 124 connecting to 127.0.0.1:3481 iodevice: 71 path /dev/ttyUSB1 <0x2f228680>
25 02/02/14 17:50:46.673 IOPort::Connect connect 1: 127.0.0.1:3481 <0x2f228680>
25 02/02/14 17:50:50.678 IOPort::Connect device 124 connecting to 127.0.0.1:3481 iodevice: 71 path /dev/ttyUSB1 <0x2f228680>
25 02/02/14 17:50:50.679 IOPort::Connect connect 1: 127.0.0.1:3481 <0x2f228680>
25 02/02/14 17:50:50.681 IOPort::Connect connect 3: 127.0.0.1:3481 m_socket_handle 15 <0x2f228680>
25 02/02/14 17:50:50.908 IOPort::Connect OK 127.0.0.1:3481 <0x2f228680>
25 02/02/14 17:50:50.980 IOPort::ConfirmSocketHandle device 124 success 1 handle 15 connecting 0 <0x2b7fb680>
25 02/02/14 17:50:50.982 LuImplementation::StartLua running startup code for 124 I_X10PLI.xml <0x2b7fb680>
25 02/02/14 17:50:51.080 lua impl before 124 start pMem 0xcd6000/13459456 diff: 4997120 <0x2b7fb680>
25 02/02/14 17:50:51.081 LuImplementation::StartLua device: 124 file:I_testswitch1.xml startup:init pLuaInterface: 0xb9b3d8 ip: 127.0.0.1 port 3481 protocol: (null)
<0x2b7fb680>
Bruce