Updating picochess to latest python chess module 1.11.1 and compiling armv8 stockfish on pi 4B

724 views
Skip to first unread message

Johan Sjöblom

unread,
Oct 20, 2024, 1:13:46 PM10/20/24
to PicoChess
Hi.

Thanks to some hints I have now set up a python and C++ development environment for PI4B and a DGT  chess board. I am using the following:
- Picochess source from Dirk's fork. As I understood images are based on this.
- Python 3.11.2 (latest python version in which old chess python module does not work)
- Latest python chess module 1.11.1
- Latest python tornado module 6.4.1
- Rest of modules still according to requirements.txt in the source (link above)
- An ARCH=armv8 compile of the latest stockfish source
- Dev environment: Visual Code (in a virtual python venv environment)

Maybe someone has done this already. My intention is to upgrade all libraries and make the necessary code changes to Picochess. I started with the two libraries mentioned above and I will test and see how much is "broken". The latest python chess library is a little bit different and its not a mechanical straightforward change (as noted here also)

Any further hints are of course welcome, and I hope I can update the most important libraries. If it works I would need a branch where I could commit this line of work without disturbing the main branch... I would think its much better to make a branch in the existing fork and not create yet another fork?

BR, Johan Sjöblom, Vaasa, Finland

Randy Reade

unread,
Oct 20, 2024, 3:08:01 PM10/20/24
to pico...@googlegroups.com

That's great, Johan. I suspect it will be alot of work. Good luck and thanks for contributing.

Randy


--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/53a2c1fc-0866-48a2-81ee-b897abba4488n%40googlegroups.com.

Johan Sjöblom

unread,
Oct 29, 2024, 9:12:50 AM10/29/24
to PicoChess
Update.

Atfer quite a struggle I now played the first full succesful game on picochess using a DGT board with the latest python and latest chess module upgrade. However, the tornado module upgrade seem to have broken the web page… I have to investigate why… I got the web server started but all the options settings are broken so I cannot change any settings like change engine, system or voice before I fix it. The web chess board does not follow the game yet either… So I still have some work ahead of me.
First I have to find out where the web pages are being produced and if its a combination of flask and javascript pages…
If anyone has hints on any documentation on how the web pages are being produced those hints would be appreciated…

BR, Johan

Randy Reade

unread,
Oct 29, 2024, 9:29:00 AM10/29/24
to pico...@googlegroups.com

Hi Johan,

You probably want to look at server.py and the web folder. I don't know of any documentation on how it works. Hopefully someone knowledgeable can provide some help.

Randy


Dirk

unread,
Oct 29, 2024, 1:55:56 PM10/29/24
to PicoChess
Hi Johan,

that sounds great and really must have been a lot of work! Upgrading to the latest python and chess modules would really help further development of PicoChess.

Unfortunately I don't have real javascript/html/css knowledge - all my changes in this field I have done with the help of AIs like Claude or ChatGPT (really - this could be a great help even for the missing documentation ;-) I am using the free plan but if you even have a paid account than the results might be even better....

Hopefully you will succeed to run the web server with latest tornado upgrade because we could use someone who might even make our web server more responsive for other resolution sand devices (smart phone, Desktop  & tablet),

Randy has mentioned already the relevant files (server.py) and subfolder /picochess/web/  . 

I just asked Claude and ChatGPT for a short overview - maybe this will help a little bit as a first overview (but keep in mind there could be errors in the answer as usual by all AI answers)...

Good luck!
Dirk

CoPilot/ChatGPT:
Thank you for your patience. I've reviewed the repository and here's a detailed analysis of the web server's functionality and structure in PicoChess:
Web Server Structure

The web server in the PicoChess project is primarily built using Python and is structured to facilitate the management and control of chess games played on a Raspberry Pi with various eBoards. The main components of the web server are:

  1. server.py: This is the main script that runs the web server. It handles incoming HTTP requests, manages game sessions, and communicates with the chess engines.

  2. picochess/web/: This directory contains additional files and scripts that support the web server's functionality. It includes HTML templates, JavaScript files, and other resources needed for the web interface.

Web Server Functionality

The web server serves several key functions:

  1. Game Management: The server allows users to start, stop, and manage chess games. It keeps track of game states and updates the web interface accordingly.

  2. Engine Communication: The server communicates with various chess engines to process moves and provide real-time updates to the web interface. This allows users to play against different engines and follow the games on the display.

  3. User Interface: The web server provides a user-friendly interface for controlling the chess games. This includes buttons and controls for making moves, adjusting game settings, and viewing game history.

  4. Real-Time Updates: The server ensures that the web interface is updated in real-time as the game progresses. This includes displaying the current board state, move history, and engine analysis.

Detailed Breakdown
  • server.py: This script initializes the web server, sets up routes for handling HTTP requests, and manages the game sessions. It uses a web framework (likely Flask or Django) to handle requests and serve the web pages.

  • HTML Templates: Located in the picochess/web/ directory, these templates define the structure of the web pages. They include placeholders for dynamic content such as the current board state and game status.

  • JavaScript Files: These files add interactivity to the web interface. They handle user inputs, update the board state, and communicate with the server to fetch real-time data.

  • CSS Files: These files style the web interface, ensuring it is visually appealing and easy to navigate.

How It Works
  1. Starting the Server: The server.py script is executed, which starts the web server and listens for incoming HTTP requests.

  2. Handling Requests: When a user interacts with the web interface (e.g., making a move), the browser sends an HTTP request to the server.

  3. Processing Requests: The server processes the request, updates the game state, and communicates with the chess engine if necessary.

  4. Serving Responses: The server sends back an updated HTML page with the new game state, which the browser renders for the user.

This setup allows users to play chess games on a Raspberry Pi with various eBoards, control the games through a web interface, and follow the games on a display.

I hope this analysis helps! If you have any more questions or need further clarification, feel free to ask.


Claude:
Thank you for providing the link to the picochess repository. I'll analyze the web server structure and functionality, focusing on the server.py file and the contents of the picochess/web/ directory. Here's a detailed breakdown of the web server architecture and how it operates:

1. Server Overview:
The web server for picochess is built using Python and the Flask framework. It's designed to provide a web interface for interacting with the chess computer, allowing users to view ongoing games, control the system, and manage settings.

2. Main Server File (server.py):
The server.py file is the core of the web server. It sets up the Flask application and defines the main routes and functionalities. Key components include:

a. Flask Setup:
- Imports necessary Flask modules and extensions
- Creates the Flask application instance
- Configures CORS (Cross-Origin Resource Sharing) for API access

b. Route Definitions:
- Defines various routes for different functionalities (e.g., /, /api/setup, /api/newgame)
- Each route is associated with a specific function that handles the request

c. WebSocket Integration:
- Uses Flask-SocketIO for real-time communication
- Defines socket events for various chess-related actions (e.g., move pieces, update clock)

d. Chess Engine Integration:
- Interfaces with the chess engine to process moves and game states

e. Configuration Management:
- Handles reading and writing of configuration files

3. Web Directory Structure (picochess/web/):
The web directory contains frontend assets and templates. Key components include:

a. Static Files:
- CSS files for styling
- JavaScript files for client-side functionality
- Images and other assets

b. HTML Templates:
- Base template(s) for overall page structure
- Specific templates for different views (e.g., game board, settings)

c. JavaScript Modules:
- Modules for handling different aspects of the UI (e.g., chessboard interaction, clock display)
- WebSocket client code for real-time updates

4. API Structure:
The server implements a RESTful API structure, with endpoints for various actions:

a. Game Management:
- Starting new games
- Making moves
- Handling game state changes

b. System Control:
- Adjusting settings
- Managing engine parameters

c. Information Retrieval:
- Getting current game state
- Fetching move history
- Retrieving system information

5. Real-time Communication:
WebSockets are used for real-time updates between the server and client:

a. Move Broadcasting:
- When a move is made on the physical board, it's sent to all connected clients

b. Clock Updates:
- Regular updates of player time remaining

c. Game State Changes:
- Notifications for game start, end, or other significant events

6. Security Considerations:
- CORS is configured to control which domains can access the API
- Input validation is likely implemented to prevent malicious data entry

7. Configuration Management:
- The server reads from and writes to configuration files to maintain system settings
- This allows for persistence of user preferences across restarts

8. Integration with Chess Hardware:
- The server likely interfaces with drivers for the electronic chessboard
- It translates physical moves into digital representations and vice versa

9. Chess Engine Communication:
- The server acts as an intermediary between the web interface and the chess engine
- It sends moves to the engine and receives responses, which are then relayed to the user interface

