ladies-first-chicken-door
Ladies First Chicken Door Control
This is a small webservice for controlling the ladies first chicken door remotely
returns a status object
{
"state": "sensor",
"close_line": 22,
"close_active": false,
"open_line": 5,
"open_active": false
}
Open the door:
- POST http://hostname:3000/api/ladiesfirst/door/open
- accepts:
open
,close
,sensor
- accepts:
Building image
I have an image at stakach/ladiesfirst that you can use (see docker-compose.yml)
docker buildx build --progress=plain --label org.opencontainers.image.title=ladiesfirst --platform linux/arm64 --tag stakach/ladiesfirst:latest --push .
Deploying
Designed to run on a raspberry pi zero or zero 2 wireless with a relay hat
Configuring the pi from scratch:
- Use the Raspberry Pi Imager
- configure with Raspberry Pi OS (other) -> Raspberry Pi OS Lite (64bit)
- log into the OS and update:
sudo apt update && sudo apt install -y
- Install docker-compse
- https://docs.docker.com/engine/install/debian/#install-using-the-repository
- sudo apt install docker-compose
- https://docs.docker.com/engine/install/linux-postinstall/
- git clone https://github.com/stakach/ladies-first-chicken-door
- cd ladies-first-chicken-door
- ./scripts/setup_gpio.sh
- docker-compose up -d
- setup door_boot.service to launch boot_script.sh to ensure the door is in the correct state on boot
Customise docker-compose.yml to match your setup as required. The setup script configures access to the hardware using udev
so it can be used from within the docker container. The docker image is highly secure by default.
Documentation
Relay channels 1 and 2 are connected with pin numbers 15 and 29 of the Raspberry Pi GPIO respectively according to the relay hat details
So given the pinout:
and given the output from running gpioinfo
(install via sudo apt install gpiod libgpiod-dev
) we can determine the lines that the relays run on.
- Relay channel 1 == pin15, GPIO22 (line 22)
- Relay channel 2 == pin29, GPIO5 (line 5)
ladies-first-chicken-door
- 1
- 0
- 0
- 0
- 6
- 10 months ago
- October 7, 2023
Thu, 07 Nov 2024 07:32:00 GMT