This repository has been archived by the owner on Jun 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
No observers in list when running server.observable.js #167
Comments
46 is the code for a denied request.
As of the latest iotivity-node, security is enabled. Therefore, for
successful communication between the client and the server, you need to
create oic_svr_db.dat files for both the client and the server. The process
and links to sample files can be found at
https://wiki.iotivity.org/security_resource_manager
You create the files by processing a JSON file using json2cbor, a tool
provided by iotivity. You can build the tool as part of iotivity with
scons SECURED=1 resource/csdk/security/tool
You need to place the resulting .dat files into a subdirectory of
~/.iotivity-node
The name of the subdirectory is the sha256sum of the absolute path of the
JS file. So, for a file named "/home/user/project/server.ocf.js", you can
obtain the sha256sum as follows:
echo -n '/home/user/project/server.ocf.js' | sha256sum
This yields
ff85509781006eb0da9c4e278e1a685d9b55e09bb03f4115d07fbe6a92d4569e -
Thus, you would
mkdir -p
~/.iotivity-node/ff85509781006eb0da9c4e278e1a685d9b55e09bb03f4115d07fbe6a92d4569e
and
cp oic_svr_db.dat
~/.iotivity-node/ff85509781006eb0da9c4e278e1a685d9b55e09bb03f4115d07fbe6a92d4569e
After repeating this process for both the client and the server, and having
made sure that the files have the correct contents, you can launch the
server.
https://github.com/otcshare/iotivity-node/blob/master/SECURITY.md also
contains these instructions.
There is a second approach to creating the .dat files. If you take this
approach, you provide the server with a sample .dat file, after which you
provision it using the iotivity provisioning client example tool. This
approach is described here:
https://github.com/otcshare/iotivity-node/blob/master/js/README.md
…On Fri, Jan 5, 2018 at 3:01 AM, xiaoyu3x ***@***.***> wrote:
I get the following information when running server.observable.js and
client.observe.js.
Client output:
[image: selection_029]
<https://user-images.githubusercontent.com/17694094/34600089-b6aa063c-f230-11e7-9155-071d8145206e.png>
But sever always continuously outputs "Sensor data has changed,No
observers in list "
[image: selection_028]
<https://user-images.githubusercontent.com/17694094/34600206-4e93a426-f231-11e7-8bd7-5137d8b80c7f.png>
I added console.log into iotivity.OCCreateResource(), but I find no
information output.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#167>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA7k0TFfImyMjvP18J8tXw3dgitj_pvUks5tHdbqgaJpZM4RUJAe>
.
|
hi, @gabrielschulhof Please help to me. |
It's in out/<platform>/<architecture>/release/resource/csdk/security/tool
...
<platform> means your platform, like "linux", or "win32", and
<architecture> means your processor architecture, like "x86_64".
…On Sun, Jan 7, 2018 at 9:36 PM, xiaoyu3x ***@***.***> wrote:
hi, @gabrielschulhof <https://github.com/gabrielschulhof>
Why not found 'provisioningclient'(step 5 in README.md
<https://github.com/otcshare/iotivity-node/tree/master/js>) for me after
run scons SECURED=1 resource/csdk/security/tool, and I can't get
'oic_svr_db_client.dat'.
Please help to me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA7k0ZuZr_0REtlV4aw8dnHr59g0hhgCks5tIX8ogaJpZM4RUJAe>
.
|
hi, @gabrielschulhof What pre-condition I need? |
This issue is reproduced with commit 35461e8 |
was this ever resolved? |
@yannS2016 I'm having trouble reproducing this issue. If your access control works properly, you will not get status 46. Are you seeing this too? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I got the following information when running server.observable.js and client.observe.js.
![selection_029](https://user-images.githubusercontent.com/17694094/34600089-b6aa063c-f230-11e7-9155-071d8145206e.png)
Client outputs:
But sever always continuously outputs "Sensor data has changed,No observers in list "
![selection_028](https://user-images.githubusercontent.com/17694094/34600206-4e93a426-f231-11e7-8bd7-5137d8b80c7f.png)
I added console.log into
iotivity.OCCreateResource()
, but I found no information output.The text was updated successfully, but these errors were encountered: