You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am able to establish knx unsecure tunnel with the device , and able to write to device , the ip light is flickering as well but the actual knx light is not turning on
Can you please review my code and check if i am going correctly
// Address of your KNXnet/IP server. Replace the IP host or address as
// necessary.
private static final String remoteHost = "192.168.100.100";
private static final String localHost = "0.0.0.0";
private static final String keyringUri = "/home/bhanujarya/Downloads/KNX Secure.knxkeys";
private static final char[] keyringPwd = "jt@paragon".toCharArray();
// We will read a boolean from the KNX datapoint with this group address,
// replace the address as necessary.
// Make sure this datapoint exists, otherwise you will get a read timeout!
private static final String group = "1/1/1";
private static final String readGroup = "1/1/2";
private final SecureApplicationLayer sal = null;
public static void main(final String[] args) {
final InetSocketAddress remote = new InetSocketAddress(remoteHost, 3671);
final InetSocketAddress local = new InetSocketAddress(localHost, 0);
// Create our network link, and pass it to a process communicator
try (KNXNetworkLink knxLink = KNXNetworkLinkIP.newTunnelingLink(local, remote, false, new TPSettings());
ProcessCommunicator pc = new ProcessCommunicatorImpl(knxLink)) {
// ProcessCommunicationResponder pCommRespond = new ProcessCommunicationResponder(knxLink,null);
//
// ProcessCommunicationResponder pCommRespondb = new ProcessCommunicationResponder(knxLink,null);
//
//
// ProcessCommunicationResponder pCommRespondc = new ProcessCommunicationResponder(knxLink,null);
//new SecureApplicationLayer(knxLink, null, SerialNumber.of(Long.parseLong("00C501071402", 16)), new SequenceNumbers(217088278911l, 2l, null, null));
IndividualAddress dev = new IndividualAddress("1.1.1");
Map<IndividualAddress, Long> mp = new HashMap<>();
mp.put(dev, 2l);
I am able to establish knx unsecure tunnel with the device , and able to write to device , the ip light is flickering as well but the actual knx light is not turning on
Can you please review my code and check if i am going correctly
`package knxtest;
import java.net.InetSocketAddress;
import java.time.LocalTime;
import java.util.Base64;
import java.util.HashMap;
import java.util.HashSet;
import java.util.HexFormat;
import java.util.Map;
import java.util.Set;
import javax.sql.rowset.serial.SerialArray;
import io.calimero.DetachEvent;
import io.calimero.GroupAddress;
import io.calimero.IndividualAddress;
import io.calimero.KNXException;
import io.calimero.SerialNumber;
import io.calimero.device.ProcessCommunicationResponder;
import io.calimero.device.ProcessCommunicationResponder;
import io.calimero.link.KNXNetworkLink;
import io.calimero.link.KNXNetworkLinkIP;
import io.calimero.link.medium.TPSettings;
import io.calimero.process.ProcessCommunicator;
import io.calimero.process.ProcessCommunicatorImpl;
import io.calimero.process.ProcessEvent;
import io.calimero.process.ProcessListener;
import io.calimero.secure.Keyring;
import io.calimero.secure.SecureApplicationLayer;
import io.calimero.secure.SecureApplicationLayer.SequenceNumbers;
import io.calimero.secure.Security;
public class ProcessCommunication {
// ProcessCommunicationResponder pCommRespond = new ProcessCommunicationResponder(knxLink,null);
//
// ProcessCommunicationResponder pCommRespondb = new ProcessCommunicationResponder(knxLink,null);
//
//
// ProcessCommunicationResponder pCommRespondc = new ProcessCommunicationResponder(knxLink,null);
// Security.defaultInstallation().useKeyring(Keyring.load(keyringUri), keyringPwd);
// Set sett = new HashSet<>();
// sett.add(new IndividualAddress("1.1.1"));
// sett.add(new IndividualAddress("1.1.2"));
// String toolKeyBase64 = "Qx9QJ3Pds8TKdWroRclgog==";
//
// byte[] toolKeyBytes = Base64.getDecoder().decode(toolKeyBase64);
//
// Security.defaultInstallation().groupSenders().put(new GroupAddress("2305"), sett);
// Security.defaultInstallation().groupSenders().put(new GroupAddress("2306"), sett);
// Security.defaultInstallation().groupSenders().put(new GroupAddress("2307"), sett);
// Security.defaultInstallation().groupSenders().put(new GroupAddress("2308"), sett);
// Security.defaultInstallation().groupSenders().put(new GroupAddress("2309"), sett);
// Security.defaultInstallation().groupSenders().put(new GroupAddress("2048"), sett);
// Security.defaultInstallation().deviceToolKeys().put(new IndividualAddress("1.1.1"), toolKeyBytes);
}
`
Output is
Dec 07, 2024 1:15:11 PM io.calimero.knxnetip.ClientConnection connect
INFO: connection established (data endpoint 192.168.100.100:3,671, channel 31, tunneling address 1.0.255)
Dec 07, 2024 1:15:11 PM io.calimero.knxnetip.ClientConnection connect
INFO: connection established (data endpoint 192.168.100.100:3,671, channel 32)
writing though p resp
Writing command true
The text was updated successfully, but these errors were encountered: