Bluetooth connection problem (DGT)

92 views
Skip to first unread message

Connor Tierney

unread,
Jun 22, 2024, 6:59:23 AM (11 days ago) Jun 22
to PicoChess
Hi everyone,

I already mentioned this in another thread but I thought it would be best to start a new one to make it easier for others to search (I've done a lot of searching and reading over the last few days!).

Anyway, I'm having issues connecting to my DGT bluetooth board with Randy's latest image (v3.3). My hardware is a Pi 5 4GB with a 64GB SD card and HDMI monitor connected.
Picochess seems to run fine and I get the web screen showing no board connected but it will not detect the board. I can see the board if I search bluetooth devices from my phone but the Pi does not show up if I do this. I can switch to no-board and play a game on the web interface no problem. I tried flashing various images (desktop version with and without wine) and eventually had some success when I flashed the desktop version, connected to LAN, configured wifi connection via raspi-config over SSH and rebooted. The board was detected after 10-15 minutes waiting, but then it would not detect any moves! My DGT board is quite old (at least 10 years) so I thought this might be a firmware issue (even though the board worked OK with Picochess v2 lite on a Pi 2) so I followed the steps to update board firmware. Still no connection.
I have tried connecting with the onboard bluetooth on the Pi 5 as well as using the dongle that worked on my Pi2.
I was working on this for hours last night and I'm no further on. Does anyone have any suggestions?

Connor

RandyR

unread,
Jun 22, 2024, 11:11:12 AM (11 days ago) Jun 22
to PicoChess
Hi Connor,

You could try resetting Bluetooth on the board. Leave the Pi OFF and with the board also off, hold the power button for 10 sec and release. Then, with the board ON, start the Pi.

If that doesn't help, you can use bluetoothctl to scan and pair manually. Once paired, open up another terminal window and try connecting to the paired board using rfcomm: 'sudo rfcomm connect 111 <MAC address of your board>'.

Before using bluetoothctl, stop PicoChess so it won't interfere ('sudo service picochess stop').

Also, you can use btmon to monitor Bluetooth communication, in a separate terminal window.

Randy

Dirk

unread,
Jun 22, 2024, 11:39:43 AM (11 days ago) Jun 22
to pico...@googlegroups.com
Connecting/pairing the (at least mine) Revelation II is also only possible in most cases manually the first time when using a new image.

After manually pairing (via bluetoothctl as Randy recommended) it connects every time if I switch my revelation II on before switching on my pi4.

Dirk

Am 22.06.2024 um 17:11 schrieb RandyR <randy...@gmail.com>:

Hi Connor,
--
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/814f35ab-b00e-471e-baf0-de3dfc8fb4dcn%40googlegroups.com.

Dirk

unread,
Jun 22, 2024, 11:41:56 AM (11 days ago) Jun 22
to PicoChess

guess the revelation II only supports a very older bluetooth version…

Randy Reade

unread,
Jun 22, 2024, 12:16:57 PM (11 days ago) Jun 22
to pico...@googlegroups.com
Perhaps if I had a Rev II I could do some troubleshooting. 😁

Connor Tierney

unread,
Jun 23, 2024, 7:31:09 AM (10 days ago) Jun 23
to PicoChess
My board is not a Rev II, its just a bluetooth DGT e-board however I think the same issues/solutions may apply due to it using an old bluetooth version.
We seem to have made a bit of progress this morning using the manual connection steps, but I hit a wall when needing to enter the PIN.

'bluetoothctl scan on' finds the DGT board and shows the MAC address
'bluetoothctl connect <MAC address>' gives the following output:
[CHG] Device <MAC address> Connected: Yes
[CHG] Device <MAC address> UUIDs xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
[CHG] Device <MAC address> ServicesResolved: Yes
Failed to connect : org.bluez.Error.NotAvailable br-connection-profile-unavailable

That looked like it got most of the way there so I tried the 'sudo rfcomm connect 111 <MAC address>' This is where I got a clue what the problem might be. When I enter the above command i get the following popup on screen.
DGT_PIN.png
But I cant enter any text in the text box!
When I type the required PIN (0000 as shown in the DGT user manual) and press enter, I get the following output in the terminal window: 'Cant connect RFCOMM socket: connection timed out'

So it looks like the issue is with an older bluetooth version and the requirement for a PIN. I have googled and read the manpages for bluetoothctl and rfcomm to see if I can enter the PIN in the connection command from the terminal but have had no luck so far.
Any further help is greatly appreciated!

Connor

Connor Tierney

unread,
Jun 23, 2024, 9:20:04 AM (10 days ago) Jun 23
to PicoChess
With a bit more digging, things got a bit more confusing.
It turns out that while I am unable to type anything into the popup, I can actually paste the PIN into the text box. Then I get this output in the terminal;
after_PIN.png

Not much to do here, so I rebooted. Picochess still doesn't see the board but when I exit the web interface and click on the bluetooth icon in the taskbar, my board does show up as being connected. Restarted the picochess service and open the web  interface - still no board.
I get the feeling it's almost there, but I'm lost... completely lost!

Randy Reade

unread,
Jun 23, 2024, 1:45:12 PM (10 days ago) Jun 23
to pico...@googlegroups.com
Connor,

You should run bluetoothctl interactively:

Turn the board OFF. Then, in a terminal or via ssh (easier):

sudo service picochess stop
sudo pkill -f chromium
sudo systemctl disable picochess.service
sudo systemctl disable obooksrv.service
sudo systemctl disable gamesdb.service
sudo rm -rf /var/lib/bluetooth
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Add a '#' in front of the last line so it looks like:

#/home/pi/kiosk.sh

Save with Ctrl-o, Enter, Ctrl-x

sudo reboot

bluetoothctl
power on
agent on
default-agent
scan on

Turn the board ON

Once you see your board detected (it will have DGT_BT in the name) stop scanning:

scan off
pair <MAC address of board>

It should say 'Attempting to pair with ...'. Then it should say 'Device <MAC address> Connected: yes'. Wait a bit and it should either ask you to 'Confirm passkey xxxxx (yes/no):' where you would type 'yes' (new DGT BT boards) or it will ask for a PIN code (older DGT boards). Type in '0000' in this case. Wait a bit and it should disconnect ('Device <MAC address> Connected: no'). 

Confirm the board is still paired:

devices Paired      <---- capital P

It should show your board.

Then get back to the shell prompt:

quit

Now try connecting using rfcomm:

sudo rfcomm connect 111 <MAC address> 

It should connect, then just enter Ctrl-c to exit.

If this works you should be able to re-enable PicoChess:

sudo systemctl enable picochess.service
sudo systemctl enable obooksrv.service
sudo systemctl enable gamesdb.service
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Remove the '#' in front of the last line so it looks like:

/home/pi/kiosk.sh

Save with Ctrl-o, Enter, Ctrl-x

Leave the board ON. Reboot and it should connect automatically.

sudo reboot

Since I don't have an old DGT board, please send me the output from bluetoothctl, particularly where it asks for a PIN. I may need to alter the python code.

As mentioned in the documentation attached with the image, for the first boot, wait until PicoChess has started before turning the board ON. Subsequent boots it is better to have the board already ON.

Randy


Reply all
Reply to author
Forward
0 new messages