DGTPi Shutdown

663 views
Skip to first unread message

RandyR

unread,
Dec 13, 2020, 9:24:17 PM12/13/20
to PicoChess
As Dirk mentioned, when using v3 on a DGTPi, when you shutdown by replacing the white king with the extra white queen while in the start position, the DGTPi display wouldn't blank. That's because Dirk edited the utilities.py file like I did so that the DGTPi would actually execute a shutdown (rather than just putting PicoChess into standby). You could then safely remove power. Unfortunately, this meant that you would have to press the clock ON/OFF button to turn off the display.

If you want to go back to that standby mode, just stop PicoChess ('sudo service picochess stop') and edit the utilities.py file in /opt/picochess to remove the '#' in front of the following lines (around line 240):

def shutdown(dgtpi: bool, dev: str):
    """Shutdown picochess."""
    logging.debug('shutting down system requested by (%s)', dev)
    time.sleep(3)  # give some time to send out the pgn file or speak the event
    if platform.system() == 'Windows':
        os.system('shutdown /s')
    elif dgtpi:
        os.system('sudo systemctl isolate dgtpistandby.target')
    else:
        os.system('sudo shutdown -h now')

Note: make sure the command in brackets starts with sudo. Then reboot ('sudo reboot now').

But, if you want to have the DGTPi shutdown AND blank the display, stop PicoChess as above and use your favourite text editor (e.g.nano) and edit the dgtpistandby.service file located in /etc/systemd/system adding the following line:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Emergency Shell
Documentation=man:sulogin(8)
DefaultDependencies=no
Conflicts=shutdown.target
Conflicts=rescue.service
Conflicts=emergency.service
Conflicts=syslog.socket
Before=shutdown.target

[Service]
Environment=HOME=/root
WorkingDirectory=/root
ExecStartPre=-/bin/plymouth quit
ExecStartPre=-/bin/umount /boot
ExecStartPre=-/bin/mount -no remount,ro /
#ExecStart=-/bin/sh -c "/sbin/sulogin; /bin/systemctl --fail --no-block default"
ExecStart=/bin/sh -c "/opt/picochess/etc/dgtpicom; /bin/systemctl --fail --no-block default"
ExecStartPost=shutdown -h now
Type=idle
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes

Then reboot. Now you can shutdown the DGTPi using the aforementioned extra queen and the display will blank. If you want to restart the DGTPi, just press the clock ON/OFF button and wait for PicoChess to start. Or just reapply power if you removed it.

Randy

Dirk

unread,
Dec 14, 2020, 7:40:09 AM12/14/20
to PicoChess
Hi Randy,

your second option (using original utilities.py and adding shutdown to the dgtstandby.service) sounds exactly what I originally intended to achieve.

Unfortuantely this option does not work (at least with my DGTPI):

The main idea for my utilities.py change was to allow a successful bluetooth reconnection WITHOUT cutting the DGTPI power supply.
And this seems not to work correctly with your second option:
After switching the DGTPI on and pressing the button once it will successfully shutdown the PI and switching off the display - so far so good.

BUT: When I now press the button again (DGTPI still connected to power) the DGTPI switched on for a second, shows „DGTPI“ in the display and then immediately switches off again!?

Only after pressing the button a second and a third time would eventually successfully turn the DGTPI on again but bluettoth reconnection was also missing half of the time when I tested this (again: without taking the DGTPI from the power supply).

Does this work with your DGTPI correctly?

Thanks
Dirk    

Dirk

unread,
Dec 14, 2020, 7:42:48 AM12/14/20
to 'Dirk' via PicoChess
Hi Randy,

your second option (using original utilities.py and adding shutdown to the dgtstandby.service) sounds exactly what I originally intended to achieve.

Unfortuantely this option does not work (at least with my DGTPI):

The main idea for my utilities.py change was to allow a successful bluetooth reconnection WITHOUT cutting the DGTPI power supply.
And this seems not to work correctly with your second option:
After switching the DGTPI on and pressing the button once it will successfully shutdown the PI and switching off the display - so far so good.

BUT: When I now press the button again (DGTPI still connected to power) the DGTPI switched on for a second, shows „DGTPI“ in the display and then immediately switches off again!?

Only after pressing the button a second and a third time would eventually successfully turn the DGTPI on again but bluettoth reconnection was also missing half of the time when I tested this (again: without taking the DGTPI from the power supply).

Does this work with your DGTPI correctly?

Thanks
Dirk    
--
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/1c3080e4-699c-4c97-b6fc-8a7f1479963bn%40googlegroups.com.

RandyR

unread,
Dec 14, 2020, 8:56:50 AM12/14/20
to PicoChess
Dirk, I forgot to mention that you need to do the first option (uncomment the DGTPi lines in utilities.py) AND do the edit to the dgtpistandby.service file. If you did that I’ll do some more testing today. I was just so happy to find it after trying many different ways that either didn’t turn off the display, or did but didn’t fully shut down the pi (I monitored USB power).

