why can not connect knx to android using KNXNetworkLinkIP
I want to connect android device to knx using calimero library ower wifi modem, I use the following code inside doInBackground:
private static final String remoteHost = "192.168.1.10";
private static final String group = "0/0/1";
private static final String remoteip = "192.168.1.10";
private static final int knxServerPort = KNXnetIPConnection.DEFAULT_PORT;
KNXNetworkLink knxLink = null;
ProcessCommunicator pc = null;
try
final InetSocketAddress localEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);
final InetSocketAddress remoteEP = new InetSocketAddress(remoteip, knxServerPort);
knxLink = new KNXNetworkLinkIP(KNXNetworkLinkIP.TUNNELING, localEP, remoteEP, true, TPSettings.TP1);
pc = new ProcessCommunicatorImpl(knxLink);
pc.write(new GroupAddress(group), true);
knxLink.close();
catch (final KNXException e)
System.out.println("Error reading KNX datapoint: " + e.getMessage());
catch (final InterruptedException e)
System.out.println("Interrupted: " + e.getMessage());
e.printStackTrace();
catch (UnknownHostException e)
// TODO Auto-generated catch block
e.printStackTrace();
finally
// we don't need the process communicator anymore, detach it from the link
if (pc != null)
pc.detach();
// close the KNX link
if (knxLink != null)
knxLink.close();
But i get the following error and android can not connect to my Module IP:
tuwien.auto.calimero.exception.KNXException: on connect to /192.168.1.10:3671
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:176)
at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.<init>(KNXnetIPTunnel.java:131)
at tuwien.auto.calimero.link.KNXNetworkLinkIP.<init>(KNXNetworkLinkIP.java:142)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:130)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:71)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.net.BindException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.IoBridge.bind(IoBridge.java:89)
at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:68)
at java.net.DatagramSocket.bind(DatagramSocket.java:457)
at java.net.DatagramSocket.<init>(DatagramSocket.java:404)
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:150)
Caused by: libcore.io.ErrnoException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.Posix.bind(Native Method)
at libcore.io.ForwardingOs.bind(ForwardingOs.java:40)
at libcore.io.IoBridge.bind(IoBridge.java:87)
eglSurfaceAttrib not implemented 3093 12436
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4aa121ec attribute=null, token = android.os.BinderProxy@4a9e5ea4
also i change the remoteHost to 192.168.1.1 but result is the same,
please help me what is the wrong?
java
add a comment |
I want to connect android device to knx using calimero library ower wifi modem, I use the following code inside doInBackground:
private static final String remoteHost = "192.168.1.10";
private static final String group = "0/0/1";
private static final String remoteip = "192.168.1.10";
private static final int knxServerPort = KNXnetIPConnection.DEFAULT_PORT;
KNXNetworkLink knxLink = null;
ProcessCommunicator pc = null;
try
final InetSocketAddress localEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);
final InetSocketAddress remoteEP = new InetSocketAddress(remoteip, knxServerPort);
knxLink = new KNXNetworkLinkIP(KNXNetworkLinkIP.TUNNELING, localEP, remoteEP, true, TPSettings.TP1);
pc = new ProcessCommunicatorImpl(knxLink);
pc.write(new GroupAddress(group), true);
knxLink.close();
catch (final KNXException e)
System.out.println("Error reading KNX datapoint: " + e.getMessage());
catch (final InterruptedException e)
System.out.println("Interrupted: " + e.getMessage());
e.printStackTrace();
catch (UnknownHostException e)
// TODO Auto-generated catch block
e.printStackTrace();
finally
// we don't need the process communicator anymore, detach it from the link
if (pc != null)
pc.detach();
// close the KNX link
if (knxLink != null)
knxLink.close();
But i get the following error and android can not connect to my Module IP:
tuwien.auto.calimero.exception.KNXException: on connect to /192.168.1.10:3671
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:176)
at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.<init>(KNXnetIPTunnel.java:131)
at tuwien.auto.calimero.link.KNXNetworkLinkIP.<init>(KNXNetworkLinkIP.java:142)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:130)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:71)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.net.BindException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.IoBridge.bind(IoBridge.java:89)
at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:68)
at java.net.DatagramSocket.bind(DatagramSocket.java:457)
at java.net.DatagramSocket.<init>(DatagramSocket.java:404)
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:150)
Caused by: libcore.io.ErrnoException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.Posix.bind(Native Method)
at libcore.io.ForwardingOs.bind(ForwardingOs.java:40)
at libcore.io.IoBridge.bind(IoBridge.java:87)
eglSurfaceAttrib not implemented 3093 12436
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4aa121ec attribute=null, token = android.os.BinderProxy@4a9e5ea4
also i change the remoteHost to 192.168.1.1 but result is the same,
please help me what is the wrong?
java
2
The error message says that the local IP address is not valid. If the address you pass inlocalEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);really the IP address of the device on which your program is running?
– Klaus Gütter
Nov 21 '18 at 5:18
add a comment |
I want to connect android device to knx using calimero library ower wifi modem, I use the following code inside doInBackground:
private static final String remoteHost = "192.168.1.10";
private static final String group = "0/0/1";
private static final String remoteip = "192.168.1.10";
private static final int knxServerPort = KNXnetIPConnection.DEFAULT_PORT;
KNXNetworkLink knxLink = null;
ProcessCommunicator pc = null;
try
final InetSocketAddress localEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);
final InetSocketAddress remoteEP = new InetSocketAddress(remoteip, knxServerPort);
knxLink = new KNXNetworkLinkIP(KNXNetworkLinkIP.TUNNELING, localEP, remoteEP, true, TPSettings.TP1);
pc = new ProcessCommunicatorImpl(knxLink);
pc.write(new GroupAddress(group), true);
knxLink.close();
catch (final KNXException e)
System.out.println("Error reading KNX datapoint: " + e.getMessage());
catch (final InterruptedException e)
System.out.println("Interrupted: " + e.getMessage());
e.printStackTrace();
catch (UnknownHostException e)
// TODO Auto-generated catch block
e.printStackTrace();
finally
// we don't need the process communicator anymore, detach it from the link
if (pc != null)
pc.detach();
// close the KNX link
if (knxLink != null)
knxLink.close();
But i get the following error and android can not connect to my Module IP:
tuwien.auto.calimero.exception.KNXException: on connect to /192.168.1.10:3671
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:176)
at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.<init>(KNXnetIPTunnel.java:131)
at tuwien.auto.calimero.link.KNXNetworkLinkIP.<init>(KNXNetworkLinkIP.java:142)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:130)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:71)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.net.BindException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.IoBridge.bind(IoBridge.java:89)
at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:68)
at java.net.DatagramSocket.bind(DatagramSocket.java:457)
at java.net.DatagramSocket.<init>(DatagramSocket.java:404)
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:150)
Caused by: libcore.io.ErrnoException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.Posix.bind(Native Method)
at libcore.io.ForwardingOs.bind(ForwardingOs.java:40)
at libcore.io.IoBridge.bind(IoBridge.java:87)
eglSurfaceAttrib not implemented 3093 12436
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4aa121ec attribute=null, token = android.os.BinderProxy@4a9e5ea4
also i change the remoteHost to 192.168.1.1 but result is the same,
please help me what is the wrong?
java
I want to connect android device to knx using calimero library ower wifi modem, I use the following code inside doInBackground:
private static final String remoteHost = "192.168.1.10";
private static final String group = "0/0/1";
private static final String remoteip = "192.168.1.10";
private static final int knxServerPort = KNXnetIPConnection.DEFAULT_PORT;
KNXNetworkLink knxLink = null;
ProcessCommunicator pc = null;
try
final InetSocketAddress localEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);
final InetSocketAddress remoteEP = new InetSocketAddress(remoteip, knxServerPort);
knxLink = new KNXNetworkLinkIP(KNXNetworkLinkIP.TUNNELING, localEP, remoteEP, true, TPSettings.TP1);
pc = new ProcessCommunicatorImpl(knxLink);
pc.write(new GroupAddress(group), true);
knxLink.close();
catch (final KNXException e)
System.out.println("Error reading KNX datapoint: " + e.getMessage());
catch (final InterruptedException e)
System.out.println("Interrupted: " + e.getMessage());
e.printStackTrace();
catch (UnknownHostException e)
// TODO Auto-generated catch block
e.printStackTrace();
finally
// we don't need the process communicator anymore, detach it from the link
if (pc != null)
pc.detach();
// close the KNX link
if (knxLink != null)
knxLink.close();
But i get the following error and android can not connect to my Module IP:
tuwien.auto.calimero.exception.KNXException: on connect to /192.168.1.10:3671
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:176)
at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.<init>(KNXnetIPTunnel.java:131)
at tuwien.auto.calimero.link.KNXNetworkLinkIP.<init>(KNXNetworkLinkIP.java:142)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:130)
at com.armantsco.smarthome.MainActivity$myAsync.doInBackground(MainActivity.java:71)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.net.BindException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.IoBridge.bind(IoBridge.java:89)
at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:68)
at java.net.DatagramSocket.bind(DatagramSocket.java:457)
at java.net.DatagramSocket.<init>(DatagramSocket.java:404)
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:150)
Caused by: libcore.io.ErrnoException: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
at libcore.io.Posix.bind(Native Method)
at libcore.io.ForwardingOs.bind(ForwardingOs.java:40)
at libcore.io.IoBridge.bind(IoBridge.java:87)
eglSurfaceAttrib not implemented 3093 12436
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4aa121ec attribute=null, token = android.os.BinderProxy@4a9e5ea4
also i change the remoteHost to 192.168.1.1 but result is the same,
please help me what is the wrong?
java
java
asked Nov 12 '18 at 11:13
Mohammad BehnamMohammad Behnam
136
136
2
The error message says that the local IP address is not valid. If the address you pass inlocalEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);really the IP address of the device on which your program is running?
– Klaus Gütter
Nov 21 '18 at 5:18
add a comment |
2
The error message says that the local IP address is not valid. If the address you pass inlocalEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);really the IP address of the device on which your program is running?
– Klaus Gütter
Nov 21 '18 at 5:18
2
2
The error message says that the local IP address is not valid. If the address you pass in
localEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0); really the IP address of the device on which your program is running?– Klaus Gütter
Nov 21 '18 at 5:18
The error message says that the local IP address is not valid. If the address you pass in
localEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0); really the IP address of the device on which your program is running?– Klaus Gütter
Nov 21 '18 at 5:18
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260952%2fwhy-can-not-connect-knx-to-android-using-knxnetworklinkip%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260952%2fwhy-can-not-connect-knx-to-android-using-knxnetworklinkip%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
The error message says that the local IP address is not valid. If the address you pass in
localEP = new InetSocketAddress(InetAddress.getByName(remoteHost), 0);really the IP address of the device on which your program is running?– Klaus Gütter
Nov 21 '18 at 5:18