Coder Social home page Coder Social logo

Comments (9)

dbkinder avatar dbkinder commented on August 17, 2024

Here's what I get in the client.get.js window when I run the server/client.get.js example:

pi@raspberrypi:~ $ cd ~/workspace/iotivity-node/js
pi@raspberrypi:~/workspace/iotivity-node/js $ node client.get.js 
Starting OCF stack in client mode
Issuing discovery request
Received response to DISCOVER request:
{
    "devAddr": {
        "adapter": 1,
        "flags": 98,
        "ifindex": 0,
        "port": 5683,
        "addr": "ff02::158"
    },
    "addr": {
        "adapter": 1,
        "flags": 98,
        "ifindex": 0,
        "port": 5683,
        "addr": "ff02::158"
    },
    "connType": 65634,
    "identity": [],
    "result": 29,
    "sequenceNumber": 0,
    "resourceUri": "/oic/res",
    "rcvdVendorSpecificHeaderOptions": []
}
Received response to DISCOVER request:
{
    "devAddr": {
        "adapter": 1,
        "flags": 32,
        "ifindex": 2,
        "port": 40833,
        "addr": "fe80::c7e5:1ab0:4459:479a%eth0"
    },
    "addr": {
        "adapter": 1,
        "flags": 32,
        "ifindex": 2,
        "port": 40833,
        "addr": "fe80::c7e5:1ab0:4459:479a%eth0"
    },
    "payload": {
        "type": 1,
        "sid": "5eda845f-d21f-5e91-9e7c-3f98e5841827",
        "resources": [
            {
                "uri": "/oic/sec/doxm",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.doxm"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.24",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/pstat",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.pstat"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/acl2",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.acl2"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/cred",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.cred"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/crl",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.crl"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/csr",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.csr"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/roles",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.roles"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/d",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.wk.d"
                ],
                "interfaces": [
                    "oic.if.baseline",
                    "oic.if.r"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.24",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/p",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.wk.p"
                ],
                "interfaces": [
                    "oic.if.baseline",
                    "oic.if.r"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.24",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/introspection",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.wk.introspection"
                ],
                "interfaces": [
                    "oic.if.baseline",
                    "oic.if.r"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.24",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/a/iotivity-node-get-sample",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "core.fan"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.24",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::c7e5:1ab0:4459:479a%25eth0",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    }
                ]
            }
        ]
    },
    "connType": 65568,
    "identity": [],
    "result": 0,
    "sequenceNumber": 16777216,
    "resourceUri": "/oic/res",
    "rcvdVendorSpecificHeaderOptions": [
        {
            "protocolID": 2,
            "optionID": 12
        },
        {
            "protocolID": 2,
            "optionID": 2053
        }
    ]
}
Received response to DISCOVER request:
{
    "devAddr": {
        "adapter": 1,
        "flags": 64,
        "ifindex": 1,
        "port": 38630,
        "addr": "192.168.1.25"
    },
    "addr": {
        "adapter": 1,
        "flags": 64,
        "ifindex": 1,
        "port": 38630,
        "addr": "192.168.1.25"
    },
    "payload": {
        "type": 1,
        "sid": "5eda845f-d21f-5e91-9e7c-3f98e5841827",
        "resources": [
            {
                "uri": "/oic/sec/doxm",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.doxm"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.25",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/pstat",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.pstat"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/acl2",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.acl2"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/cred",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.cred"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/crl",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.crl"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/csr",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.csr"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/sec/roles",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.r.roles"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/d",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.wk.d"
                ],
                "interfaces": [
                    "oic.if.baseline",
                    "oic.if.r"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.25",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/oic/p",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.wk.p"
                ],
                "interfaces": [
                    "oic.if.baseline",
                    "oic.if.r"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.25",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/introspection",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "oic.wk.introspection"
                ],
                "interfaces": [
                    "oic.if.baseline",
                    "oic.if.r"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coaps",
                        "addr": "192.168.1.25",
                        "family": 80,
                        "port": 44242,
                        "pri": 1
                    },
                    {
                        "tps": "coaps",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 48,
                        "port": 57806,
                        "pri": 1
                    }
                ]
            },
            {
                "uri": "/a/iotivity-node-get-sample",
                "anchor": "ocf://5eda845f-d21f-5e91-9e7c-3f98e5841827",
                "types": [
                    "core.fan"
                ],
                "interfaces": [
                    "oic.if.baseline"
                ],
                "bitmap": 1,
                "secure": false,
                "port": 0,
                "eps": [
                    {
                        "tps": "coap",
                        "addr": "192.168.1.25",
                        "family": 64,
                        "port": 38630,
                        "pri": 1
                    },
                    {
                        "tps": "coap",
                        "addr": "fe80::b99f:10aa:ae8:c92%25lo",
                        "family": 32,
                        "port": 40833,
                        "pri": 1
                    }
                ]
            }
        ]
    },
    "connType": 65600,
    "identity": [],
    "result": 0,
    "sequenceNumber": 16777216,
    "resourceUri": "/oic/res",
    "rcvdVendorSpecificHeaderOptions": [
        {
            "protocolID": 2,
            "optionID": 12
        },
        {
            "protocolID": 2,
            "optionID": 2053
        }
    ]
}
Received response to GET request:
{
    "devAddr": {
        "adapter": 1,
        "flags": 32,
        "ifindex": 2,
        "port": 40833,
        "addr": "fe80::c7e5:1ab0:4459:479a%eth0"
    },
    "addr": {
        "adapter": 1,
        "flags": 32,
        "ifindex": 2,
        "port": 40833,
        "addr": "fe80::c7e5:1ab0:4459:479a%eth0"
    },
    "connType": 65568,
    "identity": [],
    "result": 46,
    "sequenceNumber": 16777216,
    "resourceUri": "/a/iotivity-node-get-sample",
    "rcvdVendorSpecificHeaderOptions": [
        {
            "protocolID": 2,
            "optionID": 12
        },
        {
            "protocolID": 2,
            "optionID": 17
        },
        {
            "protocolID": 2,
            "optionID": 2049
        },
        {
            "protocolID": 2,
            "optionID": 2053
        }
    ]
}
Received response to GET request:
{
    "devAddr": {
        "adapter": 1,
        "flags": 64,
        "ifindex": 1,
        "port": 38630,
        "addr": "192.168.1.25"
    },
    "addr": {
        "adapter": 1,
        "flags": 64,
        "ifindex": 1,
        "port": 38630,
        "addr": "192.168.1.25"
    },
    "connType": 65600,
    "identity": [],
    "result": 46,
    "sequenceNumber": 16777216,
    "resourceUri": "/a/iotivity-node-get-sample",
    "rcvdVendorSpecificHeaderOptions": [
        {
            "protocolID": 2,
            "optionID": 12
        },
        {
            "protocolID": 2,
            "optionID": 17
        },
        {
            "protocolID": 2,
            "optionID": 2049
        },
        {
            "protocolID": 2,
            "optionID": 2053
        }
    ]
}