Let me know.

Randy

Dirk

unread,
Dec 14, 2020, 9:06:15 AM12/14/20
to pico...@googlegroups.com
Hi Randy,

I did use the original utilities.py (meaning with the uncovenanted lines).

Yes, it will shutdown und switch off display but causing problems when starting again by pressing the button without taking it from the power supply (immediately going off again etc.)

Me too would love to have such a solution but that one causes problems with my DGPI.

Thanks for checking, Randy!

Dirk


--
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,
Dec 14, 2020, 10:31:03 AM12/14/20
to PicoChess
Hi Dirk, unfortunately it is as you say. I did not test enough. I'm not sure why the Pi sometimes shuts itself off when starting up. It's almost like the button shuts it down before the dgtpistandby.service runs and it then executes those commands on the next startup. I hope it doesn't work like that. Perhaps my assumption that the button (eventually) runs the shutdown() function in utilities.py is in error.

But, sometimes it works, at least for me. I just did 2 startups and shutdowns using only the button.

Back to the drawing board...

Randy

Dirk

unread,
Dec 14, 2020, 10:37:24 AM12/14/20
to 'Dirk' via PicoChess
Ye Randys, sometimes it works sometimes it will shutdown the next start and sometimes no bluetooth connection for some reason - for me too many sometimes.
And yes the button will trigger the shutdown function in utilities.py.

Really strange und and a pity.

I will leave the simple shutdown -h now function for now activated in utilities.py for my V3 (although I actually don’t need this bluetooth reconnection ability why I (or Alexa;-)  always cut my pi from the power supply….

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/pHMmlH0mSUs/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/ffa6e023-748b-4d8d-84c8-f52fe069cf35n%40googlegroups.com.

RandyR

unread,
Dec 14, 2020, 11:09:30 AM12/14/20
to PicoChess
Ok. Thanks for that info. I don't use BT but I understand that being able to shutdown is an acceptable workaround for now. I will keep trying to solve this problem with my limited programming/linux abilities and hopefully I will stumble upon the solution. :^)

Randy

Dirk

unread,
Dec 14, 2020, 11:25:59 AM12/14/20
to 'Dirk' via PicoChess
That's the way I program as well, Randy ;-)

I would be happy if we can find a better solution as the workaround …

Dirk

Am 14.12.2020 um 17:09 schrieb RandyR <randy...@gmail.com>:

Ok. Thanks for that info. I don't use BT but I understand that being able to shutdown is an acceptable workaround for now. I will keep trying to solve this problem with my limited programming/linux abilities and hopefully I will stumble upon the solution. :^)

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/846fa26d-1547-4ceb-b2db-0856fc9cd273n%40googlegroups.com.

RandyR

unread,
Dec 16, 2020, 3:22:29 PM12/16/20
to PicoChess
Lucas, if you get the time to answer, do you know of a (simple) way to blank the DGTPi before shutdown? I guess dgtpicom is set up to have picochess go into 'standby' and wait for the ON/OFF button press to bring it back to life (although trying to figure out the systemd process is a bit daunting). It seems that sending the dgtpicom command to the clock with no arguments then shutting down the pi causes the clock to be in a different state than I would expect, like the ON/OFF state is latched. I suppose the battery is keeping it in that state.

Randy

Lucas van der Ploeg | DGT

unread,
Dec 17, 2020, 4:35:09 AM12/17/20
to PicoChess

If I remember correctly the way I implemented the standby mode of the DGT Pi is by going to run level 0 which is single user mode. In this mode you only run dgtpicom so the pi uses minimal power and is save to unplug without SD card corruption. When you start the clock, dgtpicom exits and the pi goes back to a normal run level by reinitialising everything.

Unfortunately the Bluetooth module can normally only be initialised once because it changes the communication speed and will no longer work on the default communication speed. I fixed this by not changing the communication speed but apparently this is different for the Pi 4b.

 

To get back to your question, I don’t really understand your current solution but you can simply turn the dgtpi display off by calling self.libl.dgtpicom_off(1) from python. You should probably place this somewhere in https://github.com/jromang/picochess/blob/master/dgt/pi.py

 

Best regards,

Lucas van der Ploeg | DGT

--

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,
Dec 17, 2020, 10:37:36 AM12/17/20
to PicoChess
Thanks, Lucas. That's very helpful. When I was trying out various solutions to the problem, after the stock DGTPi entered standby I was still able to interact with the pi using ssh and also the USB was still powered. I'll test again to confirm, but that seems to me like it wouldn't be safe to unplug the power. It's really not an issue for me as leaving power connected doesn't really bother me, but the BT users want the full shutdown (if I'm reading things correctly). There's a cron script to reinitialize the BT on reboot/restart.

The dgtpicom_off command sounds exactly like what I need. I'll muddle my way through it and hopefully solve this!

Thanks again.

Randy

RandyR

