Skip to content

A Raspberry Pi-based alarm clock that drives a light

Notifications You must be signed in to change notification settings

kutmasterk/pi_alarm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Alarm Clock

This project takes a Raspberry Pi and, web-enabling it, turns it into an alarm clock. The Pi controls a daylight lamp connected to a Revolt PX-1672 RC plug.

The alarm is configured through a web interface, and has been optimized for both desktop and mobile. Instructions for building it below!

Web Mobile1 Mobile2 Mobile3

Much thanks to ajpierce for his original work, which i effortless forked and edited to suit my needs.

Install Prerequisites

Install git aso we can check out the code.

sudo apt-get update
sudo apt-get install git 

Next, install virtualenv for python by following the Initial Setup section of this guide.

Install Alarm Software

First, become root. Then, navigate to the directory in which the code will live, and create a virtual environment:

sudo su -
cd /opt
virtuanenv pi_alarm_env
cd pi_alarm_env

Next, check out the project from git, and install the python libraries:

git clone https://github.com/pizzaboy75/pi_alarm.git
./pi_alarm/script/setup.sh

Fire up the software!

As root,

cd /opt/pi_alarm_env/pi_alarm
./run.py

If all goes well, you the Flask webserver should let you know that the application is running on 0.0.0.0:99.

Navigate to the IP address Port 99 of your Raspberry Pi from a browser on another computer (or your mobile phone).

Configure the server to run on boot

To ensure the alarm starts on boot, create the following file with this content:

/lib/systemd/system/pi-alarm.service

[Unit]
Description=PI Alarm Clock
After=network.target

[Service]
Type=idle
ExecStart=/usr/bin/python /opt/pi_alarm_env/pi_alarm/run.py

[Install]
WantedBy=multi-user.target

Next, enable it:

sudo systemctl enable pi-alarm

About

A Raspberry Pi-based alarm clock that drives a light

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 55.8%
  • HTML 22.1%
  • CSS 11.4%
  • JavaScript 5.0%
  • Shell 3.6%
  • OpenEdge ABL 2.1%