Use of PicoChessWeb offline!?

796 views
Skip to first unread message

Dirk

unread,
Mar 12, 2023, 8:30:34 AM3/12/23
to PicoChess
Hello,

Waldomiro mentioned that he obviously can't use his PicoChessWeb system offline.

That is strange because of course PicoChess should work offline as well (except for the very few online dependent functions like detemining the auto location or auto theme and accessing the webserver from another wifi device.

So your 7 inch display should show the web server  and should offer all picochess functions.
Could be that the web server will be started only with a big dela so your would have to wait some time and then refresh the chromium browser (as you don't have sound unfortunately you cant hear when picochess and its web server is running (you should really try to get the sound working or sitch the system with a working sound output because for me the sound/voice is an important picochess chess feature (even for Picochess Web although here it is not as important).

I just tried to boot up my PicoChessWeb system with no internet access and indeed it takes quite a while until the web server is running and I could finally refresh the browser to see the interface.

Does anybody have an idea what could be the reason for the big delay?
(I have set the theme to black in order to be not dependent on the online function for determining the sunset/sunrise times and I have set the location to 'Hamburg' which otherwise could cause a delay ).

But still it takes several minutes until the web server comes up.

Hmmm...

By the way:
In the meantime I really like the "simple" picochess menu and think that is nice to only see it when you really need it (what a difference to such overloaded GUIs like Fritz etc.).
I think you will get used to the navigation logic (which I must admit might be confusing in the beginning) the more you use it!

Dirk

pet...@gmail.com schrieb am Samstag, 11. März 2023 um 12:58:00 UTC+1:
Good morning!

I recently wrote myself, I'm a beginner to PicoChess 3.1 Web.

Congratulations to the developers, you do a wonderful job!

I use a Raspbarry pi 4b with a 7" Oficlal display and a Certabo Curzio.

Unfortunately I couldn't enable the sound via cable and P2 connector, I put it in the option always and unfortunately it doesn't work.

It would be wonderful if it worked offline and if you could make a menu easier to use. I have a lot of difficulty using it, I find it very confusing. I know that you use the keys of the DGT PI buttons.

If that ever happens, PicoChess 3 will be better than Mephisto Phoenix.

Grateful,
Waldomiro.

Ghislain Bourgeois

unread,
Mar 12, 2023, 8:37:06 AM3/12/23
to pico...@googlegroups.com
Hi,

From past experience, I would assume the startup is blocking on DNS queries trying to connect to the Internet. I think one of the culprit would be the automatic theme chooser. Setting the theme to a fixed value in picochess.ini will probably help, but there might be other culprits.

Ghislain 

--
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/996ee89c-622e-4fad-ab5c-6a2c478c4a1dn%40googlegroups.com.

waldomiro dias machado junior

unread,
Mar 12, 2023, 9:49:34 AM3/12/23
to pico...@googlegroups.com
Hello Dirk and Ghislain,

Thank you very much for the help and explanations, I will try to use it offline to see if it works.

As I am a layman and an end user, I was unable to enable sound, this is sorely missed. I do not know how to do. I connected my JBL soundbox with a cable with a P2 stereo plug to my Raspberry pi 4B with an official 7" monitor, I always put it on function and no noise comes out.

As for the menu, I hope to understand it someday. I have a hard time navigating from the main menu to the sub menus, etc... I still think an easier to use menu would be wonderful. For example, I still can't understand how I can abort a chess game in progress (New Game) without checkmate. I also don't know how to play with the black pieces, I don't know if there is a take back function.

Is there an instruction manual for PicoChess3.1 Web?

Again thank you very much.

Regards,
Waldomiro

Dirk

unread,
Mar 12, 2023, 6:11:23 PM3/12/23
to PicoChess
Hi Ghislain, yes thats sounds like a possible reason but as I have mentioned I haven't set the theme to auto nor the location.

So there must be something else besides of these - unfortunately I have these delays in offline mode on all my devices (what was expected): DGTPI, Revelation II with stand alone PI and PicochessWeb.
Dirk

Dirk

unread,
Mar 12, 2023, 6:36:41 PM3/12/23
to PicoChess
Hi Waldomiro,
Sorry, I can't help with your sound problem.

Regarding the usage of picochess:

The original developers of picochess did a fantastic job by making picochess as easy as it could be to use and operate.

All the main actions relevant for playing chess and choosing an opponent can be done without even pressing any button or having to jump into the menu - now PicoChess sounds even better than you thought, right !?! ;-)

PicoChess 3.1 only added new features so the existing manuals/documentations for picochess 0.9, 1.0, 2.0, 2.1 are all valid (at least for all relevant settings).

Have a look at the manuals I have attached, you can even have a look at the manual of the commercial DGTPI product:

In short:
For starting a new game just put the pieces in start position. For taking back moves: Just take the move back on the board!
For getting a PicoTutor advice and evaluation: Just lift a piece und pout it down again (but first you must active the PicoCoach fucntion in the menu when it is not active in your image ;-)

Enjoy
Dirk

‎s3.chesshouse.com:manuals:DGT%20Pi%20Manual_ENG.p.jpg



PicoChess Short Manual.pdf 2023-03-12 23-29-48.jpg
PicoChess Short Manual.pdf 2023-03-12 23-30-10.jpg

PicoChess Documentation Release 0.9 .pdf
PicoChess Short Manual.pdf

Dirk

unread,
Mar 12, 2023, 7:28:26 PM3/12/23
to PicoChess
and changing the side to play: just press the "lever" (left) button.

Ghislain Bourgeois

unread,
Mar 12, 2023, 8:50:17 PM3/12/23
to pico...@googlegroups.com

Hi Dirk,

I just did some tests with tcpdump, and it turns out that the geolocalization code still runs when theme and location are not set to auto. I am looking for a fix tonight.

Ghislain

Dirk

unread,
Mar 12, 2023, 9:23:37 PM3/12/23
to pico...@googlegroups.com
Unbelievable, you are really a great help Ghislain! - that would really help as I can image a lot of people (me as well in the summer outside) use picochess sometimes offline...
Thanks for looking at this issue,
Dirk 

Am 13.03.2023 um 01:50 schrieb Ghislain Bourgeois <ghislain....@gmail.com>:


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/XIEQWIaHxaE/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/2f4704f4-0ab9-d167-e4e1-3f1e8335a0ff%40gmail.com.

Ghislain Bourgeois

unread,
Mar 12, 2023, 9:29:09 PM3/12/23
to PicoChess
Hi Dirk,

I just pushed a quick fix for bypassing geolocalization when there is no connectivity, it seems to really speed things up on my side. You can pull from my repo, or check out the diff here: https://github.com/ghislainbourgeois/picochess/commit/bc3240bfc93a7fafa5155fec1869971d5fe1e1ef

Keep me posted!

Ghislain

Dirk

unread,
Mar 13, 2023, 7:53:28 AM3/13/23
to PicoChess
Hi Ghislain,

unfortunately no speed up on my side. If I am offline and having set a fixed location and specific theme (dark) it still takes serveral minutes unt il picochess starts the webserver on all of my systems with the utilities.py change.

Interesting that your systems seems to speed up. 

Maybe someone else can test in addition.  

Strange...

Hopefully this is only a problem with my system.

Thanks Ghislain!

Dirk

Ghislain Bourgeois

unread,
Mar 13, 2023, 8:03:11 AM3/13/23
to pico...@googlegroups.com
Hi Drik,

Thanks for the feedback. Thinking about it, there is probably a blind spot in my fix. I tested no network connection at all. Would you happen to have picochess connected to a network of some kind, but without internet access?

Ghislain

Dirk

unread,
Mar 13, 2023, 8:12:21 AM3/13/23
to 'Dirk' via PicoChess
No Ghislain - I switched off my router completely :-(

But maybe there are some other differences in your repository and the last one of Gerhards (which I still use except for the utilities.py change at the moment)

I tried to run your complete repository on my PI and had no luck.

Eg. the UCI Shell enhancement causes a syntax error (because of my picochess.ini I assume):

Traceback (most recent call last):

  File "/opt/picochess_web/picochess.py", line 3636, in <module>

    main()

  File "/opt/picochess_web/picochess.py", line 2166, in main

    engine = UciEngine(file=engine_file, uci_shell=uci_local_shell,

TypeError: __init__() got an unexpected keyword argument ‚retrospeed'


The retrpspeed parameter has been added some time ago and different uci feels had changed when I remember correctly. Maybe your last change broke something.


Strange that you did not get the error - maybe it is because of a wrong picochess.ini setting for the retrospeed parameter!?


The correct one must be something like this in picochess.ini (that changes some time ago as well):


## Retrospeed Setting for mame engines: rspeed defines the speed-up factor, valid options are numbers of type float 0 to 10.0 (1 = default original machine speed, 0.5 half of the original speed, 2 = double the speed, 0 for unthrottled full speed).

## Only use with a Raspberry Pi 4B hardware or better. Leave it blank for the original speed.

#rspeed = 1.0

rspeed = 1.0


I will check your other changes if they cause any conflict one by one...


Dirk





Dirk

unread,
Mar 13, 2023, 8:33:15 AM3/13/23
to PicoChess
Looks like the syntax error vanishes if I also update your picochess.py although both changes are not part of the same uci shell commit.

I can now test the remote engines (without the spur/ssh modification) and will test the offline mode again.

Dirk

Ghislain Bourgeois

unread,
Mar 13, 2023, 11:19:45 AM3/13/23
to PicoChess
Hi Dirk,

If it is still slow to start in offline mode, would you be able to share the output of the command "ip route show". I think it would help eliminate networking issues.

Ghislain

Dirk

unread,
Mar 13, 2023, 11:44:19 AM3/13/23
to 'Dirk' via PicoChess
Yes Ghislain, it is still slow (ca. 3 minutes) in offline mode.

I double checket the ip route show command when my router after I switched off my router: no output at all.

First I thought maybe the remote engine service may cause a delay as well (because I have set up the connection in my picochess.ini) but I guess since you also use remote engine it must be something difference.

The only other service (beside determining the IP address which is part of the location determination) is the pgn email sending but I don’t even use this at all.

Maybe we wait until someone else could confirm or not the delay in offline mode. Then we know for sure if it is my specific system configuration or not.

Rank you very much for helping!

Dirk

Randy Reade

unread,
Mar 13, 2023, 11:50:10 AM3/13/23
to pico...@googlegroups.com
I'll do some tests as well. Just helping Waldomiro with his sound problem.

Randy

Dirk

unread,
Mar 13, 2023, 11:52:45 AM3/13/23
to 'Dirk' via PicoChess
Cool - hopefully the sound problem can be sorted out.

Thanks Randy!

Dirk

RandyR

unread,
Mar 13, 2023, 5:48:41 PM3/13/23
to PicoChess
Looks like it's samba causing the issue. It waits for the network-online.target, thereby delaying the multi-user.target and graphical.target (which PicoChess relies on).

Perhaps it should be disabled by default and only enabled when needed.

sudo systemctl disable nmbd      <------  this will solve it without disabling smbd, but they both belong to samba
sudo systemctl disable smbd

Randy

Ghislain Bourgeois

unread,
Mar 13, 2023, 5:51:47 PM3/13/23
to pico...@googlegroups.com
Good catch! In my minimal install, I do not have samba.

The reason picochess.service depends on the target was for bluetooth to be up, right?

I can update the service file to explicitly list the dependencies for the service, it should let picochess start earlier.

Ghislain

--
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/XIEQWIaHxaE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.

RandyR

unread,
Mar 13, 2023, 6:25:51 PM3/13/23
to PicoChess
Hi Ghislain,

No, it depends on the multi-user.target. I didn't use the bluetooth.target because not everyone uses a BT board and may possibly disable BT. But, this may delay bluetooth connecting as picochess will start 5-6 sec before the bluetooth.target is reached. I'm hoping the board.py code will handle it. Maybe just disabling nmbd.service will be the best option. I have attached the systemd-analyze plots.

Randy

bootup_no_wifi.svg
bootup_no_wifi_only_nmbd_no_smbd.svg
bootup_no_wifi_only_smbd_no_nmbd.svg
bootup_with_wifi_and_samba_enabled.svg
bootup_no_wifi_no_nmbd_no_smbd.svg

Dirk

unread,
Mar 14, 2023, 4:28:14 AM3/14/23
to PicoChess
Hi Randy,

THAT'S IT !!!!

After disabling the nmbd service my DGTPI boots up in a few seconds only when offline and is ready for destroying me.

As I don't rely on this service (at least I think so - only use SSH & FTP) I will leave it disabled for now.

Maybe it is a good idea for your images as well because I think some people might use their DGTPI etc. most of the times offline.

Thanks so much for all your analysis to both of you Randy & Ghislain!

Dirk

Peter Eggen

unread,
Jul 1, 2023, 8:01:21 AM7/1/23
to PicoChess
Hi all,
I tried this with the lastest version 3.2 without success. 
When booting up, Chromium is fired up trying to connect to 127.0.0.1 throwing an error This site can't be reached. 
After a while and with clicking around and eventuelly setting up a Wifi connection the Picochess screen finally gets
displayed on monitor, but I like to have it to work offline.

What I am trying to do is the following:
- I like to play fully offline with just my DGT-Smartboard connected to a Pi4 - even without a Monitor and Keyboard at all
- Instead I like to use my iPad/iPhone to connect to the Pi and fully operate Picochess from there.
- In a networked environment this works fine, but I do want to be able to do this offline (using Wifi to the Pi serving as a Hotspot)

Any Ideas or did someone tried this usecase?

Regards Peter

RandyR

unread,
Jul 1, 2023, 2:30:13 PM7/1/23
to PicoChess
Hi Peter.

With a display attached and no wifi connection Chromium will try to connect to the PicoChess server before the server is up and running (see previous discussion). If you have a speaker attached (or the display has sound) you can wait (about a minute or less) for the "PicoChess" announcement and then refresh Chromium (need a mouse or keyboard) or you can disable the nmbd service and PicoChess will start almost immediately.

For your use case, you can use autoAP. Just follow the instructions to install it and you can point your browser to the ip address that you set up during the install. You can even connect via ssh. Note that you will need to switch to systemd-networkd as mentioned in the install instructions BEFORE rebooting. autoAP is really just a set of scripts that make configuration changes without you having to do them manually. I suppose you could just follow the Raspberry Pi documentation to get the same results.

Here are the commands I used (first update the RPiOS):

sudo apt update
sudo apt full-upgrade
sudo reboot

sudo curl -L https://github.com/gitbls/autoAP/raw/master/autoAP.sh -o /usr/local/bin/autoAP.sh
sudo curl -L https://github.com/gitbls/autoAP/raw/master/install-autoAP -o /usr/local/bin/install-autoAP
sudo curl -L https://github.com/gitbls/autoAP/raw/master/rpi-networkconfig -o /usr/local/bin/rpi-networkconfig
sudo chmod 755 /usr/local/bin/autoAP.sh /usr/local/bin/install-autoAP /usr/local/bin/rpi-networkconfig
sudo /usr/local/bin/install-autoAP

<answer y to the prompt 'Do you want to continue with autoAP installation [y/n]?'>
<choose an SSID and password of at least 8 characters, and an ip address (I left it as the default one of 192.168.16.1).>
<answer y to the prompt 'Are you ready to proceed [y/n]?'>

Before rebooting run:

sudo /usr/local/bin/rpi-networkconfig

<just hit the ENTER key to accept the '[S]ystemd-networkd' selection>

Then reboot:

sudo reboot

Now, if you are not near or cannot connect to your wifi network an access point will be created which you can connect to. Just look for the SSID using the networking program on your iPad/iPhone/PC, etc. and connect using the password you created (I only tested using my laptop). Then open a browser and enter the ip address as the URL and you should see the PicoChess web server. Note that it will take longer for PicoChess to start (if you have a display attached Chromium will refresh automatically once the access point is up and running). After you connect to the access point you can use ssh ('ssh pi@<ip address>') if needed.

I didn't do alot of testing. Initially I couldn't get PicoChess to connect to the Chesslink board. I'm not sure why. There were alot of errors in the picochess.log. Bluetoothctl showed the Millennium board was connected. I stopped the picochess service, deleted the /var/lib/bluetooth folder as well as the /opt/picochess/chess_link_config.json file and rebooted. PicoChess eventually connected to the board. Not sure I really needed to delete those files/folders but they get recreated on the next boot.

Also, when I re-enabled my network, PicoChess still took longer than normal to start but that might be related to switching to systemd-networkd.

Anyway, hope this helps.

Randy

RandyR

unread,
Jul 1, 2023, 3:41:49 PM7/1/23
to PicoChess
This should speed things up a bit:

sudo systemctl edit systemd-networkd-wait-online.service

Add the following into the space near the top (yes, two ExecStart= lines):

[Service]
ExecStart=
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any

Save (CTRL-o, <ENTER>, CTRL-x) and reboot.

May need to add a couple more seconds to the sleep time in ~/kiosk.sh (18 seems fine) if using an attached display (if the browser doesn't fully appear - not sure why this happens sometimes).

Randy

Message has been deleted

Peter Eggen

unread,
Dec 10, 2023, 8:19:23 AM12/10/23
to PicoChess
Hi Randy, is this still the way to go? Upon using last command installing autoAP I got a warning that my system is not configured to use systemd-networkd (I am using lasted Bookworm image).

What I like to achieve is the following:
I like to play offline with my DGT-Board connected when there is no Wifi connection available.
To control the Pi I like to have an AP setup that would allow me to connect to the Pi/Picochessweb using my iPad or iPhone.
I did get this to work (setting up an AP via the Desktop) but it does not seem to be available upon booting to command shell and I do not want to start the desktop to be resource friendly.
So what I am seeking for is to run Picochess controlled by my phone in urbon areas without Wifi connection and without needing keyboard and mouse of course - just the DGT-Board, the Pi and my iPhone.

Regards Peter

Randy Reade

unread,
Dec 10, 2023, 10:27:40 AM12/10/23
to pico...@googlegroups.com
Hi Peter,

You could search for AP solutions applicable to Bookworm, which uses NetworkManager now. An easier option may be to just switch SD cards to the Bullseye image that has AutoAP set up and working.

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.
Reply all
Reply to author
Forward
0 new messages