from iotivity-node.

gabrielschulhof avatar gabrielschulhof commented on August 17, 2024

OCSetDeviceInfo() is deprecated. I'll update the example to use OCSetPropertyValue(), and I'll ask you to try again, because I don't have the hardware to reproduce.

from iotivity-node.

gabrielschulhof avatar gabrielschulhof commented on August 17, 2024

@dbkinder could you please replace server.envirophat.ocf.js with this version and try again?

from iotivity-node.

dbkinder avatar dbkinder commented on August 17, 2024

Nope:

/home/pi/workspace/iotivity-node/js/envirophat/server.envirophat.ocf.js:169
		csdk.OC_RSRVD_DATA_MODEL_VERSION, "abc.0.0.1" ].join( "," ) );
		                                  ^^^^^^^^^^^

SyntaxError: missing ) after argument list
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

Thinking the ].join( "," ) shouldn't be there, I removed that and tried again:

/home/pi/workspace/iotivity-node/js/envirophat/server.envirophat.ocf.js:169
		csdk.OC_RSRVD_DATA_MODEL_VERSION, "abc.0.0.1" );
		^

ReferenceError: csdk is not defined
    at main (/home/pi/workspace/iotivity-node/js/envirophat/server.envirophat.ocf.js:169:3)
    at Object.<anonymous> (/home/pi/workspace/iotivity-node/js/envirophat/server.envirophat.ocf.js:180:1)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

