Skip to content
This repository was archived by the owner on Jun 13, 2019. It is now read-only.
This repository was archived by the owner on Jun 13, 2019. It is now read-only.

Errors running EnviroPhat example #165

@dbkinder

Description

@dbkinder

Following instructions at https://github.com/otcshare/iotivity-node/blob/master/js/envirophat/README.md went along OK through the command-line testing of the EnviroPhat LEDs. The next step failed:

pi@raspberrypi:~/workspace/iotivity-node/js $ node server.envirophat.ocf.js
module.js:487
    throw err;
    ^

Error: Cannot find module '/home/pi/workspace/iotivity-node/js/server.envirophat.ocf.js'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

because the instructions put us in the wrong directory (should be down one more in the ~/workspace/iotivity-node/js/envirophat directory. But even if we're in the right directory, starting up the server fails:

pi@raspberrypi:~/workspace/iotivity-node/js $ cd envirophat/
pi@raspberrypi:~/workspace/iotivity-node/js/envirophat $ ls
client.envirophat.ocf.js  enviro_phat.py  README.md  server.envirophat.ocf.js
pi@raspberrypi:~/workspace/iotivity-node/js/envirophat $ node server.envirophat.ocf.js
[ main ]: Starting OCF stack in server mode
[ main ]: Registerign device and platform information
/home/pi/workspace/iotivity-node/js/envirophat/server.envirophat.ocf.js:175
	iotivity.OCSetDeviceInfo( deviceInfo );
	         ^

TypeError: iotivity.OCSetDeviceInfo is not a function
    at main (/home/pi/workspace/iotivity-node/js/envirophat/server.envirophat.ocf.js:175:11)
    at Object.<anonymous> (/home/pi/workspace/iotivity-node/js/envirophat/server.envirophat.ocf.js:183: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

Not sure what to do now?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions