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.
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.
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
To unsubscribe from this group and stop receiving emails from it, send an email to pico...@googlegroups.com.
-> 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 .....
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.
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
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
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
To unsubscribe from this group and stop receiving emails from it, send an email to pico...@googlegroups.com.
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.
+-----+-----+---------+------+---+---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--+---+------+---------+-----+-----+
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/4f7a60d6-30a8-40f4-9e17-52cceec1045ao%40googlegroups.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/4f7a60d6-30a8-40f4-9e17-52cceec1045ao%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to <a hr
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.
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
To unsubscribe from this group and stop receiving emails from it, send an email to pico...@googlegroups.com.
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
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
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
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/814d76f5-5228-4fa9-9188-719f2db4cabdn%40googlegroups.com.
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
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
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.
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
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.
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
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
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
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've been following RandyR's steps as posted here:
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."
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.
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
Hi guys,
new version that should work on any frequency as long as at it does not change.
kind regards,
Lucas van der Ploeg | DGT
They work for me on the RPi 4 and RPi 3b+
Thanks,
Al.