PicoChessWeb image creation scripts

546 views
Skip to first unread message

gkalab

unread,
Jan 3, 2023, 6:39:38 PM1/3/23
to PicoChess
Hello everyone,

I've documented the process of semi-automatically creating my own images for PicoChessWeb. See https://github.com/gkalab/picochessweb-dietpi .

These scripts (Ansible Playbooks) extend the minimal RaspberryPi images provided by https://dietpi.com/ with the latest source code for PicoChessWeb, various precompiled binaries like box86 and box64 to run Linux x86 or x64 engines and example configurations for the free Komodo 13.02 and Pedone 3.0 chess engines.
32-bit and 64-bit images are supported. The greatest flexibility and speed results from using the 64-bit image.

All you need is an existing copy of the picochess/engine and picochess/talker folders to use your own engines/voices.

This minimal setup installs only those pieces of software that are absolutely necessary for PicoChessWeb (installed image size including engines is less than 5 GB). There is no desktop installed, no VNC and no Wine. The advantage of this setup is the minimal hardware requirement, which goes well with my Raspberry Pi 3b.

These scripts work for me and are tailored to my hardware setup. They may not work for you.

Gerhard

Dirk

unread,
Jan 3, 2023, 6:54:38 PM1/3/23
to PicoChess
Hi Gerhard,

that sounds great - probably  exactly what some users are looking for (me included ;-) although I will continue to use wine/VNC etc.

Just question: does this image contain the modification of the python-chess library necessary for the tournament time control settings?

Dirk

Dirk

unread,
Jan 3, 2023, 6:59:54 PM1/3/23
to PicoChess

This is the bug in the old python-chess lib (in later versions it is fixed)


Python package:

python-chess==0.22.1

Python Chess is installed:

/usr/local/lib/python3.X/dist-packages/chess


Error in python-chess file uci.py (for tournament setting)

def go

Bug fix:

   if movestogo is not None and int(movestogo) > 0:

Instead of

   if movestogo is not None and movestogo > 0:

gkalab

unread,
Jan 4, 2023, 11:00:52 AM1/4/23
to PicoChess
Yes, python-chess 0.22.1 is the installed version.
I believe I have already fixed this issue some time ago in the source of timecontrol.py and patching of the python-chess library should not be necessary. At least for me the tournament time controls work without a patch.

This is the fix I made with a corresponding unit test:

Gerhard

Dirk

unread,
Jan 4, 2023, 11:03:55 AM1/4/23
to pico...@googlegroups.com
Ah cool - that is of course an even better solution than the python-chess modification!

Thanks Gerhard for the clarification
Dirk

--
You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/Fx7tQ5LIg4o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/f5f9f36e-e558-4f5d-aaf9-f72fd299ec54n%40googlegroups.com.

Nacho Ros

unread,
Jan 5, 2023, 2:50:41 PM1/5/23
to PicoChess
Hi Gerhard,

I'm a bit stuck. I have finished the first boot of the SD-card, I have also prepared the ansable folder, but I only have it on my Windows pc. I don't know if I have to transfer it to the dietpi root or I can copy it to the fat32 partition to use it later. I appreciate any help.

gkalab

unread,
Jan 5, 2023, 4:55:33 PM1/5/23
to PicoChess
The way Ansible works is that you execute the playbook from a "controller" host and it does its magic via an SSH connection. So usually all the files remain on another host, not the raspberry pi. The easiest way to do this would be to install some Linux in a VirtualBox. WSL (Windows subsystem for Linux) on Windows might work, but I have not tested this.

That said, in theory it should also work to execute all the commands on the raspberry pi.
I have not tested the following steps, you can try them:

* Use putty to connect to the running raspberry pi via SSH (login with user root, password dietpi)
* Then execute the following commands
apt install python3-pip git sshpass rsync
cd picochessweb-dietpi
* Follow the rest of the installation description:
pip3 install ansible
apt-get install sshpass rsync
cd ansible; ansible-galaxy collection install -r requirements.yml
ssh localhost      --> just login, then exit again
* Before starting the playbook edit the inventory.ini file and use localhost instead of <raspberrypi-address>. Start the playbook:
ansible-playbook --ask-vault-pass main.yml

Gerhard

Nacho Ros