10. Responsive Design:
- The web interface is likely designed to be responsive, working on various device sizes
- This is achieved through CSS media queries and flexible layouts

11. Error Handling:
- The server implements error handling to manage unexpected situations
- This includes invalid moves, connection issues, and other potential problems

12. Logging:
- The server probably includes logging functionality to track events and errors
- This aids in debugging and monitoring system health

In conclusion, the picochess web server is a sophisticated system that bridges the gap between a physical chess computer and a web-based interface. It leverages Flask for routing, WebSockets for real-time communication, and integrates closely with both the chess engine and the electronic board hardware. The modular structure allows for easy maintenance and expansion of features, while the API design enables potential integration with other systems or custom front-ends.

Johan Sjöblom

unread,
Oct 30, 2024, 1:38:01 AM10/30/24
to pico...@googlegroups.com
Wow, thanks Dirk. I had just opened the chat gpt prompt when I saw your mail. I also use the free version. I was just about to take the same AI help to get started!
My strategic thought is indeed to focus on the future possibilities and enable anyone to develop picochess further using the latest modules and latest python version. To do that we have to fix something the software community calls ”technical debt”. In this case the starting point is to get all the modules up to date so that we can run it in any modern environment. I am trying to make only the minimal adjustments needed to get it to work and avoid unnecessary changes or rewrites.

BR, Johan

Johan Sjöblom

unread,
Oct 30, 2024, 4:05:06 PM10/30/24
to pico...@googlegroups.com
I think I know why the tornado upgrade breaks the communication with the web page. In the new tornado module the IOLoop is no longer the same. Its probably not a singleton any more. I think that causes the message queue in WebDisplay to never be linked to the Tornado WebServer. I need to figure out how to use the IOLoop in the new tornado.

BR, Johan

Johan Sjöblom

unread,
Nov 2, 2024, 2:18:49 PM11/2/24
to PicoChess
Update.

Web page now updates when I play on my DGT board. It was indeed the IOLoop that has changed plus the fact that the new Tornado uses asyncio and the Timer thread in use is not compatible. ChatGPT helped me replace it. The only thing I have found not to work so far is that the web page clocks are not updating while me (human) or stockfish (absolutely not human!) is thinking about a move. I need to find out why the web page does not react to the DGT_CLOCk or CLOCk message. The clock does run, but you cannot see it changing while you are thinking about a move. It might also be a thread issue as they should be slightly redesigned to match asyncio.

I am trying to find the minimal first changes, but the web server.py would need to change more towards the new asyncio architecture… so a small architecture update is also needed later as step 2. Updating all the other legacy python modules would of course also be nice. Now chess engine communication (chess) and the web server (tornado and flask) work with latest versions and latest python.

I wonder if it would be possible to submit my code changes in a new branch, without having to fork. A fork loses all possibility to track changes. A new branch would not disturb the main branch.

BR,  Johan

Randy Reade

unread,
Nov 2, 2024, 2:50:35 PM11/2/24
to pico...@googlegroups.com
Hi Johan,

I'm no expert in GitHub usage but the code we are currently using is based off of Dirk's fork of the original repo created by JF Romang, which was effectively abandoned by the original contributors. I think Shiv has access to that site but not sure he is still monitoring this forum and also PRs were never made to the original repo so it is outdated. If Dirk wants to create a branch on his fork, maybe he can add you as a contributor (?). Otherwise I can only suggest that you clone Dirk's repo and create your own branch, or make your changes to the master, which will preserve previous commits (if I understand GitHub correctly).

Well done, by the way!

Randy

Johan Sjöblom

unread,
Nov 2, 2024, 3:37:02 PM11/2/24
to pico...@googlegroups.com
Thanks for the information. There is no hurry to decide on github as I still need to clean up some things. I suspect making a new fork sounds easiest based on what you said. I will investigate how things are preserved when forking.

BR, Johan

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Johan Sjöblom

unread,
Nov 15, 2024, 11:57:41 AM11/15/24
to PicoChess
Update. Successfully build a first baseline.

Picochess is now playing on web and/or DGT Eboard using the latest python chess and tornado modules and a very new python version. The new chess library turned out to be quite a different animal so I have now made a temporary fix for the analysis, brain, ponder modes and they have to be reworked later. I am not yet sending any ponder to the engine. We might even consider that we need to have the other Modes working in a slightly different way. 
The web tornado module was also quite different as it was asynchronous so I had to update all threads and watchdog timers to support asynchronous. I am now able to run a full debugging environment on Raspberry PI 4 so sorting out problems should be just a question of time and effort. I have checked most of the code how the basic stuff works so I should be able to fix and maintain it. The biggest challenge I can see is that the main program is very large (picochess.py). The overall architecture is very good, with message passing and threading support.

