Hi

     If we set the listening port number with 55555 for Arduino MEGA(with
WiFi shield) or ESP8266. Whenever we do the DISCOVERY from IoTivity Client
or By Clicking Find Resource option in Eclipse Simulator It will Discover
the ESP8266 or Arduino MEGA (with WiFi shield) Device with port number
“4097” .

     Yes, all of us know that IoTivity Servers are Initially Multicasted to
224.0.1.187:5683 and Unicast (or listening) to device ip with some random
port number.

Once the Device Discovered with specific port number then IoTivity Client
Initiates GET,PUT,POST,..etc to that specific portnumber with Device IP.

     But here Arduino MEGA (with WiFi shield) or ESP8266 Device is
Discovered with port Number “4097”,IoTivity Client is Initiates
GET,PUT,POST,..etc
to that specific portnumber with Device IP (DeviceIP:4097) but the device
listening port is 55555.

    we need to change code on client side ,like when ever it discovers
devices with port number 4097 skip that 4097 port number and sending it to
the other port Number(55555 or any other server side listening port number).

      In the SDK used by the ESP8266/Arduino port, the underlying LWIP
library implements a function tcp_new_port as part of the tcp_client
library portion of the LWIP library.

This library is provided as a binary library by Espressif rather than as
open source.Currently that function works by sequential port allocation
starting from a fixed value that is

reset on every reset. Thus, the first tcp_connect() call from every reboot
will always use source port 4096, the second will use 4097, etc.

      This is a problem still exist for both Arduino MEGA(with WiFi shield)
& ESP8266 .I think changing the code on client side for specific port
number is not good and also try with Ethernet Cable.

On Tue, Aug 1, 2017 at 7:49 PM, 강태규 <[email protected]> wrote:

> Hi, I am using Arduino MEGA and WIFI shield.
>
>
>
> I tried to communicate with ocserver.cpp(arduino) and occlient.cpp(Linux
> PC).
>
>
>
> I noticed the server(arduino) can send URI(/a/light) to client(Linux PC).
> And the client also discovered the device's IP and port number
>
> (for example : 192.168.43.3:4097)
>
>
>
> But the server(arduino) do not operate OCEntityHandlerResult
> OCEntityHandlerCb(OCEntityHandlerFlag flag, OCEntityHandlerRequest *
> entityHandlerRequest, void *callbackParam)
>
> which should be invoked by OCStack whenever it recevies a request for this
> resource.
>
>
>
> Any advicess should be welcomed.
>
> _______________________________________________
> iotivity-dev mailing list
> [email protected]
> https://lists.iotivity.org/mailman/listinfo/iotivity-dev
>
>


-- 

With Regard's'

Matta Jayaram

+91-9493952323

+91-8096796118
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to