BedSide Pi
Convert your Raspberry Pi into a smart Bedside Clock.
UPDATE: bedside-pi has been updated to use Node.js with Socket.io rather than Apache with long polling. However, you can still access the Apache Version
General Info
BedSide Pi provides information at a glance.
- Time (Who would've thunk?)
- Current Weather (Optional)
Current Notifications (Optional) (Android Only) (Requires BedSide Pi Companion app)iOS version is in works! We couldn't find a way to mirror notifications from iOS devices.If there's a solution I am missing, please let me know!
Requirements
BedSide Pi requires a bare minimum of
- Raspberry Pi (Tested on RPi 3b and RPi 4b, your mileage may vary) running Raspbian.
- A screen to display the information
Optional Items
- API Key from OpenWeather. This is used to access weather information.
Setting Things Up
Note: This process assumes you have a Raspberry Pi 3. If you have some other model, you might have to change a few things.
1. Setting up Node.js on Pi
-
Installing Node.js
If you haven't done so in a while, run the following commands:
sudo apt update sudo apt upgrade
Now your Pi is ready to go. Use the following commands to install Node and npm:
Install Node:
sudo apt install nodejs sudo apt install npm
Test Node:
node -v
Now that Node.js is successfully setup on Pi, we can continue to the next step.
2. Setting up BedSide Pi
-
Download this project:
Either clone this project or download the entire project as a zip, your wish!
-
Move the files to your Pi:
Move the files to the directory where you want the application to run. Make sure you have write permission in that directory. (For ex. ~/BedSidePi/)
-
Install dependencies:
Open terminal and set your current working directory as the directory chosen above.
For example
cd ~/BedSidePi
Once the current directory has been set, run the following command:
npm install
You should see the dependencies install to the working directory.
-
(Optional) Change to 24-hr Clock:
Go to assets/js/script.js on your server, and change
clock24hrs
totrue
.
3. Setting up weather (or removing it)
-
Setting up weather:
- Sign up and get an API key from OpenWeather
- Open modules/prefs.js on your RPi
- Copy the API key from OpenWeather to
apiKey
(Note: Enclose in single quotes) - Set your location to your current location
- (Optional) Set
lang
to your preferred language - (Optional) Open assets/js/script.js on your web server and set
weatherInterval
-
Removing weather:
- Open views/index.html on your web server
- Comment out the div which contains weather information
- Open assets/js/script.js on your web server
- Follow the comments at line 63
4. Running bedside-pi:
Run the following command from the directory where project lives:
npm start
Leave the terminal window running and use a web browser to navigate to http://localhost:8080.
And that is it, enjoy your BedSide Pi!!
License
"THE BEER-WARE LICENSE" (Revision 42):
AvichalRakesh wrote this project. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Avichal Rakesh