Skip to content

A Raspberry Pi-powered light-based alarm clock for toddlers

License

Notifications You must be signed in to change notification settings

avonmoll/pi-clock

Repository files navigation

pi-clock

A Raspberry Pi-powered light-based alarm clock for toddlers

pi-clock_schematic

Red means stay asleep!

Green means it's time to wake up!

Installation

$ git clone https://github.com/avonmoll/pi-clock/
$ cd pi-clock
$ sudo npm install

(sudo may be necessary if installing directly on RPi)

Usage

Choose one of the following and then navigate to <hostname>.local:3000:

pm2 (Recommended)

Install pm2:

$ sudo npm install -g pm2

Configure startup by running the following and then executing the last line of the output:

$ pm2 startup

Start app and save so pm2 will start the app on reboot:

$ sudo pm2 start server.js -o out.log --name pi-clock
$ pm2 save

cron

The following command adds an entry to the root crontab to run the app on reboot.

$ sudo echo "@reboot root cd /home/<path-to>/pi-clock && sudo node server.js >> log 2>&1 &" >> /etc/crontab
$ sudo reboot

Materials

Tools

  • Soldering iron (for the I2C backpack)

References

Build & development

Run grunt for building and grunt serve for preview.

Testing

Running grunt test will run the unit tests with karma.


The web server was scaffolded with yo angular generator version 0.15.1.