Skip to content

glasgowhackerspace/doorbell

Repository files navigation

Glasgow Hackerspace Doorbell Bot

A Discord bot to ring a bell in the Glasgow Hackerspace when @doorbell is mentioned. The code is written in Python and designed to run on a Raspberry Pi Zero 2W.

Hardware setup

.stl files for a frame to mount the bell, and a stand to mount the servo are included under the 3d_files directory. Everything was mounted into an IKEA VÄSTANHED photo frame.

Software Setup

Deploying this project to a pi has been automated with Ansible. See deploy.md.

The bot requires a token to access the Discord API. You need a Discord dev account to generate this token: https://discord.com/developers/ Once generated, these details should be entered into a .env file following the format of the .env.template file in this repo.

If you don't want to use Ansible the following steps should achieve the same thing.

Manual setup

# create a new user, add it to the required groups
useradd -m ding
usermod -a -G gpio,spi ding
# clone the code into the ding users home directory
su ding
cd /home/ding
git clone --recurse-submodules https://github.com/glasgowhackerspace/doorbell.git
# set up the python environemnt and dependencies
cd doorbell
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
# configure the services
su <your normal username>
pigpiod
ln -s /home/ding/doorbell/doorbell_bot.service /etc/systemd/system/doorbell_bot.service
systemctl enable doorbell_bot
systemctl start doorbell_bot
# if you want the shutdown button to work
echo "dtoverlay=gpio-shutdown" | sudo tee -a /boot/firmware/config.txt
reboot

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages