haklein / certabo-lichess

lichess.org board API client for the CERTABO physical USB chess board
27 stars 8 forks source link

lichess.org board API client for CERTABO.com physical boards

This is a python3 based lichess board API client program for CERTABO physical boards. It's a proof of concept and probably still has some rough edges.

Requirements

Lichess API token

The API token can be created in the lichess preferences page ("API Access tokens"). Generate a personal access token and make sure to enable "Play games with the board API". Store the token in a file named 'lichess.token' in the same directory.

python3 modules

see requirements.txt. You can install the modules via pip3 install --user -r requirements.txt

simplejson must not be installed as it doesn't work with berserk

virtual com port driver

On the mac you need to install the Silabs virtual com port driver. It can be downloaded from the CERTABO website: https://www.certabo.com/download/

calibration

Calibration (mapping the chip IDs to pieces) can be run with the optional --calibrate command line argument. Make sure to have the pieces on the correct places before. If you want to add further pieces to the calibration, use the --addpiece argument (e.g. for adding a 2nd pair of queens, or adding multiple sets in different styles).

Usage

General

Run the python script, and start a game on Lichess that is compatible with the board API (not all speeds are supported, also depending if it is a rated game or not). Correspondence games are skipped by default, if you want to play them, use the --correspondence argument. The current games are ordered by lichess by importance. This script picks the first item (hence the game with the highest priority) from from that list. If there is no current game, it waits until a new game is created on lichess.

Command line arguments

Todo

License

This project is licensed under the GPL v3 license