Raspberry Pi 4 v1.2 inside my DGT Pi

1,714 views
Skip to first unread message

Scally

unread,
Jun 8, 2020, 2:02:54 PM6/8/20
to PicoChess
Hi Guys,

I finally got around to replacing my RPi 3b+ with a RPi 4 inside my DGT Pi.

I had already applied the 2 changes from Lucas, namely dgtpicom and dgtpicom.so within the /etc sub folder.

So today I unscrewed my DGT Pi and removed my RPi 3b+ and with the aid of 2 small metal files I made adjustments to the housing to accommodate the different connectors, with the introduction of the 2 micro HDMI ports, the larger USB-C power socket and the switching of the Ethernet and USB 2 ports.

Then I switched 2 wires as per Lucas’s notes here: https://github.com/lucasvdp/dgtpi/commit/2f1c7496242bfce551ec48999b144666b3909b5e

2 of my wires were different colours from Lucas’s notes, his pin 5 was yellow mine is white, and his pin *37 was grey, my pin 35 is yellow.
I switched the green wire from pin 12 to pin 19 and my yellow wire (not grey) from pin 35 (not *37 as the note says) to pin 23 and closed the casing.

I powered up the DGT Pi with new RPi 4 inside remembering to use my Buster Card as the Stretch card would not work, and all works well, I now can use the MAME engines within my DGT Pi, as they are Buster only.

I attach some photos of my amendments (not the best, but they work), I had already applied a fan with switch and swapped the casing with a limited edition DGT 3000 casing before.


Cheers,

Al.
FC6FA769-6B4E-4D5C-B444-20B46A594230.jpeg
1423870F-FF8D-4752-B154-D2E3C8788C6B.jpeg
4660E2E7-742C-461D-8F9D-A835C0E3BB57.jpeg

RandyR

unread,
Jun 8, 2020, 2:10:45 PM6/8/20
to PicoChess
Very nice!

Thanks for sharing, Al. 🙂

Randy

Lucas van der Ploeg | DGT

unread,
Jun 9, 2020, 7:19:10 AM6/9/20
to PicoChess

Hi Al,

 

Thanks for checking and testing, You are absolutely right and better at counting than I am. The original pi’s have the SCL slave at pin 35 not pin 37.

 

Best regards,

Lucas van der Ploeg | DGT
Product Development

digitalgametechnology.com
+31 (0)53 430 51 95

--
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/4c51d1da-8336-4da0-951d-58d2bd535917o%40googlegroups.com.

me isme

unread,
Jun 9, 2020, 10:36:09 AM6/9/20
to PicoChess
Nice work Scally.
I guess this is neater than my simpler solution, but not for the faint of heart.
I just bought an extra pi 4 and use it with the 'clock part' of the DGT Pi.
Not wishing to rain on DGT but the approach of raspberry Pi plus DGT 3000 clock (just the clock) would be much cheaper too.
(4GB Pi 4 + official power supply + flirc case was around £80 IIRC.  I suppose the 2GB version would be adequate and around £20 cheaper still.).
Guess you have to pay for the DGT-labour aspect of what you achieved yourself.
Still even with the mods, your solution is neater - one less box.

Peter de Wit

unread,
Jun 9, 2020, 4:47:21 PM6/9/20
to PicoChess
Hi,

Connected my Pi4 to my DGT3000 today (replacing my Pi3). Changed the 2 wires and replaced dgtpicom and dgtpicom.so.
Pi4 connects to DGT3000 (as it shows the My DGT Pi message) but after that the DGT3000 seems to lockup (No E-board / message with no spinning /).
Is there any other setting i need to change compared to my Pi3 ?
On my Pi3 i also had to set the GPU clock to 250 to make it work, is this still the case on the Pi4 as well ?

Thanks,
Peter

Op maandag 8 juni 2020 20:02:54 UTC+2 schreef Scally:

Scally

unread,
Jun 9, 2020, 5:47:15 PM6/9/20
to PicoChess
Hi Peter,

I assume you have have the DGT3000 conversion kit to a DGT Pi?

After copying dgtpicom and dgtpicom.so to /opt/picochess/etc did you give them permissions, I copied mine direct from Lucas’s GitHub so didn’t need to.

Try:

cd /opt/picochess/etc
chmod a+x dgtpicom*

and reboot


Cheers,

Al.

Peter de Wit

unread,
Jun 10, 2020, 3:20:06 AM6/10/20
to PicoChess
yes, copied the latest dgtpicom and dgtpicom.so files and gave them the proper permissions.
Ordered conversion kit.
Assumed it would work with the single cable as well but i get the impression there seems to be a communication speed/sync issue (also to much assumptions ....).
I'll wait for the conversion kit with proper cables and connectors to arrive and try again (and report back).
Br.
Peter  

Op dinsdag 9 juni 2020 23:47:15 UTC+2 schreef Scally:

Peter de Wit

unread,
Jun 10, 2020, 4:41:33 AM6/10/20
to PicoChess
BTW, my Pi4 rev 1.2 4G works fine in stand-alone mode connected over bluetooth to the DGT board and the DGT3000 connected via serial to the board.

Op woensdag 10 juni 2020 09:20:06 UTC+2 schreef Peter de Wit:

Scally

unread,
Jun 10, 2020, 5:13:40 AM6/10/20
to PicoChess
Hi Peter,

Thanks for your update.

With your current configuration do you only get 8 characters on the DGT3000 screen? if,so, you will definitely benefit from the 11 character DGT Pi screen.

I ask because I’ve never see any configuration other than what I have, which is Bluetooth connection from my DGT Pi or standalone RPi to my DGT Revelation II. So I get 11 characters on both my DGT Pi and the Rev2 screen.


Thanks,

Al.

Peter de Wit

unread,
Jun 10, 2020, 5:42:02 AM6/10/20
to PicoChess
Will check. Haven't seen any big difference yet compared to my Pi3 driven DGT Pi. I think i have all 11 characters but not fully sure (as i have not seen a message yet that utilizes all 11 chars).
During startup i saw the PicoChs 2.01 message though.
I've also overclocked my Pi4 to 2Mhz and the extra speed seems to compensate well for the serial speed-loss (communication via the DGT Board iso directly to the DGT3000).
Bluetootth connection from my Pi4 to DGT Board is very speedy, stable and fast (by far faster and more stable than when i used a Pi3), also the WiFi stability of the Pi4 is a huge improvement over the Pi3.
Br.
Peter

Op woensdag 10 juni 2020 11:13:40 UTC+2 schreef Scally:

Peter de Wit

unread,
Jun 10, 2020, 5:46:32 AM6/10/20
to PicoChess
Ah, just rebooted and the actual message i saw was "Pico 2.01", so exactly 8 chars.
So confimed that i only have 8 chars via this setup.

Op woensdag 10 juni 2020 11:42:02 UTC+2 schreef Peter de Wit:

Scally

unread,
Jun 10, 2020, 6:17:03 AM6/10/20
to PicoChess
Hi Peter,

Thanks for the info.

Yes my RPi 4’s are overclocked to 2 GHz too, mine do go to 2.147 but then I find that utilities like bcmstat can’t read their speed & temperature so I stay at 2 GHz.

I’m still using my RPi 3b+ overclocked to 1.5 GHz that was in my DGT Pi for my Raspbian Stretch Engine compiles, but soon I’ll be compiling on Raspbian Buster only, or as it’s now known “Raspberry Pi OS”.
I have a separate RPi 4 8gb version housed in a Geekworm chassis booting from a 240gb SATA drive that is now my Master Storage drive for all things Picochess but not used for playing.


Cheers,

Al.

Scally

unread,
Jun 10, 2020, 6:25:23 AM6/10/20
to PicoChess
Hi ‘me isme’

Thanks for your comments, the official DGT Pi does give you a 11 character display though.

Are you Ismenio Souza or is it just a coincidence that your name is similar?


Thanks,

Al.

me isme

unread,
Jun 10, 2020, 10:41:18 AM6/10/20
to PicoChess
Not Souza.  No idea who this is.  
Did not realise the clock (displays) were different models.

RandyR

unread,
Jun 10, 2020, 11:02:54 AM6/10/20
to PicoChess
This is interesting. I thought the DGT Pi is basically a DGT 3000 on top of a Raspberry Pi. I never really looked closely to see if there was any difference in the display whether I was using the DGT Pi by itself, or using the DGT Pi clock cable with a separate RPi4. When using the RPi4, I ensured the DGTPi=true was commented out believing it was the i2c communication that was not enabled in the RPi4. But is this also limiting the clock to 8 characters? I'm a bit confused.

Randy

Scally

unread,
Jun 10, 2020, 11:21:46 AM6/10/20
to PicoChess
Hi Randy,

I was confused too until the other day.

I was trying to get an 11 character display for Henri, his set-up was a RPi, a DGT board and an unmodified DGT3000 clock. So I spoke to a old friend of ours and it seems you can only get 11 characters if the
“dgtpi = True” flag is set in the picochess ini, or you start Picochess manually with an additional “pi” on the end
(sudo python3 ./picochess.py -w -pi)

So 11 characters is only possible on a DGT Pi or a modified DGT3000 with the pi flag set, otherwise you will get 8 characters on the clock (or 6 on a very old clock).

I hope I’ve understood & relayed that correctly.


Cheers,

Al.

RandyR

unread,
Jun 10, 2020, 11:38:03 AM6/10/20
to PicoChess
Thanks, Al.

That's good to know. I wonder if a simple code fix would allow 11 characters, or if it's more involved than that (which I suspect it is)?

Randy

Peter de Wit