Now I will proceed to fork Dirk's fork and then try to upload these baseline changes. I will post an update when done. It might take a few days or weeks, lets see.

BR, Johan

Randy Reade

unread,
Nov 15, 2024, 12:07:58 PM11/15/24
to pico...@googlegroups.com

That's great progress, Johan. Well done!

Randy


Johan Sjöblom

unread,
Nov 15, 2024, 2:42:55 PM11/15/24
to PicoChess
I have now forked and updated my new repository fork-copy with my first baseline. This is far from anything you would like to build an image from but I welcome anyone to test. We now need to start to document issues (bugs) to this workspace on things that do not work. Kind of like collecting a todo-list on things to be fixed. This is just a first porting baseline to the new chess and tornado modules.

Dirk

unread,
Nov 16, 2024, 5:52:01 AM11/16/24
to PicoChess
wow - what an incredible work Johan,

I will see if I have some time for testing your new code base....

Thanks!
Dirk

Johan Sjöblom

unread,
Nov 16, 2024, 7:38:21 AM11/16/24
to pico...@googlegroups.com

Next for me is to try to locate how Analysis (Hont On) and Brain (Ponder On) modes display their result, and if there is a 2sec timer somewhere to display updates.
As a temporary trick these two modes now display "computer move", but you don't have to make that move if you don't want to.

This opens the question what the modes should actually do. There is a description from 2016 online and I wonder if that is the thing I should try to restore. I tried to make the minimal changes in the picochess.py main state but still it behaves strange due to the fact that there is no "eternal mode" in the new chess uci... the closest one gets is to turn on pondering  when calling engine play(). I have not yet had time to test that.


Johan Sjöblom

unread,
Nov 16, 2024, 11:10:55 AM11/16/24
to PicoChess
After some more investigation I think BRAIN mode (Ponder on in menu) is supposed to play computer moves. Lets see if I can change that… Now its like ANALYSIS (Hint On in menu). I did not understand that yet.

Randy Reade

unread,
Nov 16, 2024, 11:27:50 AM11/16/24
to pico...@googlegroups.com

Hi Johan,
Ponder ON just allows the engine to think on your time if supported by the engine. Analysis allows the engine to continuously calculate the score while you make the moves on the board, if we're talking about the same options.

Randy


Dirk

unread,
Nov 16, 2024, 11:42:07 AM11/16/24
to PicoChess
We have changed the original naming/menaing for the plain modes from version 1.0 on:

13. Renaming of the play modes! Now we have:

#            New mode name                                          Old mode name

#            a5 NORMAL (rolling info display off by default)        NORMAL

#            b5 PONDER ON (rolling info display on by default)     BRAIN

#            c5 MOVE HINT                                           ANALYSIS

#            d5 EVAL.SCORE                                          KIBITZ

#            e5 OBSERVE                                             OBSERVE

#            f5 ANALYSIS (flexible option on by default)            PONDER

#            g5 TRAINING (this is new in 2.00)                        -

#            h5 REMOTE (working again from 1.00 on)                 REMOTE



Original (these are the old ones, new naming see above) description:



Playing/Training Modes

When using these modes, please be patient and don’t rush moves. Allow a few seconds for the scores and moves to appear. If you see any bug when rushing moves, let us know on the mailing list.

  • Normal mode (enabled by white queen on A5). This is the default mode. You can play against the computer. The clock displays the remaining thinking time for both sides.
  • Brain mode (enabled by white queen on B5). This is same as Game mode but the computer is using the permanent brain to think ahead on your thinking time.
  • Analysis mode (enabled by white queen on C5): the computer is watching the game, it does not play itself. The clock continually displays the best move for the side to play.
  • Kibitz mode (enabled by white queen on D5): the computer is watching the game, it does not play itself. The clock continually displays the position score (right aligned) with the search depth (left aligned).
  • Observe mode (enabled by white queen on E5): the computer is watching the game, it does not play itself. The clock displays the remaining thinking time for both sides. The computer is thinking silently ahead. You can see the results by pressing the clock buttons (see below)
  • Ponder mode (enabled by white queen on F5): the computer is watching the game, it does not play itself. The clock displays the best move for the side to play in a 2 secs rotation with the position score together with the depth. So, this mode is a combination of “Analysis” & “Kibitz”
  • Remote mode (enabled by white queen on H5): this mode will allow you to play against someone over internet. The remote player using the webserver whereas the other player using the pieces as normal to enter moves. A detailed documentation will be provided lateron.