unread,
Dec 18, 2020, 7:24:30 PM12/18/20
to PicoChess
Well, I haven't had much success with using the dgtpicom_off function. I initially tried putting it in pi.py, which seems logical, but python would throw an error when I called the function from the shutdown section of utilities.py. I'm not very knowlegeable in python, but it looks like the issue is that pi.py imports functions from utilities.py so when I tried importing the function from pi.py into utilities.py it caused some circular error?? So I decided to make the dgtpicom.so library call in utilities.py itself, which worked (the screen blanked and the pi shut down), but the next power up of the pi didn't set up the clock display correctly. I got the DGT P| text, but then it showed --:--.--  --:--.-- on the clock, then the Picochess 3 text, then the picotutor text, then back to --:--.--  --:--.-- . Picochess was running because if I removed my king, picotutor would tell me to put it back. The time briefly showed correctly (for Fischer 15 10) but then it went back to the dashes. If I started playing, the computer's move text would display, the time would show briefly, then back to the dashes. It's like the clock doesn't get properly initialized then next startup of the pi. The computer icon and mode 25 are showing on the clock.

Randy

Dirk

unread,
Dec 18, 2020, 7:34:12 PM12/18/20
to pico...@googlegroups.com
Hi Randy,

I don’t thing the - - - - display is (only) related to your shutdown change because I also saw these dashes several times and I had to reboot to fix this..

Very strange and it is definetly a V3 source problem because on my home Image which is a raspian lite version I have never seen this (at least not in the past months).
So could be a problem of this raspian version or the frequency settings in config or...?

If you would like to share your modifications I could also play around with this...

Dirk

RandyR

unread,
Dec 18, 2020, 7:49:01 PM12/18/20
to PicoChess
I agree, Dirk. I just removed the changes, shutdown the pi, turned the display off, unplugged the power, waited a couple seconds, plugged it back in, and picochess started up but still showed the dashes.

Here is what I had in utilities.py:
.
.
.
from threading import Timer
from subprocess import Popen, PIPE
from ctypes import cdll
.
.
.
def shutdown(dgtpi: bool, dev: str):
    """Shutdown picochess."""
    dgt_functions = cdll.LoadLibrary('etc/dgtpicom.so')

    logging.debug('shutting down system requested by (%s)', dev)
    time.sleep(3)  # give some time to send out the pgn file or speak the event
    if platform.system() == 'Windows':
        os.system('shutdown /s')
    elif dgtpi:
#       os.system('sudo systemctl isolate dgtpistandby.target')
        dgt_functions.dgtpicom_off(1)

        os.system('sudo shutdown -h now')
    else:
        os.system('sudo shutdown -h now')

Sorry if this is the wrong way to do it. I hope you have better luck.

Randy

Dirk

unread,
Dec 18, 2020, 8:01:06 PM12/18/20
to pico...@googlegroups.com
Looks good Randy, although I am surprised that we son’t have to use the same dgt library instance which already exists and was correctly initialized  at runtime.

I really have no idea where the dashes come from - but I think you are right something went wrong with correct clock timers initialization or something similar.

