/lichess-dgt-boards

Play on Lichess.org using your DGT Electronic Board

Primary LanguageJavaScriptMIT LicenseMIT

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


DGT Logo
Lichess Logo
lichess.org

lichess-dgt-boards

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.


Table of Contents


Requirements

Build Status Dependency Status Coverage Status Code Climate Github Issues Pending Pull-Requests Gem Version License Badges


Configuration

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 the personalToken and Watson_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 to true, will annouce all moves.

  • "announceMoveFormat": "san"

    Possible values are san and uci . 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 to false 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 or mp3. 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"
    }

License

License