Game mode is the regular mode. If you used one of the other modes, you can return back to game mode by putting the extra white queen on A5. You can also press the fourth button to enter the menu (afterwards choose the Mode submenu) to toggle over the modes (Qa5-Qf5,Qh5 only working in the starting position) see below.



Randy Reade

unread,
Nov 16, 2024, 12:28:06 PM11/16/24
to pico...@googlegroups.com
Ah,

I always thought Ponder ON would turn engine ponder ON if it was set to OFF in the .uci file. I see that is wrong. To enable engine ponder it needs to be enabled in the .uci file. Thanks for correcting me, Dirk. I admit I have never tried the menu option.

But I don't see a rolling display. Perhaps I have it OFF as default?

Randy

RandyR

unread,
Nov 16, 2024, 12:39:27 PM11/16/24
to PicoChess
Now I see a thread running for Lc0 when it's my turn. Perhaps I didn't wait long enough? Book is OFF.

RandyR

unread,
Nov 16, 2024, 12:47:03 PM11/16/24
to PicoChess
Ok. I went back to Normal Mode and the Lc0 thread disappeared. Perhaps it was caused by me making a move that wasn't expected by the engine? Which is totally possible as I am losing the game badly.

RandyR

unread,
Nov 16, 2024, 1:10:22 PM11/16/24
to PicoChess
Ok. I see the option(s) in picochess.ini:

## For rolling information display ponder-interval should at least set to 4 or 5 seconds!

## Rolling information display in "normal" mode (time/score/depth/hintmove) is switched off by default
## If you want this please uncomment next line
## rolling-display-normal = True

## Rolling information display in "ponder on" mode (time/score/depth/hintmove) is switched off by default
## If you don't want this please uncomment next line
#rolling-display-ponder = True

# Flexible analysis option in Analysis (old Ponder) mode (no valid move checks, etc.) is switched on by default
## If don't you want this please uncomment next line
#flexible-analysis = False

So "Ponder on" does turn engine ponder ON and the .ini options above are for the display.

Sorry if I caused any confusion.

I'm still not clear on what exactly "flexible" analysis is, though. Perhaps you can help me there, Dirk?

Randy

On Saturday, November 16, 2024 at 11:28:06 AM UTC-6 RandyR wrote:

Johan Sjöblom

unread,
Nov 16, 2024, 1:28:32 PM11/16/24
to PicoChess
Nice catch Randy in the ini file. I will test those settings next. My next thing was/is to figure out why ANALYSIS mode is not showing anything for me, just the clocks... And in ANALYSIS mode I am showing "as if the computer would have made a move" but you dont have to take that move, you can move anything in ANALYSIS mode. The suggested move is just a hint. I dont know which message to display so I just took the temporary shortcut to display the same info as if the engine would have moved.

The new code fork I made I now changed a minute ago with a new commit so that it supports NORMAL, BRAIN, and ANALYSIS. In the two later ones I always ask the engine to ponder which makes it stronger in BRAIN/PonderOn than in NORMAL play especially when you happen to move what the engine expected you to. The ANALYSIS also becomes stronger the longer you wait before making moves (on both sides) as the engine never stops thinking now (pondering on also in ANALYSIS). Every move that "hits" the pondering move makes the ANALYSIS even faster as it can continue to ponder from that "pondering hit". 

Note that the new chess engine does not seem to require any uci file any more... but I am not so sure about that. I am asking the engine to give me its name. What we still need is an engine list file so that the menu can list the available engines. The uci files might be useful for setting engine option settings though... so this is new territory for me.

I have not yet tested anything except these 3 modes above in my new fork. One step at at a time... After todays commit I am now closer to the existing picochess... still many modes to be tested though!

BR, Johan


Randy Reade

unread,
Nov 16, 2024, 1:35:57 PM11/16/24
to pico...@googlegroups.com
Hi Johan,

The .uci files are used (as you suspected) for passing supported options to the engine but also for defining different playing levels. Without the .uci file the engine just uses defaults.

