Clone this repository on your chicken's server with the following command :
git clone https://github.com/Sylchauf/smart-kotkot.git
Then, install the following requirements.
- Docker (Installation)
- Docker-compose (Installation on x64/x86 or Installation on raspbian)
docker-compose up
Your 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.json
is the general configuration file. Clone the sample file in the/state_sample
directory and edit it before running the application. All configurations properties is described in Config propertiesdoorState.json
is 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_sample
directory and edit it. All configurations properties is described in Door State propertieslightState.json
is 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_sample
directory and edit it. All configurations properties is described in Light State properties
Moves the door up or down.
GET
/api/door/up
Open the door entirelyGET
/api/door/down
Close 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/up
Move up the door forconfig.door.correctionSec
s (default is 1s)GET
/api/door/calibrate/down
Move down the door forconfig.door.correctionSec
s (default is 1s)
GET
/api/door/status
Get 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}/list
Get a list of all images taken.GET
/api/camera/images/{CAMERA_ID}/last
Get 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}/take
Get a list of all images taken.
GET
/api/light/on
Turn the light onGET
/api/light/off
Turn the light off
GET
/api/light/status
Get the state of the light
echo 'SUBSYSTEM=="usb", MODE="0660", GROUP="plugdev"' > /etc/udev/rules.d/00-usb-permissions.rules
udevadm control --reload-rules
docker buildx build --platform linux/arm/v6,linux/arm/v7,linux/amd64,linux/arm64 -t sylchauf/smart-kotkot-module:latest --push .