NOTE: This project has been integrated directly into Lichess.org . Please visti:
https://lichess.org/dgt
OLD README
Play on Lichess.org using your DGT Electronic Board as input. Incoming moves can be played on audio devices or displayed on the screen. This code can easily be adaptaed to play with other boards.
The program works by connecting to Lichess via the Board API set of APIs, and to the DGT Board by opening a websocket connecting to the free LiveChess 2.2 which is the software DGT developed to broadcast tournaments. When moves are played on the board the program will detect those and send them to Lichess, and moves played on lichess by your opponent will be announced on screen and by audio, and they need to be executed on the board manually. Text to speech is provided by the Browser, and several languages are supported.
If you just want to play using your DGT Electronic Board on Lichess.org you can just visit the GitHub Page for this project and play from there.
https://andrescavallin.github.io/lichess-dgt-boards-browser/
There is no need to download this project or to install anything else except LiveChess 2.2.5 or later as explained in the next section.
- DGT Board
- Any DGT Electronic Board including Smart Board, Blue Tooth, USB and Serial Boards [https://www.digitalgametechnology.com/index.php/products/electronic-boards]
- LiveChess 2.2 Software installed, opened and able to see the board [http://www.livechesscloud.com/software/]
- Lichess
- A Lichess.org online account [https://lichess.org/signup]
- A Lichess API Token with the following scopes
[https://lichess.org/account/oauth/token/create?scopes[]=board:play&scopes[]=preference:read&scopes[]=challenge:read&scopes[]=challenge:write&scopes[]=msg:write&description=DGT+Board]
- Play games with the board API
- Read preferences
- Read incoming challenges (coming soon)
- Create, accept, decline challenges (coming soon)
- Send private messages to other players (coming soon)
- oAuth not currently supported, only API Token. See Above
Explanation of each value
- Lichess base URL (baseURL)
The base URL for Lichess. Use https://lichess.org unless you need to target development environments or your own Lichess fork.
- Lichess API Access Token (personalToken)
This is your lichess token obtained from Personal API access token
- Verbose
Set this as
false
unless you want to debug connectivity with lihcess or the DGT Board - Announce All Moves
When set to
No
will only announce moves from opponent, when set toYes
, will annouce all moves. - Announce Move Format
Possible values are
san
anduci
. San is nicer but will require more storage for Text To Speech since it includes the name the of the piece, while uci only includes origin and target squares - Voice
The name of the Text To Speech persona used by the browser for generating the audio file.
- "keywords": {...}
This object contains the english words what will be used to tranlate san moves into an announcement. If you want to use spanish for example, replace the values, as in this sample:
"keywords": {
"K": "Rey",
"Q": "Dama",
"R": "Torre",
"B": "Alfil",
"N": "Caballo",
"P": "Peón",
"x": "Por",
"+": "Jaque",
"#": "Jaquemate",
"(=)": "Juego termina en Tablas",
"O-O": "Enroque corto",
"O-O-O": "Enroque largo",
"white": "Blancas",
"black": "Negras",
"wins by": "ganan por",
"timeout": "timeout",
"resignation": "dimisión",
"illegal": "incorrecta",
"move": "jugada"
}
In order to run this code on your own machine you will need an HTTP server. For example:
$ http-server .
Then visit http://localhost:8080/index.html
If you make changes to the code, you will need to run browserify again
$ browserify app.js -o lichess-dgt-boards-browser.js
And then you will need to add this line of code to the generated bundle lichess-dgt-boards-browser.js
exports.speechSynthesis = speechSynthesis;
at line number 25373 before exports.log = log; . It will look something like this:
exports = module.exports = require('./debug');
exports.speechSynthesis = speechSynthesis;
exports.log = log;
exports.formatArgs = formatArgs;
Failing to add the line exports.speechSynthesis = speechSynthesis; will result in that speech synthesis will always play witht he default voice.
- MIT license
- Developed during April - August 2020