Giter Club home page Giter Club logo

square-off-remote's Introduction

square-off-remote

This is my attempt at controlling a Grand Kingdom chess set from Square Off, directly from my PC instead of through the offical app.

Working:

  • Moves
  • AI vs AI games
  • Human vs AI games
  • Voice control
  • Lichess tournament (watch recent games)
  • Play on Lichess (experimental, see below)

Todo:

  • Start position from FEN
  • Reset board to initial position

Lichess games howto:

  • Login to Lichess and create an access token
  • Create the file credentials.py with the line LICHESS_BOARD_ACCESS_TOKEN="lip_xxxxxx", with the token you generated
  • Run python lichess_board.py, wait for the Listening for game start message
  • Start a game on Lichess (I recommend playing versus stockfish for testing)

License

GPL-3.0-or-later

square-off-remote's People

Contributors

eqikkwkp25-cyber avatar greghope667 avatar

Stargazers

 avatar

Watchers

 avatar

square-off-remote's Issues

[Todo] Add experimental stream of finished games from broadcasts to Square Off GKS using Lichess API

Hello @greghope667 ,

I see you are active before Christmas, I'll take a look at the changes right away :-)

Even if I don't see myself as a developer, here is my contribution. Since I can't upload files directly, it might work with an issue and pull request, otherwise I'll just paste the code here. Please review and fine tune.

Thanks to you.

p.s. Issue is not needed for a PR, just a fork of your repository.

[ Issue] lichess_board.py : ConnectionResetError: [Errno 104] Connection reset by peer

I got below error

env) pi@raspberrypi:~/devel/square-off-remote $ python3 lichess_board.py 
Searching for device...
Found device, connecting...
Connected
Connected, battery =  2-80
Listening for game start event...
Traceback (most recent call last):
  File "/home/pi/devel/square-off-remote/lichess_board.py", line 90, in <module>
    main()
  File "/home/pi/devel/square-off-remote/lichess_board.py", line 63, in main
    game_details = find_game()
                   ^^^^^^^^^^^
  File "/home/pi/devel/square-off-remote/lichess_board.py", line 31, in find_game
    for event in stream("/api/stream/event"):
  File "/home/pi/devel/square-off-remote/lichess_board.py", line 23, in stream
    response = request(endpoint)
               ^^^^^^^^^^^^^^^^^
  File "/home/pi/devel/square-off-remote/lichess_board.py", line 13, in request
    conn.request(method, endpoint, headers=headers)
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 1075, in _create
    self.do_handshake()
  File "/usr/lib/python3.11/ssl.py", line 1346, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
Device was disconnected

bleak bluezdbus client.py:168: RuntimeWarning: coroutine 'Communicator._handle_disconnect' was never awaited

Hello,

first of all: Thank you. Second: Let me join the 'avoid the square off app' party :-)

Currently, I understand that 'python3 game.py' should start a stockfish versus random-move game. Unfortunately I get random errors from time to time as below and I could not find anything in the internet, looks like a random disconnection? Any hints are welcome. Thank you.

python3 game.py Searching for device... Found device, connecting... Connected Connected, battery = 2-90 * e2e4 f7f6 d2d4 b7b5 f1b5 h7h6 d1h5 .../square-off-remote/venv/lib64/python3.11/site-packages/bleak/backends/bluezdbus/client.py:168: RuntimeWarning: coroutine 'Communicator._handle_disconnect' was never awaited self._disconnected_callback() RuntimeWarning: Enable tracemalloc to get the object allocation traceback

[Todo] Implementation of Human Move Registration

Hello,

i will write down my attempts to understand how the GKS registers a human move and (hopefully) writes it to some temporary bluetooth register. If i am not wrong that is currently a missing key feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.