from iotivity-node.

gabrielschulhof avatar gabrielschulhof commented on August 17, 2024

@dbkinder thanks for trying it out! I fixed the file now, and I added it to the linter script so I can avoid such syntax errors. Could you please grab the file again, and give it another whirl?

from iotivity-node.

dbkinder avatar dbkinder commented on August 17, 2024

That worked better. No syntax errors :)
But I don't think the sample is doing what's expected.
Here's the output from running the server in one terminal window:

pi@raspberrypi:~/workspace/iotivity-node/js/envirophat $ node server.envirophat.ocf.js
[ main ]: Starting OCF stack in server mode
[ main ]: Registering device and platform information
[ main ]: creating resources
[ createResources ]: Created resource with result: 0
[ main ]: Server ready

And then the client in another terminal window:

pi@raspberrypi:~/workspace/iotivity-node/js/envirophat $ node client.envirophat.ocf.js 
[InterfaceConfig] In
[main] Starting OCF stack in client mode
[main] Issuing discovery request
[discoverResources]: In
[discoveryReqCB] Received response to DISCOVER request:
[discoveryReqCB] Received response to DISCOVER request:
[discoveryReqCB]: found led resource
[discoveryReqCB]: enter 0,1,2,3,4 or Ctrl+c
[discoveryReqCB] Received response to DISCOVER request:
[discoveryReqCB]: found led resource
[discoveryReqCB]: enter 0,1,2,3,4 or Ctrl+c
[ProcessKey] key = 0
[InitPostRequest] key: 0
[payloadCreate] state: 0
[responseCallback] Received response to request with result: 46
undefined
[ProcessKey] key = 1
[InitPostRequest] key: 1
[payloadCreate] state: 1
[responseCallback] Received response to request with result: 46
undefined
[ProcessKey] key = 2
[InitGetRequest] key: 2
[payloadCreate] state: 2
[responseCallback] Received response to request with result: 46
undefined
[ProcessKey] key = 3
[InitGetRequest] key: 3
[payloadCreate] state: 3
[responseCallback] Received response to request with result: 46
undefined
[ProcessKey] key = 4
[InitGetRequest] key: 4
[payloadCreate] state: 4
[responseCallback] Received response to request with result: 46
undefined
[ProcessKey] key = �
[ProcessKey] SIGINT: Quitting the app gracefully...

I pressed 0, 1, 2, 3, and 4 and got the same response and no obvious changes to the EnviroPhat LEDs at any time. There was no output in the server window other than what's shown above.

So, the sample doesn't seem to be doing what's advertised.

from iotivity-node.

gabrielschulhof avatar gabrielschulhof commented on August 17, 2024

The requests are being denied. I'm guessing you're running version 1.3.1 of iotivity-node. Then you need to set up access control files before you can run the sample.

https://github.com/otcshare/iotivity-node/blob/master/js/README.md has instructions for creating the necessary files.

from iotivity-node.

dbkinder avatar dbkinder commented on August 17, 2024

I followed the instructions Rami provided here: https://github.com/otcshare/iotivity-node/tree/master/js/envirophat (no mention of the instructions you referenced). I see the first step of your instructions say, "In addition to iotivity-node, build iotivity with SECURED=1 and RD_MODE=all. Let the root of the iotivity repository be $iotivityRoot." but there are no command line instructions showing how to do that :(

from iotivity-node.

gabrielschulhof avatar gabrielschulhof commented on August 17, 2024

I modified the first instruction to point to https://wiki.iotivity.org/build. I also added a step to the envirophat instructions referring to the COAPS instructions.

Please have a look at

https://github.com/gabrielschulhof/iotivity-node/blob/gh-165/js/README.md

and

https://github.com/gabrielschulhof/iotivity-node/blob/gh-165/js/envirophat/README.md

from iotivity-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.