Unfortunately I can’t create an image from my own sd cards because they are all 64GB :-(

Maybe someone else can try another (lite) image (for pi3&4) and just copy the complete V4 picochess folder to it - thats should do it…

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/pHMmlH0mSUs/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/7cbcf5b0-2f3a-49ef-8420-09548da013f0n%40googlegroups.com.

Dirk

unread,
Dec 18, 2020, 8:03:48 PM12/18/20
to PicoChess
Randy,
do you use my timecontrol.py modification already? Then this could also be related to the dashes problem!?
Dirk


RandyR

unread,
Dec 18, 2020, 9:44:46 PM12/18/20
to PicoChess
Hi Dirk.

No, I’m still using your original image for the DGTPi.

Randy

Dirk

unread,
Dec 19, 2020, 7:48:18 AM12/19/20
to PicoChess
Ok, I tried Marcels original image pico 10 for the DGTPI:

After some reboots with the DGTPI I also got this weird "- - -  - - -" display - looks like something related to this imag as I have not seen this problem with my own 64GB image.

As I used this pico V110 image as a base image for my V3 (because it was smaller) we can now have this problem on a DGTPI from time to time unfortunately (sorry for that).

So if this bothers someone it would be a good try if someone could try another PI3/4 base image and try to install my V3 on it (just copy the picochess folder and do the modifications & install pygame like I have described ion my image thread.
Dirk

RandyR

unread,
Dec 19, 2020, 9:29:53 AM12/19/20
to PicoChess
I'll put together a clean DGTPi image today (based on RPiOS Lite) and incorporate v3 and do some testing.

Something I also noticed was that sometime the clock display would blank after the DGT P| text and come back for Picochess 3 when booting up from power OFF. Probably related.

Randy

Dirk

unread,
Dec 19, 2020, 9:36:54 AM12/19/20
to PicoChess
Hi Randy,

oh, that would really help to narrow down the problem!

Yes I think that may also be related - maybe a clean image from the scratch would really help with these issues!

Another possible reason could be the dgtpcom libs in the etc folder - I did not check if there is a difference to mine. 

These were the things I did (beside of copying the picochess folder ;-)
  • install audio lib pygame: sudo apt-get install python3-pygame
  • Install telnet: sudo apt-get install telnet (don’t know if this is already installed by default)
  • BERSERK: sudo pip3 install berserk (evtl. for the lichess client)
  • MAME:  set Memory Split Factor >= 64GB (if not per default)
  • Mame: install the  packages  needed: sudo apt-get install git build-essential libsdl2-dev libsdl2-ttf-dev libfontconfig-dev qt5-default
  • Modification for the windows ssh comunication thanks to help of the community: I removed spur and paramiko: sudo pip3 uninstall spursudo pip3 uninstall paramiko, then updated them to their latest versions (spur-0.3.21 and paramiko-2.7.1): sudo pip3 install spur,sudo pip3 install paramiko, I then renamed /usr/local/lib/python3.7/dist-packages/spur/ssh.py as ssh.py0321 and placed the version with windows support (as suggested by Hasnul - thanks!) from the spur folder here: https://github.com/tfromme/spur.py 
  • python-chess bugfix modification for tournament  time controls:

Python Chess is installed on my system: /usr/local/lib/python3.7/dist-packages/chess

in 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:


Thanks
Dirk

RandyR

unread,
Dec 19, 2020, 9:59:20 AM12/19/20
to PicoChess
Thanks for re-posting the changes, Dirk. Hopefully I remember everything. :^)

Btw, I did a quick check in RPiOS64 on the RPi4b and v3 was working after a couple python file mods for the engine path. I haven't tested anything other than the standard 64-bit engines I had on hand. Mess is compiled but it's v 0.226 so I will have to test it. Also, I did the full compile so there's stuff in the mess executable that doesn't need to be in there. (Al, do you have a trimmed down hardware list or Makefile just specific to chess hardware?)

Randy

Dirk

unread,
Dec 19, 2020, 10:04:14 AM12/19/20
to 'Dirk' via PicoChess
Mess on Raspian:

No Randy, unfortunately we were not able to create a tiny mess build with just the chess engines. 

In theory we have the engine list so - if you know how to modify the makefiles so that only the mess engineer being compiled and linked (plus the dependent stuff)  that would be great ;-)

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

RandyR

unread,
Dec 19, 2020, 10:09:16 AM12/19/20
to PicoChess
Ok. A project for the future. :^)

Randy

Scally

unread,
Dec 19, 2020, 10:40:51 AM12/19/20
to PicoChess
Hi Guys,

Yes we tried a “tiny mess” build but must have the parameters wrong.

However on my RPi4 8gb ram version booting off a SSD drive it only takes just over 2hrs to do the full compile.


Al.

Sean Taylor

unread,
Dec 19, 2020, 2:56:13 PM12/19/20
to pico...@googlegroups.com
Hi Al
Have you tried a wireless mouse/keyboard with that? I get jittering. I found a solution online that increased the USB port sample rate but reduced cpu - I didn't use it but switched to wired mouse/keyboard which works like a charm.
Basically, plugging any USB drive in (thumb or SSD), booting off it or not, seems to affect wireless USB devices. It seems too significant an issue to have not been addressed - unless it's me somehow.
RPiOS64 Beta and RPiOS32.
Thanks,
Sean



--
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/d033c6ac-2fab-4a9e-bdf6-48aa528a6c19n%40googlegroups.com.

RandyR

unread,
Dec 19, 2020, 3:17:43 PM12/19/20
to PicoChess
Hi Dirk,

I have v3 running on a clean RPiOS32 Lite on the DGTPi and have not yet seen the clock display issue. Shutdown is as expected (you need to turn off the clock after the Pi shuts down). Starting up by pressing the ON/OFF button works as does plugging the DGTPi back in with the clock still off. It looks like there may be something conflicting in the SD card image. Also, I'm using your latest v3 files (from your latest DGTPi image).

Randy

RandyR

unread,
Dec 19, 2020, 5:09:05 PM12/19/20
to PicoChess
Dirk, I added my utilities.py edits from the post above and the clock now turns off before the pi shuts down. You can then either remove/reapply power or use the ON/OFF button to restart picochess. You can shutdown using the 2 queens or the ON/OFF button. When you use the ON/OFF button to start, you will see the dashes and flashing mode 25 until the pi takes over. My hack can probably be improved so feel free. :^)

Randy

Scally

unread,
Dec 19, 2020, 6:34:39 PM12/19/20
to PicoChess
Hi Sean,

All my systems are lite systems so I don’t use a mouse or keyboard I just use my iPad with an App called Termius to connect and code everything.


Al.

Dirk

