Clone this repository on your chicken's server with the following command :
git clone https://github.com/Sylchauf/smart-kotkot.gitThen, install the following requirements.
- Docker (Installation)
- Docker-compose (Installation on x64/x86 or Installation on raspbian)
docker-compose upYour module is now live at http://YOUR_LOCAL_IP:3000
Smart KotKot configuration is in the /state directory and is composed of multiples files :
config.jsonis the general configuration file. Clone the sample file in the/state_sampledirectory and edit it before running the application. All configurations properties is described in Config propertiesdoorState.jsonis the door configuration file. It stores the state of the door (open / close) and the times needed to open and close the door (in seconds). You must write yourself the first state in this file and the time in seconds to open and close the door. Clone the sample file in the/state_sampledirectory and edit it. All configurations properties is described in Door State propertieslightState.jsonis the light configuration file. It stores the state of the light (on or off) and you must write yourself the first state in this file. Clone the sample file in the/state_sampledirectory and edit it. All configurations properties is described in Light State properties
Moves the door up or down.
GET/api/door/upOpen the door entirelyGET/api/door/downClose the door entirely
To initialize your door state, or if the door is not entirely open/closed, small correction movements can be fired.
GET/api/door/calibrate/upMove up the door forconfig.door.correctionSecs (default is 1s)GET/api/door/calibrate/downMove down the door forconfig.door.correctionSecs (default is 1s)
GET/api/door/statusGet the state of the door
Get an array of all initialized camera
GET/api/camera/list
Access to pictures taken by cameras.
Replace {CAMERA_ID} by the id given in the camera list endpoint
Replace {IMAGE_ID} by the id given in the images list endpoint
GET/api/camera/images/{CAMERA_ID}/listGet a list of all images taken.GET/api/camera/images/{CAMERA_ID}/lastGet the last picture taken by this cameraGET/api/camera/images/{CAMERA_ID}/{IMAGE_ID}GET/api/camera/capabilities/{CAMERA_ID}Get the capabilities of this camera
Take a picture on the selected camera.
Replace {CAMERA_ID} by the id given in the camera list endpoint
GET/api/camera/images/{CAMERA_ID}/takeGet a list of all images taken.
GET/api/light/onTurn the light onGET/api/light/offTurn the light off
GET/api/light/statusGet the state of the light
echo 'SUBSYSTEM=="usb", MODE="0660", GROUP="plugdev"' > /etc/udev/rules.d/00-usb-permissions.rules
udevadm control --reload-rulesdocker buildx build --platform linux/arm/v6,linux/arm/v7,linux/amd64,linux/arm64 -t sylchauf/smart-kotkot-module:latest --push .