Closed sanbeam closed 7 years ago
Bump. Someone please look into this.
It looks like some server on the network is issuing OC_STACK_ERROR in response to a resource discovery. I would say check the server, and attach an error handler to the client so it doesn't end up throwing a fatal exception.
Discovery worked for me on 1.2 using high level client / server... but then hang, I will have to investigate too
Just curious. Is security enabled by default ?
Just curious. Is security enabled by default ? If yes, how do i get insecure version at npm install ?
upstream and meta-oic have SECURED=0 by default on 1.2.1 and under, I aligned to that
If you want to build with SECURED=0 you have to build iotivity externally, then export OCTBSTACK_CFLAGS and OCTBSTACK_LIBS.
Thanks for confirming. I think these two were the issues. I ll test and update soon.
Did the following steps.
package.json : "iotivity-node": "git+https://github.com/otcshare/iotivity-node#maintenance"
git clone https://git.iotivity.org/iotivity
pushd iotivity
git fetch --all --tags --prune
git checkout tags/1.2.0 -b 1.2.0
git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor
pushd extlibs/tinycbor/tinycbor/
git checkout tags/v0.3.2
popd
echo "Now in " pwd
scons resource SECURED=0 TARGET_TRANSPORT=IP
echo "Build Completed"
export IOTIVITY_DIR=pwd
export OCTBSTACK_CFLAGS="-I$IOTIVITY_DIR/resource/csdk/stack/include \
-I$IOTIVITY_DIR/resource/csdk/connectivity/inc/ \
-I$IOTIVITY_DIR/resource/csdk/connectivity/api \
-I$IOTIVITY_DIR/resource/include \
-I$IOTIVITY_DIR/resource/oc_logger/include/\
-I$IOTIVITY_DIR/resource/c_common/oic_string/include/\
-I$IOTIVITY_DIR/resource/c_common/oic_malloc/include/\
-I$IOTIVITY_DIR/resource/c_common/\
-I$IOTIVITY_DIR/resource/c_common/oic_time/include/\
-I$IOTIVITY_DIR/resource/c_common/\
-I$IOTIVITY_DIR/resource/c_common/ocrandom/include/\
-I$IOTIVITY_DIR/extlibs/tinycbor/tinycbor/src\
-I$IOTIVITY_DIR/resource/csdk/stack/include/"
export OCTBSTACK_LIBS="-L$IOTIVITY_DIR/out/linux/x86_64/release -loc -loctbstack -lconnectivity_abstraction -loc_logger"
echo $IOTIVITY_DIR
echo $OCTBSTACK_CFLAGS
echo $OCTBSTACK_LIBS
popd
echo "Now in pwd
"
npm install
Step 2 went fine.
node node_modules/iotivity-node/js/high-level-client-example.js Acquiring OCF device Issuing discovery request Segmentation fault (core dumped)
GDB Trace
http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from node...done. (gdb) r ./node_modules/iotivity-node/js/high-level-client-example.js Starting program: /usr/bin/node ./node_modules/iotivity-node/js/high-level-client-example.js [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff7ff5700 (LWP 23819)] [New Thread 0x7ffff6b43700 (LWP 23820)] [New Thread 0x7ffff6342700 (LWP 23821)] [New Thread 0x7ffff5b41700 (LWP 23822)] [New Thread 0x7ffff5340700 (LWP 23823)] Acquiring OCF device [New Thread 0x7fffe7fff700 (LWP 23824)] [New Thread 0x7fffe77fe700 (LWP 23825)] [New Thread 0x7fffe6ffd700 (LWP 23826)] [New Thread 0x7fffe67fc700 (LWP 23827)] Issuing discovery request
Thread 1 "node" received signal SIGSEGV, Segmentation fault. strlen () at ../sysdeps/x86_64/strlen.S:106 106 ../sysdeps/x86_64/strlen.S: No such file or directory. (gdb) bt
---Type
@gabrielschulhof, please help me set this up.
Forgot to add ROUTING_EP. My bad.
Client crashes with the following issue.
{"devAddr":{"adapter":2,"flags":0,"ifindex":0,"port":0,"addr":""},"addr":{"adapter":2,"flags":0,"ifindex":0,"port":0,"addr":""},"connType":131072,"identity":[],"result":255,"sequenceNumber":0,"resourceUri":"/oic/res","rcvdVendorSpecificHeaderOptions":[]} /home/sanjeev/source/jlr/node_modules/iotivity-node/lib/csdk.js:39 throw theError; ^
Error: findResources: Unexpected response