iotivity-constrained icon indicating copy to clipboard operation
iotivity-constrained copied to clipboard

SimpleClient - IPV4 Issue

Open CarolineBoyer opened this issue 7 years ago • 1 comments

Hello everyone,

I came across an issue after installing iotivity-constrained on a raspberry pi 2 using in port/linux :

make DEBUG=1 IPV4=1

and running the ./simpleclient script that is created in port/linux.

First thought : it would be interesting to have an /out/ folder containing all the script created by the makefile in the /port/linux like the main iotivity project, as that would make the make clean easier ( as it isn't working not erasing everything as it is now).

ISSUE : When launching the ./simpleClient on the Raspberry Pi 2, I have :

DEBUG: ../../api/oc_buffer.c <process_thread_message_buffer_handler:112>: Started buffer handler process
DEBUG: ../../api/oc_introspection.c <oc_create_introspection_resource:118>: oc_introspection: Initializing introspection resource
DEBUG: ipadapter.c <oc_connectivity_init:887>: Initializing connectivity for device 0
ERROR: ipadapter.c <oc_connectivity_init:929>: creating server sockets

error initializing connectivity for device
Abort.
Aborted

After looking at the oc_connectivity_init method, it seems that the program tries to create a socket using AF_INET6 even if I put the IPV4 option. And as IPV6 is not enabled on the pi, I guess it is why the socket returns an error. Your IPV4 test is after the socket method... and therefore never called... Could it not be possible to put all IPV6 code under an ifdef block or something ?

Second thought : it would also be great to have the nature of the socket error returned in the message.

Or maybe there is something that I didn't get, and done wrongly. Any thoughts ?

CarolineBoyer avatar Apr 17 '18 17:04 CarolineBoyer

hello CarolineBoyer

Are you still experiencing this issue! i have been running iotivity constrained on my raspberry PI 2 without issues. IPV6 is mandatory from what i got from Kirsten. when you enable IPV4 it will allocated IPV4 sockets coupled to the IPV6 ones. you said "And as IPV6 is not enabled on the pi" Actually Pi uses IPV6 on the link-local or scope link( address starting with : inet6 fe80::). which is the one required for the stack to communicate via IPV6.

Regards

Yann

yannS2016 avatar Mar 03 '19 22:03 yannS2016