Coder Social home page Coder Social logo

wakeup_pi's Introduction

wakeup_pi

Scripts for a controllable Wakeup Light build with a Raspberry Pi and a Govee LED

  • Written for Raspberry Pi
  • I am not a programmer. This is very messy code but it works every morning. You are nonetheless welcome to contribute to this code.

requirements:

python3 govee_btled from Freemanium: https://github.com/Freemanium/govee_btled

installation

  1. update your pi, this prevents bluetooth issues
  2. install the requirements from above and test if the LED ist reacting with the test script in the govee_btled repository
  3. copy both files to your /home/pi/ directory
  4. change all the MAC-Adresses in the scripts to the MAC-Adress of your Govee Bluetooth LED (how to find it: see below)
  5. modify the start and end time for the wakeup time and test the script with "python3 wake_up_service.py"
  6. add a systemd service for automatic startup (see below)
  7. add a restart at 2 or 3 o'clock in the night to prevent hangs in the bluetooth engine. It's a common problem of raspberry pis

find MAC-adress of your LED

Use the command "bluetoothctl" After firing it up tpye "scan on" and wait for a line like this one:

[NEW] Device XX:XX:XX:XX:XX:XX Minger_H6001_3E2C

Or another name like Govee. The identifier with lots of ":" is your MAC-adress

systemd service for automatic start and restart in case the script hangs

  1. sudo nano /etc/systemd/system/wake_up.service

add the following code:

[Unit]
Description=wake_up
Wants=graphical.target
After=graphical.target
Requires=bluetooth.target

[Service]
Type=simple
ExecStartPre=/usr/bin/xset -dpms
ExecStart=/usr/bin/python3 /home/pi/wake_up_service.py
Restart=always
RestartSec=20
User=pi
Group=pi

[Install]
WantedBy=graphical.target
  1. sudo systemctl enable wake_up.service

wakeup_pi's People

Contributors

nils-se avatar

Watchers

 avatar

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.