Sorry guys, was out of the country with limited access.
Did you try running npm install within the root dir ?
If yes, run npm install debug and let us know what happens.
Tks
RD
Sorry guys, was out of the country with limited access.
Did you try running npm install within the root dir ?
If yes, run npm install debug and let us know what happens.
Tks
RD
This is what I got when running npm install
Matthews-Mac-mini:/ matthew$ npm install
npm ERR! install Couldnât read dependencies
npm ERR! package.json ENOENT, open '/package.jsonâ
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm canât find a package.json file in your current directory.
npm ERR! System Darwin 15.3.0
npm ERR! command ânodeâ â/usr/local/bin/npmâ "install"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0
Matthews-Mac-mini:/ matthew$ sudo npm install debug
debug@2.2.0 node_modules/debug
âââ ms@0.7.1
Ok, you got debug. Tried to run after that ? What happened ?
Sorry a little confused. Are you asking what happened I try to run npm install debug after that or if I try running node server.js now?
Yes. After running npm install debug, try running node server.js. Then, open your browser and run http://youripaddress:3000/api/status
After running npm install debug, I ran node server.js again and now i get this error:
Matthews-Mac-mini:~ matthew$ node server.js
module.js:340
throw err;
^
Error: Cannot find module '/Users/matthew/server.jsâ
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
You are probably running node outside the project directory. Run a ls -l and check if you have server.js on your directory.
When you clone the project, you should see a augustctl dir.
Let me know.
Here are the results when I run Is -I
Matthews-Mac-mini:~ matthew$ ls -l
total 56
drwxr-xr-x 8 matthew staff 272 Feb 9 08:30 Applications
drwxr-xr-x@ 5 matthew staff 170 Mar 28 06:12 Applications (Parallels)
drwx------@ 3 matthew staff 102 Jan 29 2015 Creative Cloud Files
drwx------+ 14 matthew staff 476 Mar 28 11:04 Desktop
drwx------+ 45 matthew staff 1530 Mar 28 01:07 Documents
drwx------@ 65 matthew staff 2210 Mar 22 14:49 Library
drwx------+ 8 matthew staff 272 Mar 3 03:32 Movies
drwx------+ 8 matthew staff 272 Mar 3 03:32 Music
drwx------+ 11 matthew staff 374 Mar 22 14:38 Pictures
drwxr-xr-x+ 5 matthew staff 170 Oct 23 2014 Public
drwxr-xr-x 15 matthew staff 510 Mar 28 11:32 augustctl
drwxr-xr-x 10 matthew staff 340 Mar 28 09:26 augustlock-smartthings
drwx------ 39 matthew staff 1326 Feb 2 07:37 logs
drwxr-xr-x 3 matthew staff 102 Mar 28 12:14 node_modules
drwxr-xr-x 2 root staff 68 Mar 28 11:07 tmp
You are in the wrong directory. Note node_modules is in your root directory, thatâs why it is not working.
run:
cd augustctl
npm install
node server.js
PS: remember to edit config.json according to the specification set on the page - you need to get your device id from your phone.
OK I have run the commands you gave me. Changed Directories ran npm install.
Now when I run node server.js I get a new error.
Matthews-Mac-mini:augustctl matthew$ node server.js
module.js:340
throw err;
^
Error: Cannot find module 'asyncawait/awaitâ
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/matthew/augustctl/server.js:6:13)
at Module._compile (module.js:456:26)
at Object.Module._extensionsâŚjs (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
And my config.json is in the directory and looks like this:
{âaddressâ: â192.168.0.9â, âofflineKeyâ: â01234567890abcdefâ, âofflineKeyOffsetâ: 1 }
but with my correct values.
Sorry to be a pain with all this stuff. Pretty new to all this node.js.
Well, you are almost there, but there are a few things yet. See the steps below:
1- run npm install asyncawait
2- You need to edit config.json to reflect things. You are just using the default file:
2.1 - âaddressâ must be your local ip address - run an ifconfig to find yours, or follow this link here to find out: http://www.howtogeek.com/236838/how-to-find-any-devices-ip-address-mac-address-and-other-network-connection-details/
2.2 - âofflineKeyâ must be the key used by your phone to open your lock. There is a process to get this done - in case you use an iphone, see here - look for get your offiline key section - https://github.com/mtvg/August
PS: DONâT post your offlineKey here. This is the key that can be used to access your lock.
Ok ran pm install asyncawait.
Yes I had already updated the config.json to my correct values already. I just posted the default file cause I donât want to send any of my personal data. Wanted to confirm that is the correct format for the file.
Now I am getting an error for the config.json thats why I wanted to confirm mine is correct:
Matthews-Mac-mini:augustctl matthew$ node server.js
module.js:485
throw err;
^
SyntaxError: /Users/matthew/augustctl/config.json: Unexpected token o
at Object.parse (native)
at Object.Module._extensionsâŚjson (module.js:482:27)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/matthew/augustctl/server.js:8:14)
at Module._compile (module.js:456:26)
at Object.Module._extensionsâŚjs (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
It is supposed to be like this correct?
{âaddressâ: â192.168.0.9â, âofflineKeyâ: â01234567890abcdefâ, âofflineKeyOffsetâ: 1 }
where I replace the 192.168.0.9 with the IP of my Mac running the terminal command?
The offlinekey and offlinekeyOffset I got from extracting the backup from my phone.
Donât know if I am missing anything in the file or that is has the correct syntax.
There must be a quote missing. Can you double-check ? It is a simple json file
Must be:
{âaddressâ: â192.168.0.1â, âofflineKeyâ: âkeyâ, âofflineKeyOffsetâ: 1 }
Double checked it and mine looks pretty much the same
{âaddressâ: "192.168.11.11â, âofflineKeyâ: âmykeyâ, âofflineKeyOffsetâ: 1 }
Donât know what else it could be.
Not really. Note the quote on your ip address (after the 11) - itâs not a quote - itâs another character. Paste that in a text editor and youâll note. Fix to:
{âaddressâ: â192.168.11.11â, âofflineKeyâ: âmykeyâ, âofflineKeyOffsetâ: 1 }
I think that did it!! Thanks!
now when i run node server.js I get:
Matthews-Mac-mini:augustctl matthew$ node server.js
Listening at {âaddressâ:â192.168.11.11â,âfamilyâ:âIPv4â,âportâ:3000}
My only problem now is that when I go to http://192.168.11.11:3000/api/status I get service unavailable in the browser. And in terminal I get
GET /api/status 503 3.117 ms - 19
GET /api/status 503 0.414 ms - 19
Any suggestions for that?
Somehow your Mac wasnât able to find your lock:
Only possibilities:
1- Make sure your bluetooth is enabled;
2- Make sure you are close enough to your door;
3- Double check your offlineKey;
If none works, then we might need to enable debug and check whatâs wrong.
I think it might be my range from the lock. It mostly times out but periodically I get:
{âstatusâ:0,âretâ:âlockedâ,âmsgâ:âCommand completed.â}
So it looks like it is mostly working. Is there anything else I have to do to get the Device set up in my App besides adding the local IP and 3000 port from the Mac running the terminal?
It seems to always just show as Waiting
Did you configure your ip address on the smartThings side ? Especially the last option in the list.