unread,
Dec 19, 2020, 6:43:33 PM12/19/20
to 'Dirk' via PicoChess
Randy, this is exactly the behavior on my 64GB home system, I just tried it - so it works in all cases - well done!

Dirk


Am 19.12.2020 um 23:09 schrieb RandyR <randy...@gmail.com>:

Dirk, I added my utilities.py edits from the post above and the clock now turns off before the pi shuts down. You can then either remove/reapply power or use the ON/OFF button to restart picochess. You can shutdown using the 2 queens or the ON/OFF button. When you use the ON/OFF button to start, you will see the dashes and flashing mode 25 until the pi takes over. My hack can probably be improved so feel free. :^)

Randy


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

RandyR

unread,
Dec 19, 2020, 7:15:41 PM12/19/20
to PicoChess
That's great, Dirk. The credit has to go to Lucas for the solution. I'm not sure how to make it work from pi.py, though. Maybe your python skills can figure that one out. :^)

Randy

Sean Taylor

unread,
Dec 19, 2020, 10:09:20 PM12/19/20
to pico...@googlegroups.com
Hi Al,
Thanks. That makes so much sense.
And sorry this question was in the wrong thread.
Sean

RandyR

unread,
Dec 20, 2020, 7:55:06 PM12/20/20
to PicoChess
I've created an SD card image of Picochess v3 for the DGTPi installed on the latest Lite version of RPiOS32. It has the shutdown code so the clock automatically blanks on shutdown, and updated Rodent IV personalities. Also, you can run Al's (modified) script in the pi home folder to adjust the Elo rating of the Rodent IV personalities. The image is available here:

The first boot will take a bit longer than usual as it auto-expands to fill the SD card you are using. It will fit on an 8 GB card. If you want wireless access, add your wpa_supplicant.conf file to the /boot partition (accessible in Windows). SSH should be enabled already. Run raspi-config to change the localization settings to your own locale.

Randy

RandyR

unread,
Dec 20, 2020, 8:00:29 PM12/20/20
to PicoChess
Forgot to mention:

username: pi
password: picochess

Randy

Luigi Vogliobene

unread,
Dec 21, 2020, 3:24:42 AM12/21/20
to PicoChess
Thank you, Randy

Etienne

unread,
Dec 21, 2020, 3:46:38 AM12/21/20
to PicoChess
Thank you Randy
What a downsizing!
This shutdown seems to be very clean!
I didn't manage to set up wifi?
Not paying enough attention to your instruction I did as usual trying to modify wpa_supplicant.conf....but there was no such file in the wpa_supplicant folder
So I tried to make one with nano but it didn't work
Then I wanted to stick to your instruction so I tried to copy the wpa_supplicant.conf from a working wifi image so that I can put in the sd boot (in windows) but didn't manage to transfer with Filezila (acces denied?)
Sorry to bother you on such basic issues...
All the best
Etienne

Dirk

unread,
Dec 21, 2020, 5:25:41 AM12/21/20
to PicoChess
Hi Randy,

wow - how could you manage to squeeze the 7, 5GB of compressed data into 3.5GB?

Thank you so much - I will check if we get the '------' display with this image and hopefully they are gone!

I only could connect once (first try) to my eBoard - then it failed every time.

I have checked that you installed Eric's bluetooth fix scripts (although his shell script instead of his python (newer?) version but that shouldn't matter I think as I couldn't find much difference)

Even after manual pairing and trusting my eBoard connection it won't find it again.

Maybe this is because of the newest RaspianOS version because when I tried to update my 64GB the last time bluetooth got broken as well!?

Hopefully it is only my DGTPI (3B+ inside).

Dirk

Dirk

unread,
Dec 21, 2020, 6:16:22 AM12/21/20
to PicoChess
Hi Etienne,

in my V3 image threads I have given an example of the wpa_supplicant.conf:

wpa_supplicant.conf looking like this…


ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

country=DE

network={

ssid="your router SSID“

psk="your password“

key_mgmt=WPA-PSK

}

.. .into the main (boot) directory of the sd card directly after having successfully flashed the image.


You copy it directly after flashing the image with th end card still in the card reader with the Windows Explorer to the main (boot) directory.

Then with the first booming this file is automatically copied into the right place (the wpa_supplicant folder).

Dirk

Etienne schrieb am Montag, 21. Dezember 2020 um 09:46:38 UTC+1:

Dirk

unread,
Dec 21, 2020, 6:49:12 AM12/21/20
to PicoChess
nice Rodent4 enhancements! I like these!
Thanks, Randy!

Etienne

unread,
Dec 21, 2020, 7:18:52 AM12/21/20
to PicoChess
Thank you Dirk, works fine now - looks like the most efficient way to set up wifi - by excluding the wpa_supplicant.conf file from his package Randy managed indeed to get quite a significant weight saving  ;)
I am on the road now to explore the Rodent4 features...
Regardig mame, I still need to understand the roms compatibility issue: some roms that were good with pico201 seem to freeze the engine set up now ... probaby not compatible with MESS 225 as you advised)
All the best,
Etienne