Randy

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

RandyR

unread,
Nov 16, 2024, 1:48:45 PM11/16/24
to PicoChess
My issue here was after the engine announces the move, the engine thread is terminated, but when I then make the engine's move on the board, the thread starts back up and the engine begins pondering so it's working correctly.

On Saturday, November 16, 2024 at 11:39:27 AM UTC-6 RandyR wrote:

RandyR

unread,
Nov 16, 2024, 2:23:26 PM11/16/24
to PicoChess
I wonder if perhaps the score display should be adjusted to pawns? Right now it's displaying tenths of pawns which is a bit non-standard. Any thoughts? I'm getting a bit off-topic, I know.

Randy

RandyR

unread,
Nov 16, 2024, 2:43:42 PM11/16/24
to PicoChess
Disregard that last message. I'm not sure what happened but the score seems to be OK now. It looked like it was about 10 times too high. I guess I was really playing bad! But I was comparing it to Fritz 17 so not sure. I'll keep an eye on it.

Randy

RandyR

unread,
Nov 16, 2024, 3:03:00 PM11/16/24
to PicoChess
Confirmed. I was playing really bad! I just didn't believe the score display of -82.41! I must have made a mistake with Fritz when making the moves. Time to take a break. :^)

RandyR

unread,
Nov 16, 2024, 3:26:09 PM11/16/24
to PicoChess
It just dawned on me that I was using Lc0. It reports scores differently. And they've added new scoring options which might need to be taken into consideration in the .uci file. Switching engines in Analysis mode between Lc0 and Stockfish and you can see the difference when the game is lopsided.

Randy

Johan Sjöblom

unread,
Nov 17, 2024, 2:35:25 PM11/17/24
to PicoChess
Ah. Still work to be done in both ANALYSIS and BRAIN modes for me. Especially ANALYSIS mode. But I have located the correct way to send the updated hint/ponder move and I have found where the rolling magic happens. First I have to fix the basic calls to the chess engine when in ANALYSIS mode… And then proceed to see how to deliver the hint/ponder in BRAIN mode. And after that check if I can get updates to the rolling info.

Dirk

unread,
Nov 18, 2024, 8:44:10 PM11/18/24
to pico...@googlegroups.com, PicoChess
Flexible ponder is an option where you can just move or set up pieces on the board and picochess will analyze it without having to execute legal moves. 

If you don’t set the flexible option on you do have to execute only legal moves…



Von meinem iPad gesendet

Am 16.11.2024 um 19:10 schrieb RandyR <randy...@gmail.com>:

Ok. I see the option(s) in picochess.ini:
--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Dirk

unread,
Nov 18, 2024, 8:44:14 PM11/18/24
to pico...@googlegroups.com, PicoChess
image

Am 16.11.2024 um 21:03 schrieb RandyR <randy...@gmail.com>:

Confirmed. I was playing really bad! I just didn't believe the score display of -82.41! I must have made a mistake with Fritz when making the moves. Time to take a break. :^)
--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Randy Reade

unread,
Nov 18, 2024, 9:31:30 PM11/18/24
to pico...@googlegroups.com

That's a pretty useful option. Thanks for clarifying, Dirk.

Randy


Johan Sjöblom

unread,
Nov 19, 2024, 1:19:46 PM11/19/24
to PicoChess
Ok, now committed first working version with Normal, Hint, and Ponder on, that is, Qa5,b5,c5. I believe I am showing centipawns now in the rolling info on Ponder On playing.
I need to work my way through the other modes also, one by one.

BR, Johan

Johan Sjöblom

unread,
Nov 19, 2024, 1:50:18 PM11/19/24
to PicoChess
There are still many issues to solve, but one really annoying one is that the voice announcements start lagging with several seconds after having played 5-10 moves. I wonder if its a known issue that some sound optimisations would have to be made on the raspbian system. Any hints? The web page shows the move quite fast so I assume the talker thread gets the message at the same time… 

Randy Reade

unread,
Nov 19, 2024, 2:35:18 PM11/19/24
to pico...@googlegroups.com

Make sure you are using Pulse audio and not PipeWire. You can select it in raspi-config. Another thing to look at is the picochess.log file. Set the log level to debug in picochess.ini. you should be able to see at what times the audio is sent and perhaps see if anything is hanging around that time or if there are warnings. Also, perhaps monitor processes with htop when the delays are happening. Maybe you are running out of cpu resources.