unread,
Jun 10, 2020, 2:49:38 PM6/10/20
to PicoChess
The difference is where the DGT3000 is connected.
1: Via serial connection to the DGT Board. The Pi is also connected to the DGT Board (via Bluetooth or USB) and communicates via the board to the DGT3000. Pi runs in stand-alone mode (Picochess DGT-Pi flag not set)
2: via I2C directly to the Pi (via 3.5mm jack cable or via DGT Pi conversion kit). Pi connected to DGT Board (via Bluetooth or USB). Pi runs in DGT Pi mode (Picochess DGT/Pi flag set).
Option 1 gives 8 characters on the DGT3000 and option 2 all 11 characters (and more snappier respons).
Br.
Peter

RandyR

unread,
Jun 10, 2020, 3:44:22 PM6/10/20
to PicoChess
I'm wondering why the same display utilizes uses 8 segments when using the clock cable plugged in the side but over i2c from the enclosed/directly connected Rpi3b it can use all 11 segments. Perhaps the output from the DGT chess board can only provide 8 characters? And, yes, it's definitely more responsive via i2c.

Randy

Peter de Wit

unread,
Jun 15, 2020, 1:13:17 PM6/15/20
to PicoChess
Hi,

Trying to replace my Pi3 with Pi4B using the cable solution, but i do not get it to work.
I get the "My DGT Pi" message on my DGT3000 after rebooting my Pi 4 B and having the cable attached (and the switched pin 12 & 35 to resp. 19 & 23), but than my DGT3000 hangs (connection seems lost and "My DGT Pi" message stays on the screen forever.
Is there something more to change on the Pi side ?
Have tried the GPU_freq=250 setting in config.txt but that does not help.
Any hints ?
br.
Peter

Op woensdag 10 juni 2020 21:44:22 UTC+2 schreef RandyR:

Scally

unread,
Jun 15, 2020, 3:14:47 PM6/15/20
to PicoChess
Hi Peter,

Yes you need to copy dgtpicom & dgtpicom.so from here:
https://github.com/lucasvdp/dgtpi

into /opt/picochess/etc

Or if you have my latest image:

into /opt/shared-folders/etc

I’m not sure if it’s needed but I gave them file permissions via:

Peter de Wit

unread,
Jun 16, 2020, 4:29:04 AM6/16/20
to PicoChess
Strange, i did all that, also get the initial message "My DGT Pi" in the DGT3000 screen, but that's all. Then my DGT3000 seems to lock-up also board does not respond anymore so also could be my Pi or the i2c process (so probably the dgtpicom and/or dgtpicom.so processes crash/abort).
Is there a way i can test this (so if one of these processes aborts) ?
Does it make sense to compile dgtpicom and dgtpicom.so on my pi ? 
I have enables i2c on my Pi 4 via Raspi-Config. Is that OK and should i do something more (like set the gpu speed to a specific value) ? 

Op maandag 15 juni 2020 21:14:47 UTC+2 schreef Scally:

Scally

unread,
Jun 16, 2020, 5:15:43 AM6/16/20
to PicoChess
Hi Peter,

I just followed Lucas’s instructions here:

https://github.com/lucasvdp/dgtpi/commit/2f1c7496242bfce551ec48999b144666b3909b5e (although swapping from pin 37 to 23 should read from 35 to 23)

He has compiled dgtpicom and dgtpicom.so for us for no compiling is required.

All I did was copied the 2 files into the /etc sub directory, swapped 2 wires (pins 12 to 19 & 35 to 23) rebooted and away I went. I did not enable i2c and overclocking values should not make a difference.

Now that yours is treated as a DGT Pi, I assume you’ve set dgtpi = True in your picochess.ini file, if you’ve loaded my latest image then is done for you when you run “Version+Engine.sh” and select 1 to “Are you using a DGT Pi or equivalent ?” etc.


Cheers,

Al.

Scally

unread,
Jun 16, 2020, 5:31:53 AM6/16/20
to PicoChess
Hi Peter,

Update:

I just tried enabling and disabling the i2c process, my DGT Pi works both ways, so I’m keeping mine disabled as it was.

The only time I’ve heard from others or seen the “DGT Pi” stay on the clock and not connect to the board is when the dgtpi flag was set wrong, so I’m sure it’s that.


Cheers,

Al.

Peter de Wit

unread,
Jun 16, 2020, 4:26:59 PM6/16/20
to PicoChess
Compiled dgtpicom and dgtpicom.so on my pi 4 with extensive debug info (DEBUG2 flag).
Get a lot of i2c errors after connection to dgt3000 (and using dgtpicom via command line).
Interesting fact was that with the extensive debug info i got further in the startup process before my DGT3000 stopped displaying new messages (got to the Picochs 201 message), so it seems to have something to do with i2c message timing (as the debug messages take more time) ?! 
Also my DGT3000 now ends in the clock display but does not show any moves and is not connected (small screen icon not lit). The board responds though and the DGT Pi Web Server works (and shows moves) so my pi is not hanging.
All very strange.
I use Al's image and switch using the shell script. 
Will continue investigating (can there be a difference in Pi4's and connected i2c interface timing ?).

Op dinsdag 16 juni 2020 11:31:53 UTC+2 schreef Scally:

Scally

unread,
Jun 16, 2020, 4:53:33 PM6/16/20
to PicoChess
Hi Peter,

Interesting ....

I have no idea why the DGT Pi and the DGT 3000 with the conversion kit would act differently.

You obviously checked all your wiring, hopefully Lucas of DGT is reading this and can shed some light on it.


Al.

Lucas van der Ploeg | DGT

unread,
Jun 17, 2020, 6:29:28 AM6/17/20
to PicoChess

Hi peter,


It does sound like a timing problem. But setting gpu_freq=250 in /boot/config.txt should have fixed this problem. Maybe you can try this again?

Can you send me the exact output of a manual "sudo ./dgtpicom 'Hoi Peter'" after compiling with debug2?


If the problem is in de the GPU frequency maybe I can adjust the code to make it independent of the GPU frequency.


Met vriendelijke groet,



Lucas van der Ploeg | DGT


From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of Peter de Wit <p3d...@gmail.com>
Sent: 16 June 2020 22:26:58
To: PicoChess
Subject: Re: Raspberry Pi 4 v1.2 inside my DGT Pi
 
--
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.

Peter de Wit

unread,
Jun 17, 2020, 8:07:27 AM6/17/20
to PicoChess
Just retried everything with addition of gpu_freq=250 and now all works !

Op woensdag 17 juni 2020 12:29:28 UTC+2 schreef Lucas van der Ploeg:
To unsubscribe from this group and stop receiving emails from it, send an email to pico...@googlegroups.com.

Peter de Wit

unread,
Jun 17, 2020, 8:11:52 AM6/17/20
to PicoChess
Although i thought i tried this before only without the DEBUG2 flag (not sure and no proof anymore).
Will try without DEBUG2 flag and report back.

Op woensdag 17 juni 2020 14:07:27 UTC+2 schreef Peter de Wit:

Peter de Wit

unread,
Jun 17, 2020, 8:16:25 AM6/17/20
to PicoChess
Now i'm sure i tried before because after few moves DGT3000 stops responding again.
So seems gpu_freq=250 on Pi4 does not solve the problem completely.
I suspect that in this case, together with the DEBUG2 flag things started working, for a bit.
So if you could make it gpu_freq independent that would be perfect.
Will try to get some output over when issuing the manual dgtpicom command.

Op woensdag 17 juni 2020 14:11:52 UTC+2 schreef Peter de Wit:

Peter de Wit

unread,
Jun 17, 2020, 8:18:04 AM6/17/20
to PicoChess
This is the respons of the manual dgtpicom command after DGT3000 stops working.

-> 10 20 06 0b 39 b9 = Change State

261.418     Receive error: Timeout, hardware stays in receive mode for more then 10ms

00 

<- 00 30 fd b6 94 07 fd b6 04 00 00 00 70 29 fd b6  = Error: -6

261.419     Send error: Bus free timeout, waited more then 10ms for bus to be free

                I2C Slave receive busy, is the receive thread running?

261.419 sending mode25 command failed, sending failed

-> 10 20 06 0b 39 b9 = Change State

261.429     Receive error: Timeout, hardware stays in receive mode for more then 10ms

00 

<- 00 30 fd b6 94 07 fd b6 04 00 00 00 70 29 fd b6  = Error: -6

261.432     Send error: Bus free timeout, waited more then 10ms for bus to be free

                I2C Slave receive busy, is the receive thread running?

261.432 sending mode25 command failed, sending failed

261.432 I2C error, remove jack plug


Will also try a fresh one .....


Op woensdag 17 juni 2020 14:16:25 UTC+2 schreef Peter de Wit:

Lucas van der Ploeg | DGT

unread,
Jun 17, 2020, 10:29:32 AM6/17/20
to PicoChess

Hi,

 

I can make code to adjust the I2C frequency depending on the GPU frequency. At the moment the code assumes a GPU frequency of 250 MHz. If there are still problems when running on 250MHz this code change won’t fix these.

 

Your error messages do suggest a different problem. Maybe there is something wrong with the wiring or one of the devices is stuck and keeps one of the lines low. Both the clk and the sda lines should be high when not communicating. A reset of both the clock and the raspberry should help. Have you checked the batteries of the clock?

 

Best regards,

Lucas van der Ploeg | DGT

Product Development

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/486b5c68-7eb8-4085-b798-2bca61d384c1o%40googlegroups.com.

RandyR

unread,
Jun 17, 2020, 12:01:07 PM6/17/20
to PicoChess
Peter,

This seems strange. The default gpu_freq is 500. Al can correct me, but I don't think he lowered it to 250 in his setup..

You may want to install a fresh Raspberry Pi OS (32-bit) Lite on another SD Card and then install Picochess manually. Something else to look at is the RPi4 power supply (5.1V / 3.0A DC output).

Randy

Scally

unread,
Jun 17, 2020, 12:25:39 PM6/17/20
to PicoChess
Hi all,

My gpu_freq is still at 500

Here’s all my settings:

Al@PicoChess:~ $ vcgencmd get_config int
arm_freq=2000
audio_pwm_mode=514
config_hdmi_boost=5
core_freq=750
core_freq_min=200
disable_commandline_tags=2
disable_l2cache=1
display_hdmi_rotate=-1
display_lcd_rotate=-1
enable_gic=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq=500
gpu_freq_min=250
h264_freq=600
init_uart_clock=0x2dc6c00
isp_freq=600
lcd_framerate=60
over_voltage=6
over_voltage_avs=-42500
pause_burst_frames=1
program_serial_random=1
temp_soft_limit=68
total_mem=4096
v3d_freq=700
hdmi_force_cec_address:0=65535
hdmi_force_cec_address:1=65535
hdmi_pixel_freq_limit:0=0x11e1a300
hdmi_pixel_freq_limit:1=0x11e1a300
Al@PicoChess:~ $

These are my overclock settings:

# Overclock
arm_freq=2000
over_voltage=6
core_freq=750
h264_freq=600
isp_freq=600
v3d_freq=700
temp_soft_limit=68 #increase lower throttling threshold


Thanks,

Al.

Peter de Wit

unread,
Jun 17, 2020, 1:42:01 PM6/17/20
to PicoChess
Hi Guys,

Thanks for your support.
Will do a complete fresh install and report back.

Thanks,
Peter

Op woensdag 17 juni 2020 18:25:39 UTC+2 schreef Scally:

Peter de Wit

unread,
Jul 5, 2020, 5:39:41 AM7/5/20
to PicoChess
Hi,
Made some progress, but still issues on my Pi4.
I now have a setup (SD Card with Picochess and DgtPi config) that works flawlessly on my Pi3.
When i start my Pi4 with this card (and adapted wiring, same cabling as used on my Pi3, only 2 Pi pins changed) connections startup well and i can play about a move or 15-20 (sometimes less) and then randomly connection to my DGT3000 drops (and DGT3000 hangs).
I need to put gpu speed on 250 (otherwise it will not work at all, this is also the case with my Pi3 btw).
Improvement is that there is no difference anymore when i use dgtpicom with or without debug messages.

Messages in my log changed as well and i now see mainly below messages after issues show:
:

2020-07-05 11:09:09.439 WARNING         pi - _display_on_dgt_pi: SetText() returned error -6, running configure

2020-07-05 11:09:09.462 WARNING         pi - _run_configure: Configure() also failed -6, resetting the dgtpi clock

2020-07-05 11:09:09.499 WARNING         pi - _display_on_dgt_pi: finally failed -6

2020-07-05 11:09:09.499 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:09.499 WARNING      iface - _create_task: DgtApi command DGT_DISPLAY_TEXT failed result: False

2020-07-05 11:09:09.600 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:09.701 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:09.801 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:09.902 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.002 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.103 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.204 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.305 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.406 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.506 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.608 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.709 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.809 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:10.937 WARNING         pi - _display_on_dgt_pi: SetText() returned error -6, running configure

2020-07-05 11:09:10.961 WARNING         pi - _run_configure: Configure() also failed -6, resetting the dgtpi clock

2020-07-05 11:09:10.998 WARNING         pi - _display_on_dgt_pi: finally failed -6

2020-07-05 11:09:10.998 WARNING      iface - _create_task: DgtApi command DGT_DISPLAY_TEXT failed result: False

2020-07-05 11:09:10.998 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.099 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.200 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.300 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.401 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.501 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.602 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.703 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.803 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.904 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:11.936 WARNING         pi - start_clock: SetAndRun() returned error -6, running configure

2020-07-05 11:09:11.960 WARNING         pi - _run_configure: Configure() also failed -6, resetting the dgtpi clock

2020-07-05 11:09:12.004 WARNING         pi - start_clock: finally failed -6

2020-07-05 11:09:12.004 WARNING      iface - _create_task: DgtApi command DGT_CLOCK_START failed result: False

2020-07-05 11:09:12.005 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:12.105 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6

2020-07-05 11:09:12.206 WARNING         pi - _process_incoming_clock_forever: GetButtonMessage returned error -6


Any hints where to look now ?

Could something be broke ?

I have a brandnew DGT3000 (firmware 2.02), could that be the issue (as perhaps something changed there ?


Br.

Peter


Op woensdag 17 juni 2020 19:42:01 UTC+2 schreef Peter de Wit:

Lucas van der Ploeg | DGT

unread,
Jul 6, 2020, 4:07:36 AM7/6/20
to PicoChess

Hi,


it looks like something is stuck in hardware. error -6 means a timeout occurs waiting for a message to arrive or a timeout occurs waiting for the bus to be free so we can send a message. In this case the hardware seems to be stuck in receive. The software should reset the I2C device of the pi if this happens. Maybe the reset is not called or the reset is not working for the pi4. 


Which of the following solutions help to recover from this error.

- Restart picochess (if this works a software fix should be simple)

- Reboot the pi (without disconnecting power)

- power cycle the pi (disconnect the power)

- power cycle the DGT3000 (without restarting picochess)

- remove and reconnect the wires (without restarting picochess)


There were some problems with older pi's also and it took a while to find a workaround on how to reset the I2C hardware without a power cycle.


kind regards,

Lucas van der Ploeg


Sent: 05 July 2020 11:39:41

To: PicoChess
Subject: Re: Raspberry Pi 4 v1.2 inside my DGT Pi
--
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/1cfd4115-8466-4dc6-91ac-6141638a5ad9o%40googlegroups.com.

Peter de Wit

unread,
Jul 7, 2020, 11:03:33 AM7/7/20
to PicoChess

Ok, tried all.


Which of the following solutions help to recover from this error.

- Restart picochess (if this works a software fix should be simple) => Does NOT recover from the error

- Reboot the pi (without disconnecting power) => recovers from the error

- power cycle the pi (disconnect the power) => recovers from the error

- power cycle the DGT3000 (without restarting picochess) => does NOT recover from the error

- remove and reconnect the wires (without restarting picochess) => does NOT recover from the error


Br.

Peter


Op maandag 6 juli 2020 10:07:36 UTC+2 schreef Lucas van der Ploeg:
To unsubscribe from this group and stop receiving emails from it, send an email to pico...@googlegroups.com.

Peter de Wit

unread,
Jul 7, 2020, 11:05:38 AM7/7/20
to PicoChess
Correction => disconnecting and reconnecting the wires DOES recover from the error !

Op dinsdag 7 juli 2020 17:03:33 UTC+2 schreef Peter de Wit:

Lucas van der Ploeg | DGT

unread,
Jul 8, 2020, 4:50:03 AM7/8/20
to PicoChess

Hi,

 

Thanks for trying everything! The results suggest the I2C slave device of the raspberry pi 4 can get stuck. The code already tries to restart the slave device but this does not seem to help. Maybe toggling the lines might help. You could try this with help from the gpio utility from wiringpi.

When the communication fails, stop picochess and run these commands, after this you can restart picochess and maybe communication is working again.

“gpio readall” will give the current state of the pins (ignore the wPi numbers they are confusing).

“gpio –g mode 10 out” will set pin 10 to output

“gpio –g write 10 0” will set pin 10 to low

“gpio –g mode 10 in” will set pin 10 to input

 

You can check every step using the readall command and you can do the same for pin 11. Please make sure you finish by setting the pins to input otherwise Picochess won’t run.

 

I am still not sure why other pi 4’s don’t have the same problem. But if toggling the pins helps we can build this in to the code.

 

Best regards,

Lucas van der Ploeg

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/4f7a60d6-30a8-40f4-9e17-52cceec1045ao%40googlegroups.com.

Peter de Wit

unread,
Jul 8, 2020, 7:31:42 AM7/8/20
to PicoChess
OK

readall output after issue (and right after stopping picochess):

 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |

 |   2 |   8 |   SDA.1 | ALT0 | 0 |  3 || 4  |   |      | 5v      |     |     |

 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |

 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | IN   | TxD     | 15  | 14  |

 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |

 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |

 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |

 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |

 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |

 |  10 |  12 |    MOSI | ALT3 | 0 | 19 || 20 |   |      | 0v      |     |     |

 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |

 |  11 |  14 |    SCLK | ALT3 | 1 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |

 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |

 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |

 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |

 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |

 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |

 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |

 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |

 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+



Op woensdag 8 juli 2020 10:50:03 UTC+2 schreef Lucas van der Ploeg:

Lucas van der Ploeg | DGT

unread,
Jul 8, 2020, 7:42:50 AM7/8/20
to PicoChess

I notice the SDA line is pulled low by someone. (V=0) for both pin 3(=BCM 2) and pin 19 (=BCM 10) I want to know if this is the master or the slave. If you disconnect the wires do they both go up again (V=1)

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/34173840-08e7-40b0-8df5-393cc746742co%40googlegroups.com.

Peter de Wit

unread,
Jul 8, 2020, 7:46:26 AM7/8/20
to PicoChess
Hi Lucas,

Tried all.
Strange thing is that it works, but only when doing it twice in a row !?

So after resetting pins 10 & 11 for the first time, immediately after starting picochess again they both return to ALT3 state (from IN state after last gpis call).
If i reset a second time connection is established again correctly.
This even works without stopping picochess.
So if the connection to the clock fails, after resetting pins 10 & 11 2 times connection is reset and all works again (for some time).

br.
Peter

Op woensdag 8 juli 2020 10:50:03 UTC+2 schreef Lucas van der Ploeg:

Peter de Wit

unread,
Jul 8, 2020, 7:48:09 AM7/8/20
to PicoChess
Sorry, BCM 10 & 11 (it's pins 19 & 23).

Op woensdag 8 juli 2020 13:46:26 UTC+2 schreef Peter de Wit:

Peter de Wit

unread,
Jul 8, 2020, 9:11:26 AM7/8/20
to PicoChess
Hi Lucas,

If i disconnect the wires BCM 2 goes up but BCM 10 stays low.

br.
Peter

Op woensdag 8 juli 2020 13:42:50 UTC+2 schreef Lucas van der Ploeg:

To unsubscribe from this group and stop receiving emails from it, send an email to <a hr

Peter de Wit

unread,
Jul 8, 2020, 10:41:55 AM7/8/20
to PicoChess
FYI, i have this issue on both the Pi4's i have, they both behave exactly the same (with both different picochess images).
Only thing the same is the wiring and the DGT3000 ....

Op woensdag 8 juli 2020 15:11:26 UTC+2 schreef Peter de Wit:

Lucas van der Ploeg | DGT

unread,
Jul 9, 2020, 8:33:45 AM7/9/20
to PicoChess

Thanks for all the tests, I think I will make a special version of the library that tries many things to recover from this problem. This does not really solve the problem or explain the problem but at least you can keep playing hopefully without even noticing.

 

Maybe I have some time tomorrow otherwise it will take a few weeks.

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/bedee81a-ccf4-4d64-9dd6-e9c96da9b4f9o%40googlegroups.com.

Peter de Wit

unread,
Jul 9, 2020, 9:58:17 AM7/9/20
to PicoChess
Great ! Thanks.
Br. Peter

Op donderdag 9 juli 2020 14:33:45 UTC+2 schreef Lucas van der Ploeg:

Lucas van der Ploeg | DGT

unread,
Jul 29, 2020, 9:27:56 AM7/29/20
to PicoChess

Hi,


I have managed to reproduce the error but only once. After trying many things, my setup recovered without disconnecting wires or rebooting. I put the last thing I tried in a new version of dgtpicom. I also added support for 500MHz GPU frequency for the pi 4. You can now leave the pi 4 on its default GPU frequency 500 MHz. 


You can test it by downloading dgtpicom and dgtpicom.so from https://github.com/lucasvdp/dgtpi and replacing the files in your picochess dgt directory.

Please let me know if there are still problems. Maybe a multiple of my attempts are needed for the fix not just the last one.


Best regards,

Lucas van der Ploeg | DGT


Sent: 09 July 2020 15:58:17
--
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.

Peter de Wit

unread,
Jul 29, 2020, 1:11:16 PM7/29/20
to PicoChess
Hi,

Thanks Lucas.
Will test and report back.

br.
Peter

Op woensdag 29 juli 2020 15:27:56 UTC+2 schreef Lucas van der Ploeg:
To unsubscribe from this group and stop receiving emails from it, send an email to pico...@googlegroups.com.

Lucas van der Ploeg | DGT

unread,
Jul 29, 2020, 2:09:05 PM7/29/20
to PicoChess

Hi,


I did another update. After some continues tests it failed again, this time the I2C slave device did not recover. I tried a different way of resetting the slave device which seems to work. 


Met vriendelijke groet,



Lucas van der Ploeg | DGT

Sent: 29 July 2020 19:11:16
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/9d1176c1-442f-45a0-9e7c-4527f4703f1ao%40googlegroups.com.

mvanthoor

unread,
Jul 29, 2020, 4:23:48 PM7/29/20
to PicoChess
Hi Lucas,

There are now several versions of dgtpicom and dgtpicom.so floating around:

1. The ones that come with PicoChess 0.9N
2. The ones that you attached in a post in this group (which was pointed out to me)
3. These new ones in your repository.

Are these new drivers safe to just put in a new image? I'm building a new image from scratch, on an RPi4.

If someone will configure the image for a RPi3 in an original, unchanged DGTPi, is it OK to have these new drivers in there, or are they only to be used for a DGTPi that has been modded to contain a Pi4?

Thanks :)

On Wednesday, 29 July 2020 at 20:09:05 UTC+2 Lucas van der Ploeg wrote:

Hi,


I did another update. After some continues tests it failed again, this time the I2C slave device did not recover. I tried a different way of resetting the slave device which seems to work. 


Met vriendelijke groet,



Lucas van der Ploeg | DGT

Lucas van der Ploeg | DGT

unread,
Jul 30, 2020, 3:35:44 AM7/30/20
to pico...@googlegroups.com

Hi,

 

The newest version on my github page should work on all the versions of Raspberry Pi. I have only tested it using an overnight test script on the raspberry pi 4. If other people can also do some tests, preferably on multiple Raspberry Pi versions, we can push it to the PicoChess repository. Maybe including some other updates needed to make PicoChess work on a pi 4.

 

 

Best regards,

Lucas van der Ploeg | DGT

Scally

unread,
Jul 30, 2020, 9:41:55 AM7/30/20
to PicoChess
Hi Lucas,

I have tested your latest updates on a RPi 3b+ outside the DGT Pi on Picochess v0.9n, v2.01 and above and all works well.

However, testing on my RPi 4 within the DGT Pi was not good. On all versions of Picochess I tested, the connection spiral kept stopping and although it eventually connected the display on the DGT Pi remained on the Revelation II’s serial number. The Rev2 connected but although the menus still worked on the DGT Pi, it eventually froze and I was unable to start a game.

I have reverted your updates on the DGT Pi and all is OK again.


Cheers,

Al.

Lucas van der Ploeg | DGT

unread,
Jul 30, 2020, 11:08:19 AM7/30/20
to PicoChess

Hi Al,


thanks for testing!


at what GPU speed have you configured you pi4? the script now assumes 500 MHz when it detects a pi4, I had some trouble ad first but now it works oke for me on the 500 MHz


I noticed, that while running a test script overnight no errors occurred. But when I started using my pi 4 some errors did occur. I could recover from these errors by restarting the script. The errors might depend on the temperature, voltage, load or throttling of the pi.


kind regards,


Lucas van der Ploeg | DGT


From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of Scally <scall...@gmail.com>
Sent: 30 July 2020 15:41:55
To: PicoChess
Subject: RE: Raspberry Pi 4 v1.2 inside my DGT Pi
 
--
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.

Scally

unread,
Jul 30, 2020, 11:32:15 AM7/30/20
to PicoChess
Hi Lucas,

My RPi 4 is overclocked to 2 GHz the GPU was overclocked to 750 MHz, which I’ve now reverted to 500 MHz.

I added your 2 files back in to /etc and rebooted, the behaviour is no different, the “no-eBoard /“ is extremely sluggish but the clock eventually connects but then gets stuck on either the “no eBoard/” or ‘RevII 10005’ display without ever showing the clocks.

I also noticed the initial “DGT Pi” message and beep were no longer there?

Your old files work fine for me, so I’m reverting again.


Cheers,

Al.

RandyR

unread,
Jul 30, 2020, 4:09:18 PM7/30/20
to PicoChess
I replaced dgtpicom and dgtpicom.so on my 4GB Pi4B Rev 1.1 and didn't see any difference. I'm using the clock cable from the board to the DGTPi. I get the same warnings in the log:

2020-07-04 15:19:59.073 WARNING      board - _read_board_message: illegal id in message header 0x81 length: 5
2020-07-04 15:19:59.863 WARNING      board - _read_board_message: illegal id in message header 0x81 length: 5
2020-07-04 15:20:00.853 WARNING      board - _watchdog: (ser) clock is locked over 2secs
2020-07-04 15:20:00.966 WARNING      board - _read_board_message: illegal id in message header 0x81 length: 5
2020-07-04 15:20:10.613 WARNING      board - _process_board_message: (ser) clock illegal new time received (11, 59, 59, 11, 59, 59, 10)
2020-07-04 15:20:12.708 WARNING      board - _process_board_message: (ser) clock illegal new time received (11, 59, 59, 11, 59, 59, 10)
2020-07-30 13:55:59.952 WARNING      board - _read_board_message: illegal length in message header 0xff length: 138
2020-07-30 14:22:27.738 WARNING      board - _watchdog: (ser) clock is locked over 2secs
2020-07-30 14:54:02.992 WARNING      board - _watchdog: (ser) clock is locked over 2secs
2020-07-30 14:55:40.053 WARNING      board - _watchdog: (ser) clock is locked over 2secs
2020-07-30 14:55:40.683 WARNING      board - _wait_for_clock: (ser) clock is locked over 3secs
2020-07-30 15:00:24.249 WARNING      board - _watchdog: (ser) clock is locked over 2secs
2020-07-30 15:00:27.251 WARNING      board - _watchdog: (ser) clock is locked over 2secs

Randy

mvanthoor

unread,
Jul 30, 2020, 5:21:40 PM7/30/20
to PicoChess
Hi Lucas,

It would be great if you could update dgtpicom and dgtpicom.so in the PicoChess repository; it seems multiple people are now using multiple different files. With regard to updating PicoChess' requirements and such, to make it run on a Raspberry Pi 4 without having to do a lot of file replacements after cloning the repository, I'm already working on this.

I've just set up my local repository (on the RPi4 itself) and all the Github signing stuff and so on, and pushed a (draft) roadmap to my own PicoChess repo.

mvanthoor

unread,
Jul 30, 2020, 5:29:43 PM7/30/20
to PicoChess

Hi Al,

It's becoming comfusing which dgtpicom and dgtipicom.so files I should be using. I now have:

- The original ones in the repository.
- Two different versions linked in the group
- The version Lucas just updated.

Could you send me the files you are now successfully using on a DGTPi that has a Raspberry Pi 4?

For others, or maybe Al...

I'd also need to know if:
- If the files Al now uses successfully on his RPi4 DGTPi also work on a standalone RPi4 (probably)
- If the files Al now uses successfully on his Rpi4 DGTPi also work on an unmodified DGTPi, and on an RPi3.

I'm (probably) also getting a new DGT board to update my 13-year old one (to get rid of the wobbly Hirose connector, even though it still works) and another DGT 3000 LE; so I'd have a full setup for testing. I'd be doing this regardless of work on PicoChess. For PicoChess, I'd be willing to get an RPi3B+ and an RPi Zero W as extra, but not a DGTPi or a BT board.

Thanks for any help.

Scally

unread,
Jul 31, 2020, 5:03:44 AM7/31/20
to PicoChess
Hi Marcel,

I’m using Lucas’s original files he changed for the RPi 4.

If you clone his GitHub you can go back to this and retrieve the files there:

git clone https://github.com/lucasvdp/dgtpi
cd dgtpi
git checkout 2f1c7496242bfce551ec48999b144666b3909b5e
Copy dgtpicom & dgtpicom.so

If need be, you can issue git checkout master to return your GitHub copy of dgtpi to the current state, then later issue git pull to retrieve any updates.

This works for me with a RPi 4 within a DGT Pi and the RPI 3b+ Standalone, it should work with older RPi’s.

I think the only problem is with a RPi 4 and DGT 3000 with the DGT Pi conversion kit, but I stand to be corrected.


Cheers,

Al.

Lucas van der Ploeg | DGT

unread,
Jul 31, 2020, 5:28:11 AM7/31/20
to PicoChess

Hi Al, Randy, Marcel, Peter and everybody else.


The dgtpicom and dgtpicom.so files are only used to communicate from the raspberry pi directly to the DGT3000 (e.g. DGT pi). So when using the clock cable between the board and the DGT3000 these files are not used.


The version of dgtpicom in the picochess repository does not work for the pi4. I made a new version that is not reliably for Peter. I tried to fix this but now it is no longer working for Al. Bit strange as we are all using the exact same hardware.

I suspect this might have something to do with my attempt of making it run on a higher GPU clock.


As long as there is no version that is working correctly for everyone I will not push it to the picochess repository.


To confirm the problem. I attached a version that should only work (without to many packets lost) on a gpu clock of 250MHz just like the version that worked for Al. Could you try again if this version is working for you Al?


You can double check the gpu frequency using:

vcgencmd measure_clock core


kind regards,


Lucas van der Ploeg | DGT


From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of mvanthoor <mj.va...@gmail.com>
Sent: 30 July 2020 23:29:43

To: PicoChess
Subject: Re: Raspberry Pi 4 v1.2 inside my DGT Pi
--
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.
dgtpicom
dgtpicom.so

mvanthoor

unread,
Jul 31, 2020, 6:38:06 AM7/31/20
to PicoChess
Thanks Al. I will get those files from the repository under commit 2f1c7496242bfce551ec48999b144666b3909b5e

As it is confirmed that these files are working, at least for you, I will put them into the new PicoChess 10 base image (because without them, PicoChess will certainly not run on a DGTPi with Pi4), but not yet in a pull request to the official jromang repository.

After the base image is finished (hopefully somewhere this weekend), it will be easy to change the files. Just upload them through the Samba share or SCP, and reboot the pi. After a version is determined to work for everyone (or should be working for everyone), it can be put into the repository.

I am assuming that the files that are in the PicoChess Repository right now, don't work with the Buster OS. If they do, I could leave them in the new base image, so the image will at least work 100% correctly with an original, unmodified DGT Pi3, and provide the files Al is using as an alternative.

@Lucas: If I'm reading this correctly, both Al and Peter have upgraded their DGT Pi from version 3B+ to version 4B. This requires an upgrade to the Buster OS. The original files in the PicoChess repository don't work on the DGT Pi4; either because of the Buster OS, or because of the Pi4 hardware. You made a modification to dgtpicom.so, and dgtpicom; these modifications work fine for Al, but not for Peter.

This would mean that there is a difference between Al's and Peter's DGT Pi4. So...

1. Peter has made some mistake in wiring up the Pi4 to the DGT-clock.
2. Peter's DGT-clock is of a different revision than Al's and needs a different fix
3. Peter's Pi4 is of a different revision than Al's, and needs a different fix.

If it can be determined that 1. is NOT the case (Peter's wiring is correct), we can compare clocks and Pi's, and maybe then there need to be TWO fixes. On top of that, only the fix needed for the specific Pi or clock version would need to be used when running.

If over- and underclocking or even voltages, and temperature/throttling has an impact on this, it could become somewhat difficult to get everything working for everyone.

The one thing I'd absolutely like to have working on the new PicoChess 10 image is that this image runs without problems on an original, unmodified DGT Pi as it comes from the store. If this is working with Al's version of dgtpicom and dgtpicom.so, I suggest that these files become the default in the new base image, and in the official jromang repository.

People with modified DGT Pi's can test different versions of dgtpicom and dgtpicom.so, as said, by uploading them to the pi and rebooting.

Scally

unread,
Jul 31, 2020, 6:38:35 AM7/31/20
to PicoChess
Hi Lucas,

Yes they work for me on both my RPi 4 in the DGT Pi (the beep and DGT Pi message are back) and on my standalone RPi 3b+.


Thanks,

Al.

Lucas van der Ploeg | DGT

unread,
Jul 31, 2020, 8:20:08 AM7/31/20
to PicoChess

Hi,


I don't expect a wiring mistake and everybody should be using the same hardware. I suspect there is just a difference in chance of the error occurring depending on the silicone and environment. This would mean the problem can occur on any pi4, Peter is just a bit less lucky. This is also why I would not advice to use the version Al mentioned. It would be really annoying if Picochess stopped working just when you were about to win.


The problem Al is having has something to do with his GPU or Core clock. The behavior suggest his core_freq is 250 MHz while his gpu_freq is set to 750 Mhz


Al can you check your core frequency using "vcgencmd measure_clock core"

maybe you have hdmi_enable_4kp60 or enable_tvout configured? see "specific to Pi 4B" section in:

https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md


kind regards,

Lucas van der Ploeg | DGT


From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of Scally <scall...@gmail.com>
Sent: 31 July 2020 12:38:34

To: PicoChess
Subject: Re: Raspberry Pi 4 v1.2 inside my DGT Pi
--
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.

Scally

unread,
Jul 31, 2020, 8:40:02 AM7/31/20
to PicoChess
Hi Lucas,

If I understand it correctly I didn’t touch my GPU with my overclock, however the RPi 4 GPU is 500 MHz not 250 MHz like the RPi 3b+. I think think the RPi 4 GPU is 250 MHz idle.

Here’s the results of your suggested command on my devices:

RPi4: Al@PicoChess:~ $ vcgencmd measure_clock core
frequency(1)=278569344

RPi 3b+: Al@PicoStretch:~ $ vcgencmd measure_clock core
frequency(1)=250000000

Just to make sure we understand each other, your new code from this morning works as does your original RPi 4 changes, but not the code we tried yesterday.


Cheers,

Al.

mvanthoor

unread,
Jul 31, 2020, 8:57:53 AM7/31/20
to PicoChess
On Friday, 31 July 2020 at 14:20:08 UTC+2 Lucas van der Ploeg wrote:

Hi,


I don't expect a wiring mistake and everybody should be using the same hardware. I suspect there is just a difference in chance of the error occurring depending on the silicone and environment. This would mean the problem can occur on any pi4, Peter is just a bit less lucky. This is also why I would not advice to use the version Al mentioned. It would be really annoying if Picochess stopped working just when you were about to win.


I agree. Therefore, my suggestion was to use the latest known versions of dgtpicom and dgtpicom.so in the new base image, that are known to work correctly on an unmodified  DGT Pi straight from the store.

If we do this, people who have not modded their DGT Pi can just download and install the latest image, and be happy with a working DGT Pi with stock hardware. It would be no problem to put those versions of the files into the repository.

We can then either provide instructions about how to modify this image, or provide another image for modded DGT Pi4's with the warning that it might not yet work correctly for some people.

Doing it this way would mean we'd have an updated official repository, which can be used directly on top of a Buster image without modification, and work on a Pi 3B+, 4B, and the stock DGT Pi.

Scally

unread,
Jul 31, 2020, 9:05:17 AM7/31/20
to PicoChess
Hi Marcel,

The versions I mentioned this morning in reply to your question were the official RPi 4 and downward versions until Randy started having his problems.

Meanwhile, Lucas has been trying to fix Randy’s problems, his new code yesterday didn’t work for me, hence me saying the original code worked for me.

However Lucas’s new code today does work for me, so yes, I agree we should use that.

Hopefully it will also work for Randy, if not, I’m available for any fault finding, or producing logs or whatever is needed to get it right for everyone.


Cheers,

Al.

mvanthoor

unread,
Jul 31, 2020, 9:28:14 AM7/31/20
to PicoChess
Thanks for helping with the tests and all your other efforts regarding PicoChess Al. Same goes for anyone else who's putting in their own time to get this thing right :)

Do the files Lucas posted/updated (" However Lucas’s new code today") work on a stock DGT Pi with the Pi3B+? (AFAIK, there is no stock DGT Pi with an RPi4 in it... or is there?)

For the very first PicoChess 10 Beta 1 image, having the image work correctly on the stock DGT Pi is the one thing I'm concerned about. Then we can set two different goals:

- Leave it at that point for PicoChess 10 and try to get the modded DGT Pi working in a seperate image. After we succeed, we update the repository and the new image, as PicoChess 11.
- Keep tinkering with this in Beta, and only release PicoChess 10 Final after we know for sure that the image will also work on modded DGT Pi's outfitted with an RPi4.

What preferences does everyone have?

Lucas van der Ploeg | DGT

unread,
Jul 31, 2020, 9:41:36 AM7/31/20
to PicoChess

Hi Al,


my pi4 core (not the ARM frequency) is always running at 500 MHz. This is also the frequency mentioned online. As I expected somehow your core is running at a different frequency. Can you send me your /boot/config.txt ? Maybe I can find an explanation in there.


kind regards,

Lucas van der Ploeg | DGT

Sent: 31 July 2020 15:05:17

To: PicoChess
Subject: Re: Raspberry Pi 4 v1.2 inside my DGT Pi
--
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.

mvanthoor

unread,
Jul 31, 2020, 10:06:29 AM7/31/20
to PicoChess
Hi Lucas,

I was curious and ran this command as well, on a standalone Pi4B:

pi@picodev:~ $ vcgencmd measure_clock core
frequency(1)=200008304

So that would be 200 MHz, not 500...  I have not changed anything in /boot/config.tx.

I hope this information is somehow useful.
On Friday, 31 July 2020 at 15:41:36 UTC+2 Lucas van der Ploeg wrote:

Hi Al,


my pi4 core (not the ARM frequency) is always running at 500 MHz. This is also the frequency mentioned online. As I expected somehow your core is running at a different frequency. Can you send me your /boot/config.txt ? Maybe I can find an explanation in there.


kind regards,

Lucas van der Ploeg | DGT

RandyR

unread,
Jul 31, 2020, 10:08:57 AM7/31/20
to PicoChess
Marcel,

The stock DGTPi that I have has the Pi3B inside. I'm not sure if DGT is now using the Pi3B+. Al, replaced the 3B with a 3B+ before going to the RPi4 (if I remember correctly). Since I have the DGTPi unmodded, I can test the various versions of dgtpicom and dgtpicom.so in picochess 0.9l, 0.9n and 2.01 in either Stretch or Buster. Obviously the original versions run in 0.9l as that's what came with the DGTPi. I can test the latest from Lucas but I suspect he has access to a DGTPi. 🤣

Al, the issues I was having are not related to dgtpicom and dgtpicom.so as my Rpi4 is not wired into the DGTPi. Perhaps you meant Lucas was helping Peter. 😉

Randy

Lucas van der Ploeg | DGT

unread,
Jul 31, 2020, 10:39:35 AM7/31/20
to PicoChess

I think I found the problem, the core frequency changes between 200 and 500 MHz depending on the load. As I have X running, my pi always runs at 500 MHz. To change this behavior we should add the following to the pi4 section of /boot/config.txt

core_freq=500

core_freq_min=500

This forces the core frequency is always to 500 MHz.  This way we can use the dgtpicom version currently on github.


We could also use the version I send this morning and use 250 MHz This might be easier when making an image for all versions of the pi. Also for the pi 3 we needed to reduce the frequency to 250 MHz if I remember correctly. We would need to add core_freq=250 and core_freq_min=250 to config.txt.


kind regards,

Lucas van der Ploeg | DGT


From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of RandyR <randy...@gmail.com>
Sent: 31 July 2020 16:08:57

To: PicoChess
Subject: Re: Raspberry Pi 4 v1.2 inside my DGT Pi
--
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.

Scally

unread,
Jul 31, 2020, 10:54:10 AM7/31/20
to PicoChess
Hi Lucas,

With all my overclocking commented out I get this on your command:

Al@PicoChess:~ $ vcgencmd measure_clock core
frequency(1)=199995120


This is my normal overclocking parameters, as you can see they are currently commented out, but I never changed the GPU settings, but it’s possible one of the other settings does:

# Overclock
#arm_freq=2000
#over_voltage=6
##core_freq=750
#h264_freq=600
##isp_freq=600
#v3d_freq=700
temp_soft_limit=68 #increase lower throttling threshold


Reading other comments, yes the stock DGT Pi has a RPI 3 in it, I replaced mine with a RPi 3b+ when that was released and now have a RPi 4 inside.



Cheers,

Al.

RandyR

unread,
Jul 31, 2020, 11:03:16 AM7/31/20
to PicoChess
On Friday, July 31, 2020 at 9:39:35 AM UTC-5 Lucas van der Ploeg wrote:

Also for the pi 3 we needed to reduce the frequency to 250 MHz if I remember correctly. We would need to add core_freq=250 and core_freq_min=250 to config.txt.

Really? That's the first I've heard of this. If true it would be good to know for people updating the software in the DGTPi.

Randy 

Scally

unread,
Jul 31, 2020, 11:05:21 AM7/31/20
to PicoChess
Ah I just noticed the 2 ## in front of:

##core_freq=750
##isp_freq=600

That’s because they were already commented out with 1 # before this exercise.


So if I’m reading this correctly, we can use this mornings file but just add the 2 lines in re core_freq at 500. If so I assume this will be added to Lucas’s GItHub.


Thanks,

Al.

Scally

unread,
Jul 31, 2020, 11:10:04 AM7/31/20
to PicoChess
Hi all,

Just thinking out load, I’m sure we could knock a bash file up that would apply the correct setting to ‘boot/config.txt depending on your RPi version

dmesg | grep 'Machine model' Gives you your model etc.


Al.

mvanthoor

unread,
Jul 31, 2020, 12:22:16 PM7/31/20
to PicoChess
Hi all,

Lucas, I've run a quick test.

If I connect the Pi to a screen, "vcgencmd measure_clock core" returns 200 MHz. If I drag a window around really fast, it jumps to 250 at some point. Only after I open a website (especially YouTube with its preview animations), the clock speed jumps to 500. If I don't connect the Pi to a screen it doesn't start X, but it does start a VNC server for user pi. If I then log into that VNC server, the core clock is 200 MHz. As soon as I start dragging a window around, it jumps to 333, and if I get really wild, it jumps to 500 MHz.

My RPi already runs at 42-43 degrees C idle in its Argon ONE case (passive) due to the ambient temperature being 26 degrees C. Higher clock speeds normally equate to higher temperatures.

As older Pi's possibly can't handle a 500 MHz clock, and higher speeds causes higher temperatures, I would advocate to have the clock locked at 250 MHz in config.txt. The X GUI is not a critical part for PicoChess. I for one (and I think, most people) will only use the X GUI once: to connect the Pi to the Wifi network and/or to the Bluetooth board. People who connect it to Ethernet and use a USB board don't even need the GUI, ever.

If someone wants to set the clock to a higher speed, we can create instructions for that, and if needed, supply alternative dgtipicom and dgtpicom.so files for it.

We can also create a configure_picochess.sh script that can set many parameters and create symlinks to many pre-created configuration files after asking some questions such as "Are you using a DGT Pi?", "Did you modify it with a different Pi?" etc...

mvanthoor

unread,
Jul 31, 2020, 3:14:30 PM7/31/20
to PicoChess

So, this is it...

I've been following RandyR's steps as posted here:

There are only two differences:
- /opt/picochess is owned by "pi" instead of "root", so no sudo is necessary (and very useful for the samba share)
- I'm symlinking from /etc/systemd/system to the services in /opt/picochess/etc, instead of copying the service files.

Everything went fine up to and including the installation of the python requirements. I've used Al's updated requirements.txt as can be found here:

Now I'm stuck.

I created the symlink to dgtpi.service, but I can't get the service started.

The DGT-files are the ones from the repository: I haven't replaced anything yet. However, the command ExecStart in dgtpi.service refers to dgtpicom. Can't the versions of dgtpi.com and dgtpicom.so even start under the current version of Buster?

The pi is upgraded to the latest version. It now has kernel "Linux picodev 5.4.51-v7l+". A few days ago, it had something in the 4.x range. I can't remember exactly. I can imagine that the versions of dgtpicom and dgtpicom.so from the current PicoChess repository do not work with a 5.x series kernel.

So... what is the consensus with regard to the dgt* files I should use, to get this image running correctly on a stock, unmodified DGT Pi running the latest version of Buster? Maybe someone could share these files.

Or, shouldn't I have upgraded to a series 5 kernel because this breaks dgtpicom and dgtpicom.so? (I just did a "sudo apt update && sudo apt full-upgrade" after installation.) I can revert to the latest kernel 4.x series, but it would mean that everytime a kernel updates, there's the potential of dgtpicom and dgtpicom.so breaking, and then they'd need to be recompiled. Or the installation would need to have the kernel apt-pinned and never upgrade it.

mvanthoor

unread,
Jul 31, 2020, 3:15:58 PM7/31/20
to PicoChess
PS: copying dgtpi.service to /etc/systemd/system does not make a difference. It still fails.

RandyR

unread,
Jul 31, 2020, 3:32:33 PM7/31/20
to PicoChess
Perhaps use root instead of pi? I have only used the files from Dirk's repository and left everything as root.

Randy

RandyR

unread,
Jul 31, 2020, 3:42:06 PM7/31/20
to PicoChess
On Friday, July 31, 2020 at 2:14:30 PM UTC-5 mvanthoor wrote:

I've been following RandyR's steps as posted here:


It's too bad you can't edit posts in this group. The issues I reported in step 8 (pip3 unable to install certain packages) never reappeared when I made subsequent images. Not sure why, maybe different versions of Raspbian. Not sure. Of course I was more of a noob then. 😊

Randy 

Scally

unread,
Jul 31, 2020, 3:44:23 PM7/31/20
to PicoChess
Hi Marcel,

I’m on the same kernel as you and also don’t need sudo for most things as everything is in Al instead of pi.
I’m using the dgtpicom & dgtpicom.so that Lucas attached here this morning.

However you need sudo for Picochess, here’s a screenshot, try the same commands and tell us what you get:

Linux PicoChess 5.4.51-v7l+ #1326 SMP Fri Jul 17 10:51:18 BST 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: Fri Jul 31 20:35:21 2020 from 192.168.1.182
Al@PicoChess:~ $ sudo service picochess stop
Al@PicoChess:~ $ cd /opt/picochess
Al@PicoChess:/opt/picochess $ sudo python3 ./picochess.py -pi -w

You only need the -pi if you have a DGT Pi and only need the -w if you’re using the Webserver.

It should start ....


Cheers,

Al.

Scally

unread,
Jul 31, 2020, 3:49:08 PM7/31/20
to PicoChess
and don’t forget the ...

sudo systemctl enable picochess

if you want Picochess to start on boot.

Al.

mvanthoor

unread,
Jul 31, 2020, 3:57:41 PM7/31/20
to PicoChess
@RandyR: it should not matter that the /opt/picochess folder is owned by "pi" instead of "root". I tried both options: symlinking to the dgtpi.service, and copying it into /etc/systemd/system, and then:

sudo systemctl daemon-reload
sudo systemctl start dgtpi.service

And it failed. I assume it failed because dtpicom from the PicoChess repository is not compatible with the current version of Raspberry Pi OS.

@Al: Thanks.

I'll use the same files, and see if I can get the services to start. I'll start PicoChess as root / with sudo.

If I get everything running, and someone can test this setup on an unmodified DGT Pi, and it works, I suggest that we put those files into this version_10_beta_1 branch and later merge them into the repository before they get lost in this group somewhere. After the default, unmodded DGT Pi runs smoothly, we can then tinker with the modded DGT Pi4 and provide newer files as needed, until we have a set of files that works on every Pi for this version of Raspberry Pi OS... and then we can update the repository again.

mvanthoor

unread,
Jul 31, 2020, 6:40:59 PM7/31/20
to PicoChess

Hi,

I've downloaded the dgtpicom* files attached by Lucas this morning, and replaced the ones from the PicoChess repository. I still can't get dgtpi.service started.

Does this service start ONLY when you're using a DGTPi, and will it otherwise fail? That would explain it.

In that case, we should definitely have two seperate images; one for the DGTPi, and one without.

Also: if PicoChess has the option -pi when using it with a DGT Pi, what does the configuration option with a true/false setting for the DGTPi do?

mvanthoor

unread,
Jul 31, 2020, 7:05:50 PM7/31/20
to PicoChess
Still no success. The dgtpi.service contains this command:

/opt/picochess/etc/dgtpicom "  DGT  P|  " 1

This command runs when entered on the command-line, but it does nothing.

It's a oneshot service. Does this mean that, using dgtpicom, it only prints "DGT PI" on the clock and then exists? Documentation says that a oneshot service never starts; if you query the status, it is reported as inactive or dead.

When I start the service manually:

"sudo systemctl start dgtpi.service"

then it fails. "systemctl status dgtpi.service" says:

Aug 01 00:55:50 picodev systemd[1]: Starting DGT Pi Hello...
Aug 01 00:55:50 picodev systemd[1]: dgtpi.service: Main process exited, code=exited, status=246/n/a
Aug 01 00:55:50 picodev systemd[1]: dgtpi.service: Failed with result 'exit-code'.
Aug 01 00:55:50 picodev systemd[1]: Failed to start DGT Pi Hello.

Failed with exit-code 246... which I can't find in the documentation.

I would expect this service to run, print DGT PI on the clock, and then exit; and as it also runs directly from the command-line on a standalone pi (without any output) I'd also expect the service to run, have no output, and then normally exit without errors.

As I don't have a DGT Pi, I don't know what I should exactly expect on a standalone pi.

mvanthoor

unread,
Jul 31, 2020, 8:35:58 PM7/31/20
to PicoChess
Last message for today before I go to bed (or at least try, at 27 degrees C).

@Al: it seems dgtpi.service also fails to start on your latest switchable image. See the screenshot I attached.

Could you start this switchable image in the DGT Pi, and then verify that the image has actually started?

"sudo systemctl status dgtpi.service"

It -could- say "inactive" or "dead" because it's a oneshot service that runs and quits, but if it says "failed", even though you DO get the startup message, then I'm not understanding this.

You have a service called dgtpi.service.al, which doesn't exist as a unit. (Forgot to run "sudo systemctl daemon-reload" ?)
The only difference I can spot is the message: "Al's DGT PI" instead of " My DGT Pi ". That file seems redundant with regard to starting services.
alans_pi.png

RandyR

unread,
Aug 1, 2020, 11:05:36 AM8/1/20
to PicoChess
On Friday, July 31, 2020 at 5:40:59 PM UTC-5 mvanthoor wrote:

Does this service start ONLY when you're using a DGTPi, and will it otherwise fail? That would explain it.

In that case, we should definitely have two seperate images; one for the DGTPi, and one without.

Also: if PicoChess has the option -pi when using it with a DGT Pi, what does the configuration option with a true/false setting for the DGTPi do?


Marcel, there's a switch in the picochess.ini file which determines whether you are using a DGTPi or not. The -pi command line option does the same thing.

Also, here's step 10 again:

10. Copy the DGTPi services into the correct place (ONLY needed if you have a DGTPi chess computer):  

And, as Lucas mentioned, "The dgtpicom and dgtpicom.so files are only used to communicate from the raspberry pi directly to the DGT3000 (e.g. DGT pi). So when using the clock cable between the board and the DGT3000 these files are not used."

Randy 

mvanthoor

unread,
Aug 1, 2020, 11:58:53 AM8/1/20
to PicoChess
Marcel, there's a switch in the picochess.ini file which determines whether you are using a DGTPi or not. The -pi command line option does the same thing.

Thanks. I surmised as much. I'll have to look into which one takes precedence if they''re both defined and conflicting.
Using the option in picochess.ini seems logical.


Also, here's step 10 again:

10. Copy the DGTPi services into the correct place (ONLY needed if you have a DGTPi chess computer):  

And, as Lucas mentioned, "The dgtpicom and dgtpicom.so files are only used to communicate from the raspberry pi directly to the DGT3000 (e.g. DGT pi). So when using the clock cable between the board and the DGT3000 these files are not used."

I know; I have not linked (or copied) the DGT services at this time before I have some more definitive information.

When I had the dgtpi.service linked, it would fail on startup, but the command mentioned in the service does actually run. (Even though it doesn't return anything on screen.) As the service is called "DGT Pi Hello", and it only calls 'dgtpicom "DGT Pi" 1', I suspect that it puts "DGT Pi" on the clock for one second, and does nothing further.

The thing I'm trying to find out is why dgtpiservice *fails*, instead of starting and then be inactive.

==============================================================================

At the momoment, I have PicoChess running on my image, without the DGT Pi services enabled for now. As I'm trying to create one image for all Raspberry/DGT combinations, they'd still need to be enabled, and I still have to install the BT-fix script.

The installation is exactly as it is in the repository, with only two changes:

- Updated requirements.txt from Al.
- Updated picochess.ini.example. I've reformatted the file so it fits within an 80 characters wide console, and added quite some separation between comments, explanations and options, to improve readability.

I think I'm going to finish this first version as "PicoChess 10 Beta 1", because for people with a DGT USB board (or a BT-board connected by USB) it can already be used. Then we;ll look into the following things, bumping the Beta-version each time one of the criteria is achieved:

- DGT Pi support for an unmodded, stock DGT Pi.
- DGT Pi support for a DGT Pi modded/upgraded to a Pi 4.
- Bluetooth Fix script installation and test.
- Bumping requirement version numbers as far as they'll go without actually changing PicoChess.

After all this is done, we should have a new PicoChess 10 version, on top of a fully up-to-date Buster image. It should then run on any Pi that can run Buster, and be usable with the USB-boards, BT-boards, stock DGT Pi, modded DGT Pi4, and the Revelation II.

At that point, I can go and look into bumping requirements that need changing code in PicoChess, and after THAT is finished (which can take a long time, seeing how far PicoChess is behind current python-chess...), new developments could be done. I'll probably look into some easy enhancements beforehand, in a different branch. (One of them being to extend the time that messages are displayed, using an option; I either missed it in the INI, or it isn't there.)

We could also look into officially updating / replacing the default engines where necessary, and limit them to 8, so they can all be chosen using the board. Maybe the same for opening books. There are some in there that are quite large, while others are tiny. That could be balanced somewhat better.

mvanthoor

unread,
Aug 1, 2020, 12:54:33 PM8/1/20
to PicoChess
As Lucas said in this post, he suspects the problems of the modded DGT Pi4 to come from the changing gpu core frequency.

On Friday, 31 July 2020 at 16:39:35 UTC+2 Lucas van der Ploeg wrote:

I think I found the problem, the core frequency changes between 200 and 500 MHz depending on the load. As I have X running, my pi always runs at 500 MHz. To change this behavior we should add the following to the pi4 section of /boot/config.txt

core_freq=500

core_freq_min=500

This forces the core frequency is always to 500 MHz.  This way we can use the dgtpicom version currently on github.


We could also use the version I send this morning and use 250 MHz This might be easier when making an image for all versions of the pi. Also for the pi 3 we needed to reduce the frequency to 250 MHz if I remember correctly. We would need to add core_freq=250 and core_freq_min=250 to config.txt.


I have looked into the documentation:


The defaults for core_freq are:

Pi 0/W: 400
Pi1: 250
Pi2: 250
Pi3: 400
P3A+/Pi3B+: 400
Pi4: 500/550/360

So, if we would put core_freq and core_freq_min at 500, we would be massively overclocking the Pi1 and Pi2. We'd even be overlocking the Pi3 and Pi3A+/Pi3B+, even though Lucas mentioned that the core_freq had to be reduced. So _increasing_ the default isn't really an option IMHO.

The documentation also mentions this:

"Changing core_freq in config.txt is not supported on the Pi 4, any change from the default will almost certainly cause a failure to boot."

Maybe this was true once, but it doesn't seem to be true now, when the RPi4 is fully updated. Despite this warning in the documentation, I have set core_freq and core_freq_min to 250, and the RPi4 boots without issue. "watch vcgencmd measure_clock core" confirms that the clock is indeed 250, and it stays there, whatever I do in the GUI. Even though the GUI is slow, it's still more than usable enough to connect the Pi4 to Wifi and/or enable bluetooth. Even web browsing is possible if the websites are not too demanding.

As GPU, Xorg and VNC performance are not critical requirements for PicoChess (it could be run without any GUI at all), I would suggest to lock the core_freq to 250 MHz. As it is as low as the lowest default of all the Pi's, we won't be out of spec for any of them (assuming core_freq works on all of them), and because Lucas had success with setting this to 250 already in combination with the stock DGT Pi on Pi3, it makes sense to just use that value as the default for a new base PicoChess image.



 

RandyR

unread,
Aug 1, 2020, 2:40:20 PM8/1/20
to PicoChess
I'm hoping that Lucas will confirm that it is necessary to limit the cpu freq. If it is, maybe dgtpicom and dgtpicom.so can be rewritten to make them frequency independent. I think lowering the freq will keep the engines from running at their best. Of course, even at their worst they can beat me!

And from your previous post, yes, it prints DGT Pi on the clock.

Randy

RandyR

unread,
Aug 1, 2020, 4:41:09 PM8/1/20
to PicoChess
I checked the /boot/config.txt file in the 0.9l image that comes with the DGTPi (RPi3B) and there IS an entry gpu_freq=250. I did a test (Hash=512, Threads=2) with this option enabled, then disabled, using Al's SF11 compile on the 0.9l image and didn't see any real difference in performance:
gpu_freq=250
info depth 26 seldepth 37 multipv 1 score cp 81 nodes 40979831 nps 281950 hashfull 566 tbhits 0 time 145344 pv d2d4 d7d5 c2c4 g8f6 g1f3 e7e6 b1c3 f8e7 c1g5 e8g8 e2e3 h7h6 g5f6 e7f6 c4d5 e6d5 f1d3 c7c5 d4c5 b8c6 e1g1 d5d4 c3e4 c8e6 e4f6 d8f6 e3d4 c6d4 f1e1
#gpu_freq=250 (effectively, gpu_freq=400 on the RPi3B)
info depth 27 seldepth 42 multipv 1 score cp 61 upperbound nodes 41556493 nps 281817 hashfull 561 tbhits 0 time 147459 pv d2d4 e7e6

So, even though the documentation says core_freq (which gpu_freq modifies, among others) influences CPU performance, it doesn't seem to make much difference. I guess arm_freq is the important parameter.

Randy

mvanthoor

unread,
Aug 1, 2020, 4:45:30 PM8/1/20
to PicoChess
I don't really mind if a lower core clock costs a bit of performance. Very few people are going to use PicoChess and a Raspberry for serious analysis; most people will be using it to play against. I know I will; because of that, I've been thinking to just lock my personal PicoChess to 600 MHz, even though I'll already be running all engines on one thread only.

I have to play a serious game to defeat my old tabletop chess computer. It has a 10 or 12 MHz CPU, 32 kB (yeah, -> kB <-) hash table if I remember correctly, and runs a program from the late 80's. At tournament level (2 hours/40 moves), the rating is about 1800. I'm quite sure Stockfish at level 20 will kick my sorry @$$ without even seriously waking up the CPU, when running at one thread, 600 MHz, and 512 MB hash.

The Pi docs say this:

===
Frequency of the GPU processor core in MHz, influences CPU performance because it drives the L2 cache and memory bus; the L2 cache benefits only Pi Zero/Pi Zero W/ Pi 1, there is a small benefit for SDRAM on Pi 2/Pi 3. See section below for use on the Pi 4.
===

So yes, when limiting the core frequency, the Pi 0/0W and Pi1 have their cache speed throttled, and the Pi 2 and 3 get their RAM-speed throttled. The Pi4, according tot he documentation, doesn't even boot when setting core_freq/core_freq_min. It does boot however, and according to "vcgencmd measure_clock core", the clock speed has been changed.

If a slightly lower performance is the price to easily create an image that runs _everywhere_ without problems, including the stock and modded DGT Pi clocks, I'll take it. It's easy enough to provide instructions for people how to remove those settings if they're not using a DGT Pi.

I'll be changing my own image from the base one... different engines and opening books, and I'll install a script to control the power button on my case. I'll also unlink the DGT Pi services because I'm not using a DGT Pi myself.

If the dgtpi.service indeed only prints "DGT Pi" on the clock for a second and it works, I'm not going to worry about the service failing according to systemd. If it works and the message is printed, it's good enough for me. (It's not even necessary to have this service, because PicoChess prints its own message.)

mvanthoor

unread,
Aug 1, 2020, 4:58:42 PM8/1/20
to PicoChess
Hi Randy,

Thanks for checking. If the original DGT Pi 3 comes with core_freq set at 250, it only stands to reason we do the same to avoid problems with dgtpicom and dgtpicom.so. The fact that there is no performance difference with or without setting this option, is another reason to just set it to 250, IMHO.

The only disadvantage is that the GUI is a bit sluggish, but I don't suspect that anyone will ever use the GUI again after setting up Wifi and Bluetooth.

PS: did you people know you can also FTP into the Pi through SSH? You can just put the Pi's hostname as the server, select port 22, and then use the user/pass "pi" and "picochess" to log in. You'll end up in user pi's home folder, but you can browse the entire filesystem; you can do anything to the file system that user pi can do. So, you can indeed browse from /home/pi to /opt/picochess; if user pi can create/delete files, you can do it through FTP too; if that user can't create/delete files, you can't through FTP either.

For running a production (s)FTP server this would not be the way to go, but hey; for a chess computer, I think it's neat. It just provides another extra option to get into the pi and upload/download files, even without setting up an FTP-server.

RandyR

unread,
Aug 1, 2020, 6:21:15 PM8/1/20
to PicoChess
I, for one, did not know that. Thanks for the info, Marcel. I will definitely give that a try.

Randy

mvanthoor

unread,
Aug 1, 2020, 6:56:07 PM8/1/20
to PicoChess
Of course you need to use the user/password for your raspberry. I just kept user pi and set "picochess" as a password everywhere.

Scally

unread,
Aug 2, 2020, 3:52:22 AM8/2/20
to PicoChess
Hi guys,

Yes ssh is useful, I use rsync as it keeps the history of what’s copied so the next time you use it, only the changes are copied.


Al.

Lucas van der Ploeg | DGT

unread,
Aug 3, 2020, 4:50:01 AM8/3/20
to PicoChess

Hi,


you guys had a busy weekend posting lots of messages :)


There are two services:

- dgtpi.service is started at the start of the booting process immediately after the kernel. It puts the DGT PI message on the DGT3000 display and exit immediately after that. This is to notify the user the pi is booting. The message will stay there until picochess is started. The service will fail if there is no DGT3000 connected directly to the pi.

- picochess.service will start Picochess after the pi has finished booting.


There are no kernel drivers for the I2C slave device of the pi. To use I2C slave I needed to talk to the hardware directly, for this you need acces to /dev/mem. This is why you need root privileges to run dgtpicom. The files can still be owned by another user like "pi".


There are multiple options for the core clock.

- All pi's at 250 MHz, this is the simplest solution for an image. It does however appear to mean no output at all to my 4k screen. For people who want to do anything else with there pi this can by rather unfortunate. Maybe forcing the output to 1080p would help. 

- pi 123 at 250 MHz, pi 4 at 500 MHz. The current script detects the pi version and assumes 500 MHz for pi 4 and 250 MHz for anything else. The problem is how to configuring this in an image. I put core_freq=250 in the top section of /boot/config.txt and core_freq=500 and core_freq_min=500 in the [pi4] section. This works for a pi4 but I don't know if an older pi will actually ignore the [pi4] section, this would need to be tested. The bad thing is more heat in an already small and hot case. 

- This still won't give 4k at 60 frames. The pi4 core would need to run at 550MHz for this.


I can make multiple versions of the dgtpicom for each frequency, but I would prefer one version that can work on all. I will try and find a way to do this. In any case it is important the core frequency does not change while running because this would also change the I2C frequency and communication would fail.


kind regards,


Lucas van der Ploeg | DGT


From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of Scally <scall...@gmail.com>
Sent: 02 August 2020 09:52:22
To: PicoChess
Subject: Re: Raspberry Pi 4 v1.2 inside my DGT Pi
 
Hi guys,

Yes ssh is useful, I use rsync as it keeps the history of what’s copied so the next time you use it, only the changes are copied.


Al.

--
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/5464a262-3e56-4042-9574-b6c9f3838e8eo%40googlegroups.com.

Lucas van der Ploeg | DGT

unread,
Aug 3, 2020, 7:04:13 AM8/3/20
to PicoChess

Hi guys,


new version that should work on any frequency as long as at it does not change.


https://github.com/lucasvdp/dgtpi


kind regards,

Lucas van der Ploeg | DGT


From: Lucas van der Ploeg | DGT
Sent: 03 August 2020 10:49:56

Scally

unread,
Aug 3, 2020, 7:41:31 AM8/3/20
to PicoChess
Hi Lucas,

They work for me on the RPi 4 and RPi 3b+


Thanks,

Al.

It is loading more messages.
0 new messages