unread,
Jan 6, 2023, 2:12:56 PM1/6/23
to PicoChess
In the end I have chosen to install ubuntu on the pc. Cloning gibhub wouldn't let me add the engines or customize picochess.ini. I'm still stuck on the last step, no matter how hard I try it always says: UNREACHABLE! changed false msg: data could not be sent to remote host \"192.168.39.110\". Make sure this host can be reached over ssh: "unreachable": true

However I access the Raspberry via SSH with no problems. I do not know what else to do. Thanks for your help.

gkalab

unread,
Jan 7, 2023, 12:57:00 PM1/7/23
to PicoChess
The reason for the connection problems on Ubuntu was that DietPi installs Dropbear as the default SSH server. I changed the default in the dietpi.txt configuration to install the OpenSSH server instead.

Gerhard

Matthew Zeman

unread,
Jan 16, 2023, 9:28:27 PM1/16/23
to PicoChess
Thanks a lot for this!  I was able to get this running via the ansible scripts on an OrangePi3 with Armbian.  I just had to comment out the dietpi specific stuff in:  system.yml  Thanks a ton for putting this together!

Cristina Garcia

unread,
Feb 5, 2023, 2:30:46 PM2/5/23
to PicoChess
Hi Gerhard,
I try your ansible system to create a minimum installation with picochess for a RPi 3b+ and I have a couple of issues:

1.- Need to take out from TASKs Box86 because this cause me a lot of errors in the start and finally chrome doesnt start, Im not interested on x86 binaries so no problem with this.
2.- Totally unable to connect with Chessnut air, may be 1 of 20 tries it connect, instead no problem with picochessweb on RPi4b 2Gb. Error on picochess debug is "Failed to create peripheral on address ......."

I use yor last files from github and dietpi armv7 version 8.13.2

Any help will be wellcome ....

Best Regards

Cris

gkalab

unread,
Feb 5, 2023, 3:11:27 PM2/5/23
to PicoChess
Hi Cris,

1. The last armv7 image I tried was with 8.12. Currently I use 8.13 armv8 (64-bit), because I can use the free Komodo 13 and Pedone with it.  I need to try the armv7 image again. Let's see if I have time in the next few days.
2. Could it be that bluetooth is not ready when you start up? You can try to restart the picochess service after startup:
systemctl restart picochess.service
After this, do you still have issues to connect?

Gerhard

Cristina Garcia

unread,
Feb 6, 2023, 3:02:37 AM2/6/23
to PicoChess
Hi gerhard,
thank you for your fast response, yes, I try that, even disabling picochess service and running it manually with same result, I suspected that could be a hardware problem and then I tryed on the RPi4 that was working with PicochessWeb but I got same result, and same diagnostic, "Failed to create peripheral" .....

I change the log parameter in picochess ini to DEBUG and the board mac address is found, identify as Chessnut air, but failed when create peripheral. On both Rpi3 and 4.

-Cris

gkalab

unread,
Feb 6, 2023, 4:29:26 PM2/6/23
to PicoChess
Cris, just to be sure: the blue bluetooth light on the Chessnut Air is blinking when you're trying to connect? It always connects for me if I start both, the e-board and PicoChess at the same time.
Regarding your initial problems with the dietpi-setup-process: did you fix those? Did you make sure you used a /boot/config.txt for your system? If the PicochessWeb image is working for you, you can probably copy the config.txt from this setup and put it under /boot/config.txt. This might help with the startup of X, which is needed for Chromium.
You can use dietpi-config to set the 'Autostart Options' to 'Chromium - Dedicated use without desktop'.

If you enter dietpi-config, under 'Advanced Options', is bluetooth on?

Gerhard

Cristina Garcia

unread,
Feb 7, 2023, 3:07:04 PM2/7/23
to PicoChess
Hi Gerhard
Yes, the blue light is blinking, and the bluetooth its activated, but must be some diference between PicochessWeb bluetooth management and dietpi, I will investigate that ...

Thank you for your help.


Cris

gkalab

unread,
Feb 13, 2023, 3:23:34 PM2/13/23
to PicoChess
Hi Cris,
I've tried DietPi v8.14.2, both the armv7 image and the armv8 image on the weekend with the latest master branch. Both work on my RaspberryPi 3b (not 3b+) and the connection to the Chessnut Air was without a problem.

Gerhard
Reply all
Reply to author
Forward
Message has been deleted
0 new messages