calimero-project / calimero-server

KNXnet/IP server for KNX IP, KNX (RF) USB, FT1.2, and TP-UART
Other
52 stars 18 forks source link

Wrong property type size when enabling timeServer in config #11

Closed Saubeer closed 2 years ago

Saubeer commented 2 years ago

Hi, I got calimero server running without problems, but when I enable the timeServer in the config file

                <timeServer>
                        <datapoint stateBased="true" name="current date" dptID="10.001" priority="low">
                                <knxAddress type="group">1/1/36</knxAddress>
                                <expiration timeout="60" />
                        </datapoint>
                </timeServer>

I got this exception:

[main] ERROR calimero.server.knx-server - initialization of KNX server failed
tuwien.auto.calimero.device.ios.KnxPropertyException: property type size is 2, not 4, type conflict (write access with a wrong data type (datapoint length))
        at tuwien.auto.calimero.device.ios.InterfaceObject.setProperty(InterfaceObject.java:351)
        at tuwien.auto.calimero.device.ios.InterfaceObjectServer$IosAdapter.setProperty(InterfaceObjectServer.java:656)
        at tuwien.auto.calimero.device.ios.InterfaceObjectServer$IosAdapter.setProperty(InterfaceObjectServer.java:615)
        at tuwien.auto.calimero.device.ios.InterfaceObjectServer.setProperty(InterfaceObjectServer.java:422)
        at tuwien.auto.calimero.device.BaseKnxDevice.addGroupObject(BaseKnxDevice.java:487)
        at tuwien.auto.calimero.server.gateway.KnxServerGateway.setupTimeServer(KnxServerGateway.java:884)
        at tuwien.auto.calimero.server.gateway.KnxServerGateway.<init>(KnxServerGateway.java:704)
        at tuwien.auto.calimero.server.Launcher.run(Launcher.java:639)
        at tuwien.auto.calimero.server.Launcher.main(Launcher.java:613)

Same with dptID="11.001" or dptID="19.001"

bmalinowsky commented 2 years ago

Hi, that's a regression from supporting different device layouts in calimero-device. I pushed a fix (calimero-device repo, not here), it should work again.

Thanks for your report!

Saubeer commented 2 years ago

Thank you for this quick fix. But now I get an other error:

[main] ERROR calimero.server.knx-server - initialization of KNX server failed
tuwien.auto.calimero.device.ios.KnxPropertyException: Group Object Table Object PID 23 property type size is 2, not 3, type conflict (write access with a wrong data type (datapoint length))
        at tuwien.auto.calimero.device.ios.InterfaceObject.setProperty(InterfaceObject.java:354)
        at tuwien.auto.calimero.device.ios.InterfaceObjectServer$IosAdapter.setProperty(InterfaceObjectServer.java:656)
        at tuwien.auto.calimero.device.ios.InterfaceObjectServer$IosAdapter.setProperty(InterfaceObjectServer.java:615)
        at tuwien.auto.calimero.device.ios.InterfaceObjectServer.setProperty(InterfaceObjectServer.java:422)
        at tuwien.auto.calimero.device.BaseKnxDevice.addGroupObject(BaseKnxDevice.java:505)
        at tuwien.auto.calimero.server.gateway.KnxServerGateway.setupTimeServer(KnxServerGateway.java:912)
        at tuwien.auto.calimero.server.gateway.KnxServerGateway.<init>(KnxServerGateway.java:754)
        at tuwien.auto.calimero.server.Launcher.run(Launcher.java:601)
        at tuwien.auto.calimero.server.Launcher.main(Launcher.java:575)
bmalinowsky commented 2 years ago

Can you remove the knx-server-ios.xml file in the server dir, it probably has the old PDT stored from before the fix.

Saubeer commented 2 years ago

Perfect. Now it works. Thank you. Just another question: Why I can't see the time and date telegrams in groupmonitor? Neither in ETS nor groupmonitor?

bmalinowsky commented 2 years ago

The server transmits the timestamp directly to the subnet (i.e., bus) and not to any client connections (because those don't really need it). You should see the timestamp msg if you have any other hardware (e.g., TP1 USB stick) connected to the KNX network. There it would show up, coming from the bus to any client.

Do you have a use-case where you want the time server to also serve clients?

calimero-project commented 2 years ago

Timestamps are also forwarded to client connections now.

Saubeer commented 2 years ago

@bmalinowsky No I dont't have a use-case. I was just wondering why these messages are not visible. But thanks for adding the timestamp messages to the client connections. 👍