Skip to main content

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

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

Back to the top