Dirk

unread,
Dec 21, 2020, 7:26:33 AM12/21/20
to PicoChess
Etienne, do you have any bluetooth reconnection problems after a new start?
Thenaks
Dirk

Etienne

unread,
Dec 21, 2020, 7:49:45 AM12/21/20
to PicoChess
Dirk, I connect to a Smartboard via usb so I am not using BT
The wifi connection seems to work properly.
Best,
Etienne

RandyR

unread,
Dec 21, 2020, 10:02:30 AM12/21/20
to PicoChess
Hi Dirk,

That's too bad about the bluetooth. I don't have a BT chess board so didn't test that. You are probably correct that an update is causing the issue. I saw this post on github and followed the last post to here where the poster rolled back the BT firmware specifically. I can't comment on or advise doing it since I have no experience with the issue we are having but maybe it makes sense to you.

sudo dpkg -i bluez-firmware_1.2-4+rpt2_all.deb  
reboot

As for Eric's script, I just used the one from your v3 image. Is there anything useful in the fix_bluetooth_4b.log? If you can solve it I'll update my image.

Oh, and 7-zip produces better compression than zip. :^)

Randy

Henri

unread,
Dec 21, 2020, 10:57:46 AM12/21/20
to PicoChess
Hi all,

Yes, there are difficulties with bluetooth, and it has a lot to do with the recent PI OS release of December 5. You can read all about it here:
I've got a musicserver running under Pi OS 64, bluetooth was working ok, but after the update nothing works anymore. Onder Pi OS 32 most standard applications work, but there still are some problems, as you can read in the comments under the article.

Henri

Op maandag 21 december 2020 om 16:02:30 UTC+1 schreef RandyR:

RandyR

unread,
Dec 21, 2020, 11:14:33 AM12/21/20
to PicoChess
Thanks Henri. Hopefully they get it sorted out soon. Maybe someone will figure out if it's an updated package, updated firmware or updated kernel and figure out a workaround.

Randy

Dieter

unread,
Dec 21, 2020, 11:47:20 AM12/21/20
to PicoChess
Hi there,

so far I am a silent reader of this forum. Now is really the time that I would like to express my thanks and respect to all the developers who are working on the further development of Picochess. Especially Dirk for his version 3 and Al for his compiled engines and Randy for his research into the correct shutdown of the DGT Pi and ... and ... and ... :)

And now to the Bluetooth problem:
Unfortunately, the tip with the older Bluetooth driver does not work here either. I now have the following hack, which works until Bluetooth works correctly again. Add the following line to the /etc/rc.local file (before exit 0):

/bin/bluetoothctl remove 00:06:66:82:DE:1D (MAC address of your bluetooth board !!)
You can find out the MAC with /bin/bluetoothctl devices in the console.
This means that the board is disconnected from the Bluetooth each time it is started and automatically reconnected.
Maybe there is a better place in Picochess to include this line?
In any case, it works here - but with a bit of a delay when starting.

Greetings
Dieter

Dirk

unread,
Dec 21, 2020, 11:54:52 AM12/21/20
to pico...@googlegroups.com
Hi Dieter,

Isn’t that exactly what Eric’s bluetooth fix scripts (and this script is installed in this image)  should do?

Strange -but if this solution is really working,  even better!

Thanks for sharing!
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/pHMmlH0mSUs/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/294ed7ce-144e-4dd7-93d8-0e35f53d1899n%40googlegroups.com.

Dirk

unread,
Dec 21, 2020, 12:20:40 PM12/21/20
to PicoChess
Yes, its works.

Unfortunately this canÄt be added to the image as it is Mac address dependent an I tried calling Eric's script instead of the direct command (that would have the advantage that we could addd this to the image): unfortunately no success :-(

So I think we just have to wait for official bluetooth fix to update the image - I think it is worth, because of the reduced size (ok. Randy get rid off the 09N version but I think people wouldn't swiztch the versions anyway;-) and the fix for the strange '------" display problem we had from time to time with my original image.

Thanks again Dieter!
Dirk

Dieter

unread,
Dec 21, 2020, 12:24:26 PM12/21/20
to PicoChess
Well, Eric's scripts are a little more complicated and unfortunately didn't work here. Clearing the bluetooth connection to the board during startup is the hard solution, but it works for me.
Unfortunately, that's not a solution for a general image. :(

Dieter

Dieter

unread,
Dec 21, 2020, 12:35:17 PM12/21/20
to PicoChess
Perhaps a Linux expert can write a script that reads the MAC address of the board when the DGT Pi is started and then deletes the connection. Unfortunately, as a long-established Windows user, I don't have this Linux knowledge. ;)

RandyR

unread,
Dec 21, 2020, 12:42:28 PM12/21/20
to PicoChess
I found an issue with my image - none of the .py or .sh files in the picochess folder were marked as executable! I was sorting out the file attributes and forgot to redo the .py and .sh files. I'm not sure if it matters for this issue (updated RPiOS), but Eric's script would not have been running at every reboot. I fixed the image and I'm in the process of compressing/uploading. Sorry for missing this. I'll blame the beta tester. ;^)

I'll post back when the new file is available. You can also fix your own image via ssh if you execute the following commands:

cd /opt/picochess
sudo find . -type f -iname "*.py" -exec chmod 755 {} \;
sudo find . -type f -iname "*.sh" -exec chmod 755 {} \;
sudo reboot now

Randy

Dirk

unread,
Dec 21, 2020, 12:44:49 PM12/21/20
to 'Dirk' via PicoChess
Randy - that could be the solution.

I was going mad because I called the scripts and it did not worked.

I will try this later.

Then we could even update the image!

Let’s see..

But it will take some time as I’m busy now…

Dirk

--
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/7cca3d6a-6054-4df6-a8f6-fe67ab0464acn%40googlegroups.com.

Scally

unread,
Dec 21, 2020, 12:48:43 PM12/21/20
to PicoChess
Hi all,

I’m not having any problems with Bluetooth.

My system is very similar to Dirk’s, my v3 files are identical, plus like Dirk I have added Randy’s shutdown code which works a treat👍

Just this afternoon, I BACKED UP both my Stretch & Buster systems, then did:
sudo apt update && sudo apt upgrade -y && sudo rpi-update

Rebooted both systems and they both work without a problem, connection to my Revelation II via BT is almost instant.

So I have now BACKED UP both systems again and updated my Master system where I do most compiles including for MAME. This system boots off a SSD drive and has a M.2 Sata 3 drive as backup.

Please just don’t update without BACKING UP your system first, but for me everything is working fine.


Cheers,

Al.

Scally

unread,
Dec 21, 2020, 12:52:03 PM12/21/20
to PicoChess
My message ^^ was being written when Randy & Dirk replied above, so I only saw them after I posted.

Al.

RandyR

unread,
Dec 21, 2020, 12:57:29 PM12/21/20
to PicoChess
That's good to know, Al. Thanks! Hopefully it was just my bad image.

Randy

RandyR

unread,
Dec 21, 2020, 1:16:36 PM12/21/20
to PicoChess
Fixed image is now available at the same site.

Randy

Dirk

unread,
Dec 21, 2020, 4:01:12 PM12/21/20
to PicoChess
Hi Randy,

unfortunately did not for for me: still getting no bluetooth reconnection after first boot.

As I also got these problems after an OS update on my system (where all scripts are installed and active) it was not the executable flag but some other os bluetooth problem.

Still with Dieters suggestion to modify /etc/rc.local it works.

Maybe the /etc/rc.local file is executed at a better point in time during startup  than the crontab file for Eric's scripts (although I tried to add Erics script in /etc/rc.local with no success as well!?).

So I think if I am not the only one with still these bluetooth problems we have to wait for an official fix.

Dirk

Dirk

unread,
Dec 21, 2020, 4:03:41 PM12/21/20
to PicoChess
Forgot to mention that the script files were not executable when I added the scripts to /etc/rc.local  with the old image - so I will test it again (but can't do it before tomorrow late evening...

Dirk

Dirk

unread,
Dec 21, 2020, 4:09:21 PM12/21/20
to PicoChess
Ok, couldn't wait to try it now - yes it works with the /etc/rc.local file instead of crontab although it lasts a little bit longer now until connection is set up.
Dirk

RandyR

unread,
Dec 21, 2020, 4:10:02 PM12/21/20
to PicoChess
One more correction: the crontab entry should have permissions 600 or else you will see a "INSECURE MODE (mode 0600 expected) (crontabs/root)" warning in the system logs. The script should still run, though. This is all the result of me just copying the entry into the crontab folder rather than using crontab -e to add the @reboot entry.

Anyway, the quick fix is to run the command:

sudo chmod 600 /var/spool/cron/crontabs/root

The image is fixed (again!).

Randy

RandyR

unread,
Dec 21, 2020, 4:17:06 PM12/21/20
to PicoChess
Ok, Dirk. It's strange that it's working for Al and he just updated his system. I'll wait for you to do some more testing before I make any change to the image.

Also, I assume you disabled the crontab entry when you tested Dieter's fix.

Randy

Henri

unread,
Dec 21, 2020, 4:19:47 PM12/21/20
to PicoChess
Hi Randy,

Just had a look. Shame the image does not contain a desktop. But I guess we're all heading for a personal image.....

Henri

Op maandag 21 december 2020 om 22:17:06 UTC+1 schreef RandyR:

Dieter

unread,
Dec 21, 2020, 4:51:15 PM12/21/20
to PicoChess
Hi Randy,

that was it! Both, my own image with the current Raspbian buster and your image now connect to the DGT Board via Bluetooth. The thing with the script and crontab was new to me. Until then, I haven't dealt with Linux in general and Picochess in particular.

Many Thanks
Dieter

RandyR

unread,
Dec 21, 2020, 4:51:16 PM12/21/20
to PicoChess
Hi Henri. I just wanted to put together a quick image to test the shutdown issue. I guess we probably should have started a new post. I doubt that adding a desktop would take much effort. Were you using vnc or do you have a monitor connected?

Randy

RandyR

unread,
Dec 21, 2020, 4:56:01 PM12/21/20
to PicoChess
That's great, Dieter! So it both works when rebooting or shutting down (removing power)?

And I confirm that I'm also using the latest RPiOS Lite image (02 Dec 2020) and updates.

Randy

Henri

unread,
Dec 21, 2020, 4:59:49 PM12/21/20
to PicoChess
Hi Randy,

Yes in my case I'm using a desktop and I add xrdp to take over from a windows laptop, although VNC is nice too. But essentially it doesn't matter. What I would prefer is to brush away the things that are not working perfectly in Dirk's initial version 3, maybe add a few things (like in Rodent 4) and come to a proper 3.01 version to share. Same goes for the non-dgt version of course!

Henri
Op maandag 21 december 2020 om 22:51:16 UTC+1 schreef RandyR:

Scally

unread,
Dec 21, 2020, 5:30:58 PM12/21/20
to PicoChess
Hi Guys,

With the latest updates today I’m on firmware dated 18th December:

Linux PicoChess 5.10.1-v7l+ #1383 SMP Fri Dec 18 19:05:58 GMT 2020 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Dec 21 22:22:59 2020 from 192.168.1.119
Al@PicoChess:~ $

Al.

Dieter

unread,
Dec 21, 2020, 5:36:47 PM12/21/20
to PicoChess
Yes, I have now booted several times - with reboot, with shutdown, with the two queens, with and without removing power. Bluetooth was connected correctly every time.

That's how it should be :)

RandyR

unread,
Dec 21, 2020, 5:48:58 PM12/21/20
to PicoChess
That's very good news, Dieter. Thanks for testing!

Randy

Dirk

unread,
Dec 22, 2020, 11:34:19 AM12/22/20
to PicoChess
Hello,

I have now tested the image inside a DGTPI (3B+ modified) togetrther with an bluetooth eBoard and am external PI3 (the one from the original DGTPI ;-) and an external PI4together with the bluetooth Revelation II: All connected well and shutdown worked as well like expected.

Perfect!

Thanks Randy for this fine image and the Rodent4 enhancements (have I mentioned that I love these ;-)

If you don't mind I would link from my image threads to this your streamlined and fresh image!

Thanks
Dirk

RandyR

unread,
Dec 22, 2020, 11:57:41 AM12/22/20
to PicoChess
No problem, Dirk. I may even work on an image similar to what Marcel made, with a desktop, VNC and Samba. We'll see.

Randy

Dirk

unread,
Dec 22, 2020, 12:00:34 PM12/22/20
to 'Dirk' via PicoChess
Thats sounds even better - because I liked that as well (otherwise I wouldn’t have taken it)

Thanks Randy,

Dirk

Am 22.12.2020 um 17:57 schrieb RandyR <randy...@gmail.com>:

No problem, Dirk. I may even work on an image similar to what Marcel made, with a desktop, VNC and Samba. We'll see.

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/31d09f4c-86e1-487b-ac39-6836ebfac4a9n%40googlegroups.com.

Henri

unread,
Dec 22, 2020, 12:39:35 PM12/22/20
to PicoChess
That sounds excellent guys! May we call that version 3.01 or is that still too soon?

Henri

Op dinsdag 22 december 2020 om 18:00:34 UTC+1 schreef Dirk:

Dirk

unread,
Dec 22, 2020, 12:53:32 PM12/22/20
to pico...@googlegroups.com
As it is mainly a change in the image itself and not the source code (except from the nice display witch off by Rande & Lucas) I don’t think that qualifies for even a 3.00001 version ;-)

Dirk

Von meinem iPad gesendet

Am 22.12.2020 um 18:39 schrieb Henri <hwspij...@gmail.com>:



Henri

unread,
Dec 22, 2020, 7:55:22 PM12/22/20
to PicoChess
Randy, one small request if you go and work on that image. Please put this file in the Henri-voice instead of the one that is there now.
It turns out to be a bad translation as I found out. Thanks in advance!

Henri


Op dinsdag 22 december 2020 om 17:57:41 UTC+1 schreef RandyR:

RandyR

unread,
Dec 22, 2020, 8:00:09 PM12/22/20
to PicoChess
Just a few minutes late, Henri. I will update the image tomorrow. 😊

Randy

Henri

unread,
Dec 22, 2020, 8:00:33 PM12/22/20
to PicoChess
Randy, man you were 10 minutes too quick with that image..... :)

Henri

Op woensdag 23 december 2020 om 01:55:22 UTC+1 schreef Henri:
Reply all
Reply to author
Forward
0 new messages