calimero-project / calimero-core

Core library for KNX network access and management
Other
128 stars 65 forks source link

calimero dimming read and write #64

Closed ViorelOnica closed 6 years ago

ViorelOnica commented 6 years ago

Hello, I have 2 problems: 1) Reading switch (1bit boolean) and dimming (1byte unsigned int) datapoints. In order to do that, I used these 2 functions below, but "catch" occurs.

read

Below you can see the objects I created and the logs read attempts. issue

Is it about bad objects configuration or am I using wrong the library methods ?

2) I have a method that gets triggered whenever knx connection gets lost: @Override public void linkClosed(CloseEvent e) { //code to execute }

But I tried the following scenario: turned off mobile data and this function gets triggered after 30-45 seconds after losing the internet connection. You told me in another issue post that what I'm seeking for is an idle state trigger over the knxlink.. I failed finding the proper function that takes care of that, can you give me a concrete code example, please ?

I'd really appreciate your help !

calimero-project commented 6 years ago

The way you use the methods is fine.

What exactly is the error (output of e.printStackTrace())?

Re link: if your goal is to automatically reconnect and/or configure that in more detail, you can use Connector (tuwien.auto.calimero.link.Connector). Even if the network connection was down (and/or the link got closed), it will re-establish a link.

ViorelOnica commented 6 years ago

exc

This exception is threw after calling any of the 2 functions (readBoolean, readDimming) ..;\

Concerning the knxlink: Yes, I want to automatically reconnect, but there's a green circle in the application indicating that the connection's up and I want to make it red whenever it goes idle ( I'm using the linkClosed method and it's getting red only after 30-45 seconds after losing the mobile data )

calimero-project commented 6 years ago

This exception means that the remote endpoint (the one that should answer for that group address) is not answering, therefore, a timeout exception is thrown after the specified process communication timeout.

ViorelOnica commented 6 years ago

hmm, okay, thanks.. I'll do some research

ViorelOnica commented 6 years ago

well, I'm not getting timeout exception anymore and I'm getting a response aswell

eff

But this is the new exception I get

ff

bmalinowsky commented 6 years ago

The response you are getting is probably for a different datapoint type? The length of the value is too long for the type you want to read.