Jump to content

[Info] Howto enable stockfish/armfish chess engine as a TCP-service


guidol

Recommended Posts

For enabling - to use stockfish/armfish-chess-engine - as a TCP service

we need to configure (add the lines at the end of the file) /etc/inetd.conf

#:OTHER: Other services
stockfish08      stream  tcp     nowait  guido   /usr/games/stockfish
stockfish10      stream  tcp     nowait  guido   /usr/games/stockfish_10_64
armfish          stream  tcp     nowait  guido   /usr/games/armfish_aarch64

and add the TCP-Port - we want to use - to the /etc/services (for optical reasons after pop3s port 995/tcp)

pop3s           995/tcp                         # POP-3 over SSL
#
#
stockfish08     1024/tcp                        # stockfish 8  chess engine
stockfish10     1025/tcp                        # stockfish 10 chess engine
armfish         1026/tcp                        # armfish chess engine

at the end we have to restart inetd (or reboot)

systemctl restart inetd

 

Additional (important?) informations:

 

- guido is a local user on my system - you need to change the name for the /etc/inetd.conf to a local user of your system

/usr/games/stockfish is the stockfish-binary installes by apt install stockfish

- the stockfish-binary we compiled for stockfish v10 64Bit in another thread

   from ./Stockfish-master/src/stockfish (directory of the cloned github-repository)

   to /usr/games/stockfish_10_64
 

- /usr/games/armfish_aarch64 is the (on a 64Bit PC-Linux compiled with fasmg) assembler-version of stockfish which could run twice as fast
   see https://github.com/lantonov/asmFish
   precompiled aarch64-binary as attachment (think about the chmod 755 armfish_aarch64 after the transfer :) )

 

Binary-Overview in /usr/games/

root@t95k-pro(192.168.6.62):/usr/games# ls -l
insgesamt 644
-rwxr-xr-x 1 root root 128050 Mär 14 22:08 armfish_aarch64
-rwxr-xr-x 1 root root 216216 Nov 12  2016 stockfish
-rwxr-xr-x 1 root root 308896 Mär 14 13:57 stockfish_10_64

 

armfish_aarch64

 

Link to comment
Share on other sites

On 6/6/2019 at 12:05 AM, guidol said:

UCI Engine BikJump 2.1P from Aart Bik is available under

http://aartbik.com/MISC/bikjump2.1_static

 

Get it running (32bit) via wget and chmod 755 on a RPi3 -

does run also on a 32bit armbian! ( ==> like H2/H3-CPU ) ;)

 

 

Aart Bik has now released also a 64bit/aarch64 version of his BikJump-Chess-Engine (v2.5) which is available at
http://www.aartbik.com/MISC/bikjump2.5_static

 

Does run well under armbian 64bit/aarch (like on my NanoPi Neo2 with H5 CPU) :)

bikjump_25_aarch64.jpg

Link to comment
Share on other sites

On a test of stockfish v11 I did found that inetd isnt installed as default anymore and does throw a error-message when installed and started :(
 

Failed to start inetd.service: Unit inetd.service not found.

 

So I did switch to the newer xinetd ( xinetd - replacement for inetd with many enhancements ):

sudo apt install xinetd

(and maybe if installed : apt purge inetutils-inetd update-inetd )

So then there is no /etc/inetd.conf anymore, but now we have to create a file for each tcp stream like /etc/xinetd.d/stockfish11:

# Stockfish remote engine
service stockfish11
{
  disable = no
  server = /usr/games/stockfish_11_64
  socket_type = stream
  protocol = tcp
  user = guido
  wait = no
  port = 1024
# only_from = localhost
}

the file /etc/services has to be configured as before ;) (also add to the file)

#Stockfish
stockfish11       1024/tcp                        # Stockfish chess engine

 

To restart xinetd and check the status of xinetd you could use:
 

sudo systemctl restart xinetd
sudo systemctl status xinetd

As reference/information I used the following page:
https://jerrygreenblog.wordpress.com/2016/08/26/linux-stockfish-chess-engine-as-remote-service/

Link to comment
Share on other sites

Hello.
I am making a physical board to play chess.
I plan to use Stockfish, but it turns out that the "pc" where I am mounting everything is a raspberry pi zero w ... and the truth is that it is very slow, to reach analyzes of a depth of 20 it takes a long time. From what I thought (at least while doing the tests) put stockfish as a server ... buuuuuuuut, on my most powerful machine I currently have Windows 10 installed ... will you have any information on how to put stockfish as a server in windows 10? (or maybe how run stockfish with better results on a rpi zero.
Greetings and thank you very much.

Edited by 9acca9
Link to comment
Share on other sites

14 hours ago, 9acca9 said:

I plan to use Stockfish, but it turns out that the "pc" where I am mounting everything is a raspberry pi zero w ... and the truth is that it is very slow

will you have any information on how to put stockfish as a server in windows 10?

(or maybe how run stockfish with better results on a rpi zero.
 

@9acca9 No wonder :) the RPi Zero is only a Single-Core SBC with max. 1GHz.
OK - this sounds much for a normal chess-computer, but not for stockfish. You also get what you paid for :( 

You did better buy something like a Orange Pi Zero ( a chep QuadCore SBC).

I dont know (az this time) how to setup a Win10-Chess Server, because stockfish for Windows is only a commandline program and I dont know how to connect it externally via TCP or serial.
All Windows GUI Chess programs can use the command-line UCI connection to use stockfish ( https://stockfishchess.org/download/windows/ )

Link to comment
Share on other sites

Hi,
Thanks for the article.
I'm able to run Stockfish as a service on Ubuntu and trying to use it from Windows 10 using Arena GUI. It works fine except for it's NOT using syzygy tablebases that are on Ubuntu (where Stockfish running). As I understand, Tablebases are accessed by GUI (Arena) meaning that TBs need to be on my Windows machine (client). Hence I tried to compile Stockfish by hardcoding "SyzygyPath" to my TB's path (on Ubuntu)in "ucioption.cpp" but it did not work. When I run Stockfish CLI on Ubuntu, I could see it detected TBs. I don't want to use TB's from Windows machine as it's I/O is not good enough. Is it possible to make SF use TBs (that are stored locally on Ubuntu itself) when running as a service? if yes, pls advise me how. Thanks!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines