Beside of the porting of the mame chess engines (I really enjoy some these old chess computers from my childhood and because I can finally beat them :-) I am working on some further enhancements for Picochess like the PGN game replay and „guess the next move“.
With one other specific enhanncement I need some help of the python guys here in the forum - maybe someone has an idea.
I’m trying to change the way of the remote engine communication in Picochess so that it is a lot easier and simple to use) because I think it would be nice to play against the old chess computer and seeing the GUI of the chess computer on the remote PC (by that you can easily adjust some settings interactively etc.).
Here is an example of playing on my Revelation 2 (not via Picochess) against my good old Chess Champion MK5 running on a windows tablet via the cool remote UCI server software written by Ruud!
https://www.dropbox.com/s/5xznh4rpwlkwdlf/REV2_UCISERVER_MAME_ENGINES.mov?dl=0
I have implemented this in Picochess and it works perfectly fine when using a MacOS or UNIX PC but unfortunately not when using a Windows PC with Windows 10 (thanks to Al for fin ding this bug - the best tester of the world)
Here I play against my chess champion sensory challenger running on my Mac book with Picochess.
https://www.dropbox.com/s/8pcumbz8q4welbg/MESS_REMOTE.mov?dl=0
Unfortunately I can’t find the problem with windows as the remote communication happens exactly in the same way and I hope you have an idea:
First I double checked that I can SSH to the windows PC and start the engine manually.
These are the python commands for the remote communication:
First we care a remote shell object (that seems to work) and second we create the python-chess engine object based on the generated shell object.
This command never comes back and it seems to be stuck somehow as I only get a time out error message in the end but nothing else.
(You can directly test this if you have an engine on a remote server PC) from Picochess terminal by starting python3:
#!/usr/bin/env python3
import spur
import paramiko
import chess
import chess.uci
################ example macOS server WORKING
>>> shell_mac = spur.SshShell(hostname='192.168.178.83', username='molli', password= ’xyz’, missing_host_key=paramiko.AutoAddPolicy())
>>> engine_mac = chess.uci.spur_spawn_engine(shell_mac, ["/Users/molli/Documents/remote_engines/remote_stkf9“])
>>> engine_mac.uci()
>>> print(engine_mac.name)
Stockfish 9 64 POPCNT
>>>
################ windows server NOT WORKING
>>> shell_win = spur.SshShell(hostname='192.168.178.38', username= ’molli’, password= ’xyz’, missing_host_key=paramiko.AutoAddPolicy())
>>> engine_win = chess.uci.spur_spawn_engine(shell_win, ["C:\\Users\\dirkm\\Desktop\\mame_engines\\remote_stkf_win“])
This last command never returns (until timeout) so I can’t print the engine.name etc.
If you have any idea polls let me know…
Thanks
Dirk
Yes we tried that too
Al.
import spurfrom spur.ssh import ShellTypeshostname = "h"username = "u"private_key = "pk"shell_type = ShellTypes.minimalshell = spur.SshShell(hostname=hostname, username=username, private_key_file=private_key, shell_type=shell_type)with shell:result = shell.run(["hostname"])print(result.output)
Randy
Randy
I had several windows engines running via the WINE emulation layer on MacOS before I upgraded to th newest OS Catalina which no longer supports the 32 BIT version of WINE :-(
For example Colossus Chess by Martin Bryant (yes, there is a free UCI version for windows) or GIRAFFE, the first neural network chess algorithm(I think) implemented by one of the Google team members who developed Alpha Zero....
--
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/5092433f-0f48-4967-a644-6692253998afo%40googlegroups.com.
Cheers,
Al.
pi@MolliPi:~ $ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spur
>>> import paramiko
>>> import chess
>>> import chess.uci
>>> shell = spur.SshShell(hostname='192.168.178.38', username='whoknows', password='xyzzy', missing_host_key=paramiko.AutoAddPolicy(), shell_type=spur.ssh.ShellTypes.windows)
>>> engine = chess.uci.spur_spawn_engine(shell, ["C:/Users/dirkm/Desktop/mame_engines/ccmk2"])
>>> print(engine.name)
None
>>> engine.uci()
>>> print(engine.name)
Novag Chess Champion: MK II (ver. 1) (mess 0.215)
Randy
I tried that too, same result.
Al.
my Picochess installation is also based on a fresh Buster light image and I used pip3 to remove and install spur/parmiko.
I could find the folders and files und python3.7/dist-packages.
Dirk
pi@MolliPi:/usr/local/lib/python3.7/dist-packages $ ls -all
total 404
drwxrwsr-x 54 root staff 4096 Jun 11 18:35 .
drwxrwsr-x 3 root staff 4096 Aug 12 2019 ..
drwxr-sr-x 3 root staff 4096 Jun 11 18:35 altgraph
drwxr-sr-x 2 root staff 4096 Jun 11 18:35 altgraph-0.17.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 bcrypt
drwxr-sr-x 2 root staff 4096 Aug 12 2019 bcrypt-3.1.7.dist-info
drwxr-sr-x 3 root staff 4096 Jun 11 14:13 berserk
drwxr-sr-x 2 root staff 4096 Jun 11 14:13 berserk-0.10.0.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 certifi
drwxr-sr-x 2 root staff 4096 Aug 12 2019 certifi-2019.6.16.dist-info
drwxr-sr-x 4 root staff 4096 Aug 12 2019 chardet
drwxr-sr-x 2 root staff 4096 Aug 12 2019 chardet-3.0.4.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 chess
drwxr-sr-x 3 root staff 4096 Aug 12 2019 click
drwxr-sr-x 2 root staff 4096 Aug 12 2019 Click-7.0.dist-info
drwxr-sr-x 2 root staff 4096 Aug 12 2019 ConfigArgParse-0.14.0.dist-info
-rw-r--r-- 1 root staff 41174 Aug 12 2019 configargparse.py
drwxr-sr-x 2 root staff 4096 Aug 12 2019 configobj-5.0.6.dist-info
-rw-r--r-- 1 root staff 89627 Aug 12 2019 configobj.py
drwxr-sr-x 4 root staff 4096 Apr 8 21:10 Deprecated-1.2.8-py3.7.egg
-rw-r--r-- 1 root staff 92 Jun 11 14:12 easy-install.pth
drwxr-sr-x 4 root staff 4096 Aug 12 2019 flask
drwxr-sr-x 2 root staff 4096 Aug 12 2019 Flask-1.0.2.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 idna
drwxr-sr-x 2 root staff 4096 Aug 12 2019 idna-2.8.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 itsdangerous
drwxr-sr-x 2 root staff 4096 Aug 12 2019 itsdangerous-1.1.0.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 jinja2
drwxr-sr-x 2 root staff 4096 Aug 12 2019 Jinja2-2.10.1.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 markupsafe
drwxr-sr-x 2 root staff 4096 Aug 12 2019 MarkupSafe-1.1.1.dist-info
drwxr-sr-x 5 root staff 4096 Aug 12 2019 nacl
drwxr-sr-x 4 root staff 4096 Apr 8 21:10 ndjson-0.3.1-py3.7.egg
drwxr-sr-x 3 root staff 4096 Aug 12 2019 OpenSSL
drwxr-sr-x 3 root staff 4096 Jun 11 08:20 paramiko
drwxr-sr-x 2 root staff 4096 Jun 11 08:20 paramiko-2.7.1.dist-info
drwxr-sr-x 6 root staff 4096 Aug 12 2019 pyasn1
drwxr-sr-x 2 root staff 4096 Aug 12 2019 pyasn1-0.4.6.dist-info
drwxr-sr-x 2 root staff 4096 Aug 12 2019 __pycache__
drwxr-sr-x 12 root staff 4096 Jun 11 18:35 PyInstaller
drwxr-sr-x 2 root staff 4096 Jun 11 18:35 PyInstaller-3.6.dist-info
drwxr-sr-x 2 root staff 4096 Aug 12 2019 PyNaCl-1.3.0.dist-info
drwxr-sr-x 2 root staff 4096 Aug 12 2019 pyOpenSSL-19.0.0.dist-info
drwxr-sr-x 2 root staff 4096 Aug 12 2019 pyserial-3.4.dist-info
drwxr-sr-x 2 root staff 4096 Aug 12 2019 python_chess-0.22.1.dist-info
drwxr-sr-x 3 root staff 4096 Aug 12 2019 requests
drwxr-sr-x 2 root staff 4096 Aug 12 2019 requests-2.21.0.dist-info
drwxr-sr-x 6 root staff 4096 Aug 12 2019 serial
drwxr-sr-x 3 root staff 4096 Jun 11 08:20 spur
drwxr-sr-x 2 root staff 4096 Jun 11 08:20 spur-0.3.21.dist-info
Yes it works on the PI (here a PI4) with Picochess and the warnings are gone!Will check it with a real connection out of Picochess the next days...Big thanks again for helping out to Randy and Hasnul!Dirkpi@MolliPi:~ $ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spur
>>> import paramiko
>>> import chess
>>> import chess.uci
>>> shell = spur.SshShell(hostname='192.168.178.38', username='whoknows', password='xyzzy', missing_host_key=paramiko.AutoAddPolicy(), shell_type=spur.ssh.ShellTypes.windows)
>>> engine = chess.uci.spur_spawn_engine(shell, ["C:/Users/dirkm/Desktop/mame_engines/ccmk2"])
>>> print(engine.name)
None
>>> engine.uci()
>>> print(engine.name)
Novag Chess Champion: MK II (ver. 1) (mess 0.215)
>>>
Am Dienstag, 9. Juni 2020 21:48:06 UTC+2 schrieb RandyR:Success!!~$ python3Python 3.6.9 (default, Apr 18 2020, 01:56:04)[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.>>> import spur>>> import paramiko>>> import chess>>> import chess.uci
>>> shell_win = spur.SshShell(hostname="<ip_address>", username="<username>", password="<password>", shell_type=spur.ssh.ShellTypes.windows)>>> engine_win = chess.uci.spur_spawn_engine(shell_win, ["D:/Arena/Engines/stockfish-11-win/sf11.exe"])>>> engine_win.uci()>>> print(engine_win.name)Stockfish 220420 64 POPCNT>>>I removed spur and paramiko:sudo pip uninstall spursudo pip uninstall paramikothen updated them to their latest versions (spur-0.3.21 and paramiko-2.7.1)sudo pip install spursudo pip install paramiko
I then renamed /usr/local/lib/python3.6/dist-packages/spur/ssh.py as ssh.py0321and placed the version with windows support (as suggested by Hasnul - thanks!) from the spur folder here:I did this via the desktop so someone git savvy will have to provide the command-line equivalent. :^)The updated paramiko solves the "CryptographyDeprecationWarning".Note that this is from Linux Mint to Windows 10 so has not been tested on the RPi. I also don't know if the updated python modules break anything in picochess.Cheers!Randy