NOTE: This project has been integrated directly into Lichess.org . Please visti:
https://lichess.org/dgt
OLD README
NOTE: A newer browser version to play without installing any additional software and with a simpler configuration has been created. Just visit this link for that version:
https://andrescavallin.github.io/lichess-dgt-boards-browser/
Improvements will be made to the new browser version only. The GitHub project can be found here: https://github.com/andrescavallin/lichess-dgt-boards-browser
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 IBM Watson, and several languages are supported.
- 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
- This Application
- Node.js v12.16.2 LTS or Above [https://nodejs.org/]
- Install all dependencies by using
>npm install
on this app folder - In the future stand alone executable will be provided
- Text To Speech
- Command line audio player
- On Mac OS X afplay is already present
- On Windows 10 get cmdmp3 [https://github.com/jimlawless/cmdmp3]
- On Linux or practically any OS get mpg123 [http://mpg123.org/]
- IBM Cloud Account
- IBM Cloud - Free Watson Text to Speech Account [https://www.ibm.com/cloud/watson-text-to-speech]
- IBM Cloud API Key [https://cloud.ibm.com/iam/apikeys]
- Command line audio player
- Companion Web App
- Pending/TODO a Companion Web App to see clock and Text To Speech on Mobile Phone or Tablet next to the physical DGT Board.
This a sample content of
config.json
that needs to be on the same path as the app.js file. All values are valid except for thepersonalToken
andWatson_APIKEY
that you need to obtain yourself and update this file.
config.json
{
"baseURL": "https://lichess.org",
"personalToken": "__Your Token__",
"verbose": false,
"announceAllMoves": false,
"announceMoveFormat": "san",
"splitWords": false,
"voice": "Allison",
"availableVoices": {
"Allison": "en-US_AllisonV3Voice",
"Michael": "en-US_MichaelV3Voice",
"Sofia": "es-LA_SofiaV3Voice",
"Enrique": "es-ES_EnriqueV3Voice",
"Renee": "fr-FR_ReneeV3Voice",
"Francesca": "it-IT_FrancescaV3Voice"
},
"Watson_APIKEY": "__Your APIKEY__",
"audioFormat": "mp3",
"windowsAudioPlayer": "./audioplayer/cmdmp3/cmdmp3.exe",
"keywords": {
"K": "King",
"Q": "Queen",
"R": "Rook",
"B": "Bishop",
"N": "Knight",
"P": "Pawn",
"x": "Takes",
"+": "Check",
"#": "Checkmate",
"(=)": "Game ends in draw",
"O-O": "Castles kingside",
"O-O-O": "Castles queenside",
"white": "White",
"black": "Black",
"wins by": "wins by",
"timeout": "timeout",
"resignation": "resignation",
"illegal": "illegal",
"move": "move"
}
}
Explanation of each value
-
"baseURL": "https://lichess.org"
The base URL for Lichess. Use https://lichess.org unless you need to target development environments or your own Lichess fork.
-
"personalToken": "Your Token"
This is your lichess token obtained from Personal API access token
-
"verbose": false
Set this as
false
unless you want to debug connectivity with lihcess or the DGT Board -
"announceAllMoves": false
When set to
false
will only announce moves from opponent, when set totrue
, will annouce all moves. -
"announceMoveFormat": "san"
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 -
"splitWords": false
When set to
true
the Text To Speech will generate separete audio file for the name of the pieces and the target squares, saving disk space. This will create a long pause between the name of the piece and the target square that may be a little bit annoying but acceptable. When set tofalse
each san move will become an audio file -
"voice": "Allison"
The name of the Text To Speech persona used by IBM Watson for generating the audio file. The full list can be found at Languages and voices. The voice needs to be added to the object availableVoices that has both the short name and the IBM Watson full name. Like this:
"availableVoices":- "Allison": "en-US_AllisonV3Voice"
- "Michael": "en-US_MichaelV3Voice"
- "Sofia": "es-LA_SofiaV3Voice"
- "Enrique": "es-ES_EnriqueV3Voice"
- "Renee": "fr-FR_ReneeV3Voice"
- "Francesca": "it-IT_FrancescaV3Voice"
-
"Watson_APIKEY": "Your APIKEY"
We are not endorsing IBM Watson Text To Speech in any way, it is just the web service that we selected because of the free tier and because V3 personas sound really real. You will need to signup and then you can request the API Key here
-
"audioFormat": "mp3"
The MIME Type like
wav
ormp3
. The full list of supported formats can be found at Audio formats (accept types) -
"windowsAudioPlayer": "./audioplayer/cmdmp3/cmdmp3.exe"
On MacOS the command line audio player
afplay
is used. But on Windows a tool is needed. This value represents the path to the command line audio player tool. Remember to download this tool for Text To Speech to work on Windows when you want the audio to be played on the host machine. -
"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"
}
- MIT license
- Developed during April - June 2020