Giter VIP home page Giter VIP logo

google_home_starter's Introduction

Google Home Starter Guide

Thanks for looking through this guide! If you have any questions getting this up and running, please feel free to submit an Issue or email me at [email protected].

Getting Started

If you haven't already, install git and node.js on your device.

  1. Fork or clone this repository onto your device.
  2. In your console, run npm install to install the required components.
  3. Run touch .env to create your hidden, gitignored environment config file.
  4. In .env, configure your environment as follows:
    • DEV= TRUE if you are on desktop, or FALSE if you are on your raspberry pi
    • PORT= 8000 for development, 80 or 443 for HTTP or HTTPS
    • PASS= Whatever you want your password to be
  5. Run npm start to launch the server

When you make a POST request to the server, follow this structure: http://ipaddresshere/API/switches/sw1?password=yourpasswordhere

Next Steps

You will want to configure the Python files to suit your project's needs.

To add or edit a switch, go into saveState.json. Use the first switch as a guide, and add a new object to the switches array.

You can serve your own frontend out of the public folder, and it will be accessible on the root route if you make a get request to your IP address.

google_home_starter's People

Contributors

krpeacock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

google_home_starter's Issues

Error to start npm

Hello,

I got follow error message on raspberry Pi. I have not touch file app.js

pi@raspberrypi:~/Proyectos/google_home_starter $ sudo npm start

[email protected] start /home/pi/Proyectos/google_home_starter
node app.js

/home/pi/Proyectos/google_home_starter/app.js:86
let date = new Date();
^^^^
SyntaxError: Unexpected identifier
at Module._compile (module.js:439:25)
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

npm ERR! [email protected] start: node app.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the google_home_controller package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls google_home_controller
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.9.35-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! cwd /home/pi/Proyectos/google_home_starter
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/Proyectos/google_home_starter/npm-debug.log
npm ERR! not ok code 0

Can't setup on my raspberry pi

I followed your README, but I can't make it works.
I start with point 1 and end with point 5 but this is what I get on terminal

Can you help me?

pi@raspberrypi:~/Desktop/google_home_project/google_home_starter $ npm start(node:3705) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

[email protected] start /home/pi/Desktop/google_home_project/google_home_starter
node app.js

events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EACCES 0.0.0.0:80
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1350:19)
at listenInCluster (net.js:1408:12)
at Server.listen (net.js:1492:7)
at Function.listen (/home/pi/Desktop/google_home_project/google_home_starter/node_modules/express/lib/application.js:618:24)
at Object. (/home/pi/Desktop/google_home_project/google_home_starter/app.js:137:5)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)

npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the google_home_controller package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls google_home_controller
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.79-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /home/pi/Desktop/google_home_project/google_home_starter
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/Desktop/google_home_project/google_home_starter/npm-debug.log
npm ERR! not ok code 0
pi@raspberrypi:~/Desktop/google_home_project/google_home_starter $

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.