/lichess-dgt-boards-browser

Enable DGT Electronic Boards to be used to play online on Lichess.org using just your Browser

Primary LanguageJavaScriptMIT LicenseMIT

NOTE: This project has been integrated directly into Lichess.org . Please visti:
https://lichess.org/dgt


OLD README

DGT Logo
Lichess Logo
lichess.org

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 the Browser, and several languages are supported.


Table of Contents


Playing

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.


Requirements

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


Configuration

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 to Yes, will annouce all moves.

  • Announce Move Format

    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

  • 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"
    }

Building

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.


License

License