Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cf-dev] Adding endpoint

Hi Naveen,

there is no need to iterate over the network interfaces and add endpoints explicitly.

The first line of code

server = new CoapServer(3333);

will already create a server that binds to the wildcard address (i.e. all local network interfaces) on port 3333

Are you testing your setup from within the same network, i.e. are the sensors on the same network as your server is? Or are your sensors trying to connect over the internet to your server (which runs on your local network)? You will need to make sure that the UDP packages sent by your sensors actually have a route to your server ...

Kai


On 20.11.2017 18:37, naveenkumarmarri wrote:
Hi Dev,

I'm working on IoT project which involves posting data from sensors to a remote server. 
I've added endpoints in remote server so that the sensors will be able to access the URL, However, When I'm posting data from sensors, the data is unable to reach the remote server but when I'm trying to simulate this with in the remote server, I'm able to post data to the service. 
Following is the log shown by the CoAP server, I'm suspecting that since at the end of the log it is showing "started endpoint at coap://127.0.0.1:2222" the server is able to receive messages when posted from local.


Inline
          image 1

Following is the code I've used for creating endpoints.

server = new CoapServer(3333);
        for (InetAddress addr : EndpointManager.getEndpointManager().getNetworkInterfaces()) {
    if (addr instanceof Inet4Address) {
    InetSocketAddress bindToAddress = new InetSocketAddress(addr, 2222);
    server.addEndpoint(new CoapEndpoint(bindToAddress));
    }
    }
server.start();

Am I missing something here? Any thoughts or suggestions on this will be helpful.

Regards,
Naveen


_______________________________________________
cf-dev mailing list
cf-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cf-dev

--

Mit freundlichen Grüßen / Best regards

Kai Hudalla
Chief Software Architect

Bosch Software Innovations GmbH
Ullsteinstraße 128
12109 Berlin
GERMANY
www.bosch-si.com

Registered Office: Berlin, Registration Court: Amtsgericht Charlottenburg; HRB 148411 B
Chairman of the Supervisory Board: Dr.-Ing. Thorsten Lücke; Managing Directors: Dr.-Ing. Rainer Kallenbach, Michael Hahn


Back to the top