Randy


Randy Reade

unread,
Nov 19, 2024, 2:40:38 PM11/19/24
to pico...@googlegroups.com
Oh, and use X11 not Wayland.

Johan Sjöblom

unread,
Nov 21, 2024, 4:03:58 PM11/21/24
to PicoChess
Thanks. Change to PulseAudio removed the lag. Cpu is not a problem.

Question if you know: which engine.ini file is it looking for in a PI 4, I guess I can find oit by checking what platform call returns in a python? 
And how do I create uci files? Do I simply have to read the parameters available in each engine I compile by going to their respective website and reading about their uci commands and options. So far I have compiled stockfish 17 and lc0 but I need to write uci files for them. And I need to know which engine.ini to update.

BR, Johan

Randy Reade

unread,
Nov 21, 2024, 4:23:48 PM11/21/24
to pico...@googlegroups.com
Hardware doesn't matter. There are 3 .ini files that are read by PicoChess on startup - engines.ini (will appear under Engine/Modern Engines menu), retro.ini (will appear under Engine/Retro-Engines menu) and favorites.ini (will appear under Engine/Special & Historical Engines menu).

I created a python program a couple years ago that could be used to create the engines.ini file as well as the .uci files but the files created would need to be checked and manually edited afterwards. Not sure if the program even still works but you can see the post here.

It may be easier/quicker to create them manually. Run the engine in a terminal and type 'uci' to see a list of supported options. The create the xxxx.uci file for the xxxx engine. See this post from Al Cooper for some insight and/or look at current .uci files.

Randy

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Peter Eggen

unread,
Nov 22, 2024, 11:42:45 AM11/22/24
to PicoChess
Hi,
I do have a question regarding Books and I am not sure if this is functional/possible with the current implementation.
Using also Fritz 19, there is a unique function in it that can turn any PGN-File (i.e. containing move alternatives for an opening repertoire you want to learn/practice) and turn it into an instant opening book. The engine behavior then is as follows:
- Player play as normal
- Engine tries to make the best moves, but is fenced whitin the repertoire moves.
- As long as there is a valid move within the repertoire, engine will play this in response
- If there is no longer a move within the repertoire, engine will break/leave the Repertoire and  continue to play on 

Would this be possible with Picochess? Just Curious


Regards Peter

Johan Sjöblom

unread,
Nov 23, 2024, 4:51:05 AM11/23/24
to PicoChess
Hi Peter.
My 10cents: Interesting idea! To me it seems that picochess is already ”fenced” within its selected opening book. So to test your idea you would need to get an opening book file from your pgn that is of correct book format (.bin?) And then put that as a book in picochess and edit your picochess.ini file to use that one.
In general it seems to me that the book creation should be done outside picochess. But picochess could also have features that helps you to remember and train ”your moves” like fritz19 and chessbase can do. I have not yet checked how the pico tutor works, but maybe the tutor could have an opening helper?

PS, this opening book discussion would deserve its own discussion thread DS

BR,Johan

Peter Eggen

unread,
Nov 24, 2024, 1:52:19 AM11/24/24
to PicoChess
Hi Johan,
Agree. Let’s turn this into a new Diskussion.
To be a bit more explanatory, the way this works in Fritz 19 is that you can load your commented PGN file tha contains the opening which is then instantly converted into an opening book and used to play the game. While playing you also have the ability to see all rgw comments that are in the PGN so you know why the engine is suggesting the move, what are the next best encounters at this position so that it’s easy to learn the opening moves while playing
Regards Peter
PS if someone knows how to turn this discussion into a new thread pls do so

Peter Eßer

unread,
Nov 26, 2024, 2:39:56 AM11/26/24
to PicoChess
Hello. I have a Rasberry 5 and a DGT 3000 clock. But I don't have a board. Can I connect Rasberry 5 directly to the DGT 3000 clock with a cable ?

Peter Eggen

unread,
Nov 27, 2024, 10:52:20 AM11/27/24
to PicoChess
That setup does not make sense as due to a HW Change the i2c-Cable does not work. For this setup you need to connect the Pi to the eBoard and the clock to the eBoard (using the standard cable).
The modified cable to use the Clock display via i2c cannot be used with the Pi5 or you may damage something - at least not that I know of.
Regards Peter

Reply all
Reply to author
Forward
0 new messages