Bluetooth issue on v3

467 views
Skip to first unread message

Marc Desmedt

unread,
Sep 30, 2021, 6:10:45 PM9/30/21
to PicoChess
Upon installing v3 on my DGT Pi it connected on first reboot then did not work during any subsequent startups. I believe this to be a known issue.

I fixed it initially by adding the following line to /etc/rc.local and it worked flawlessly.
/bin/bluetoothctl connect (my e-board mac address)

However, I did not setup and enable wifi.
Once I did that, Bluetooth started failing again with a perpetual no e-board message.

Not that once started when I SSH into the DGT Pi and do "/bin/bluetoothctl connect (my e-board mac address)" it does connect and I can play without issues.

In the startup/boot logs I found this:

-------------
Sep 30 16:49:21 picochess bluetoothd[557]: mymacaddress: error updating services: Input/output error (5)
Sep 30 16:49:21 picochess systemd[1]: rc-local.service: Control process exited, code=exited, status=1/FAILURE
Sep 30 16:49:21 picochess systemd[1]: rc-local.service: Failed with result 'exit-code'.
Sep 30 16:49:21 picochess systemd[1]: Failed to start /etc/rc.local Compatibility.
Sep 30 16:49:21 picochess systemd[1]: Starting Hold until boot process finishes up...
Sep 30 16:49:21 picochess systemd[1]: plymouth-quit-wait.service: Succeeded.
Sep 30 16:49:21 picochess systemd[1]: Started Hold until boot process finishes up.
Sep 30 16:49:21 picochess systemd[1]: Started Getty on tty1.
Sep 30 16:49:21 picochess systemd[1]: Reached target Login Prompts.
Sep 30 16:49:22 picochess bthelper[546]: [CHG] Device mymacaddress Connected: no
-------------

In some ways it seems something is causing rc.local to throw a compatibility error.

Doing a "sudo systemctl status rc-local" throws the error each time.
Doing a "/bin/bluetoothctl connect (my e-board mac address)" connect it perfectly to the board and all works fine, however it does throw an error which I think makes the rc.local stop:

Failed to connect: org.bluez.Error.NotAvailable

I have no idea what this error mean, and why rc.local is stopped by throwing an error.
Is there a way to suppress error messages? Because if I can basically automate "/bin/bluetoothctl connect (my e-board mac address)" in a different way I'm good to go.

I tried:

  • Bunch of bluetoothctl things like trust and pair and whatnot
  • re-flashed the entire sd card from lite to desktop v3 on to a new sd card
  • wifi work fine, gets an IP address and I can SSH into it
  • bluetooth works too once I manually connect via command line, so it's an automation thing of a previous working workaround up until I enabled wifi on my DGT Pi

Any help/suggestions is appreciated.




RandyR

unread,
Sep 30, 2021, 6:37:32 PM9/30/21
to PicoChess
For some reason I can't respond to (only) your posts using GMail on my phone, which is unfortunate because you can't reply to Google Groups posts on Android (at least I can't).

Anyway, how did you 'setup and enable wifi'?

Randy

Marc Desmedt

unread,
Sep 30, 2021, 6:43:46 PM9/30/21
to PicoChess
By creating a wpa_supplicant.conf  file after SD re-flash and throwing it in the boot partition before inserting it in the DGT Pi.

RandyR

unread,
Sep 30, 2021, 6:44:57 PM9/30/21
to PicoChess
Does 'rfkill list' show anything blocked?

Marc Desmedt

unread,
Sep 30, 2021, 6:47:02 PM9/30/21
to PicoChess
I does not seem like it

0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

RandyR

unread,
Sep 30, 2021, 6:55:45 PM9/30/21
to PicoChess
Hmmm,

I know BT and wifi both use the same chip. I wonder if it's busy connecting wifi when the rc.local command is being run. Maybe try adding a delay to the command (using sleep xx - use Google to get the syntax).

Marc Desmedt

unread,
Sep 30, 2021, 7:14:57 PM9/30/21
to PicoChess
That did the trick! It's funny, because I experimented before with a sleep 6 setting and though it was a missed shot.
But this time I tried a sleep 20 and it works. Tried 4 reboots and it connects within 5 to 10 second after showing the e-board message.

Thanks!

RandyR

unread,
Sep 30, 2021, 7:43:23 PM9/30/21
to PicoChess
That's great, Marc. Shouldn't have to do that but until Raspberry Pi Org gets BT sorted that will have to do.

Cheers.

Marc Hamilton

unread,
Dec 29, 2021, 10:38:02 PM12/29/21
to PicoChess
Which file did you add the "sleep 20" command? 

RandyR

unread,
Dec 30, 2021, 10:32:34 AM12/30/21
to PicoChess
He was referring to the /etc/rc.local file. Probably something like this:

sleep 20
/bin/bluetoothctl connect <your BT Device address>
exit 0

Randy

Mark HL

unread,
Dec 30, 2021, 10:45:42 AM12/30/21
to pico...@googlegroups.com
Thanks, Randy... I have a BT Rosewood board ordered to replace the Smartboard. 

Sent from my Samsung Tab S7

From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of RandyR <randy...@gmail.com>
Sent: Thursday, December 30, 2021 7:32:34 AM
To: PicoChess <pico...@googlegroups.com>
Subject: Re: Bluetooth issue on v3
 
--
You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/pffCqH6LDB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/8a280a44-9c6c-4888-937a-b7eca2079507n%40googlegroups.com.

osklep

unread,
Dec 30, 2021, 11:18:02 AM12/30/21
to PicoChess
picochess.zip file from Marcel is the best way to solve all the BT issues:

You don't need to edit rc.local with it
No issues with BT and Wifi working together.

Mark HL

unread,
Dec 30, 2021, 12:08:28 PM12/30/21
to pico...@googlegroups.com
Thanks, I'll make a backup and edit my picochess with these...

Sent from my Samsung Tab S7

From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of osklep <lepie...@gmail.com>
Sent: Thursday, December 30, 2021 8:18:02 AM

RandyR

unread,
Dec 30, 2021, 4:00:13 PM12/30/21
to PicoChess

m371...@gmail.com

unread,
Dec 31, 2021, 6:50:09 PM12/31/21
to pico...@googlegroups.com

Randy,

 

Do you recommend I make the changes as described in the discussion to   

  1. /lib/system/system/bluetooth.service
  2. /lib/system/syste/bthelper@.service

 

Or….

 

Use the files contained in the zip file?

 

Currently, I’ve made the changes to the first two files per the discussion.

 

Mark

 

 

Sent from Mail for Windows

 

From: RandyR
Sent: Thursday, December 30, 2021 1:00 PM
To: PicoChess
Subject: Re: Bluetooth issue on v3

 

Some interesting info here on BT issues:

--

You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/pffCqH6LDB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.

Randy Reade

unread,
Dec 31, 2021, 6:56:24 PM12/31/21
to pico...@googlegroups.com
I can't really say. It's something I would try if I had a BT board. If you have extra SD cards, it may be worth looking into. At least you would be using the latest OS files and updating with apt wouldn't break it (well, no guarantee there 😉). In the end I guess you will use what works for you.

Randy

You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/DF0DE84C-F6E8-48D3-847A-F5845604E816%40hxcore.ol.

Mark HL

unread,
Jan 3, 2022, 4:44:51 PM1/3/22
to pico...@googlegroups.com
I received the Bluetooth board this morning. No issues connecting to Bluetooth with the Pi after making the suggested edits to the startup files (i.e., I didn't use the file replacements in the zip file). 

Thanks for the link to the discussion where these edits were discussed. 

Mark

Sent from my Samsung Tab S7

From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of Randy Reade <randy...@gmail.com>
Sent: Friday, December 31, 2021 3:56:11 PM
To: pico...@googlegroups.com <pico...@googlegroups.com>

Mark HL

unread,
Jan 3, 2022, 4:46:25 PM1/3/22
to pico...@googlegroups.com
I should add, the Pi is running version 3 of Picochess and the board has firmware version 3.1 

Sent from my Samsung Tab S7

From: Mark HL <m371...@gmail.com>
Sent: Monday, January 3, 2022 1:44:44 PM

RandyR

unread,
Jan 3, 2022, 5:02:18 PM1/3/22
to PicoChess
That's great news, Mark!

One issue that was mentioned was whether the Pi would reconnect to the board if the board was powered OFF and later powered back ON while leaving the Pi running. I'm wondering about how this was accomplished (maybe Marcel can provide some insight)? If you shut OFF the board, what happens with the picochess web display (or DGTPi display)? Will picochess resume once/if the board is detected? If not, does stopping/starting the picochess service do it? I'm not sure I'd be leaving my Pi turned ON once I'm finished playing chess but others might.

Randy

m371...@gmail.com

unread,
Jan 4, 2022, 2:01:39 PM1/4/22
to pico...@googlegroups.com

Randy,

 

I could not get the BT to connect to the Pi in a repeatable manner. So I replaced the version 3 Bluetooth files with the ones offered by Marcel in Picochess.zip (Version 2
Bluetooth files)

 

Now, I get a repeatable connection at bootup (takes about 42 seconds) and no issues playing multiple games on the Pi.

 

Here’s a YouTube video link showing the retime connection speed and some notes I made on the file replacement process.

 

https://youtu.be/4JMlHRBKfq0

Sent from Mail for Windows

 

From: RandyR
Sent: Monday, January 3, 2022 2:02 PM
To: PicoChess
Subject: Re: Bluetooth issue on v3

 

That's great news, Mark!

 

One issue that was mentioned was whether the Pi would reconnect to the board if the board was powered OFF and later powered back ON while leaving the Pi running. I'm wondering about how this was accomplished (maybe Marcel can provide some insight)? If you shut OFF the board, what happens with the picochess web display (or DGTPi display)? Will picochess resume once/if the board is detected? If not, does stopping/starting the picochess service do it? I'm not sure I'd be leaving my Pi turned ON once I'm finished playing chess but others might.

 

Randy

On Monday, January 3, 2022 at 3:44:51 PM UTC-6 m371...@gmail.com wrote:

I received the Bluetooth board this morning. No issues connecting to Bluetooth with the Pi after making the suggested edits to the startup files (i.e., I didn't use the file replacements in the zip file). 

 

Thanks for the link to the discussion where these edits were discussed. 

 

Mark

 

Sent from my Samsung Tab S7

Randy Reade

unread,
Jan 4, 2022, 2:15:47 PM1/4/22
to pico...@googlegroups.com
Ok. Thanks, Mark.

Maybe future versions will work better. I'd be interested if the latest RPiOS (based on Debian Bullseye) works any better. Picochess works, but I can't test BT.

Cheers.

Randy

Randy Reade

unread,
Jan 5, 2022, 10:15:34 AM1/5/22
to pico...@googlegroups.com

Marc Hamilton

unread,
Jan 6, 2022, 2:14:06 PM1/6/22
to PicoChess
Randy, 

After replacing the files with version 2 BT files, I was getting a connect at about 42 seconds. This morning, I remembered I'd edited some BT startup files on the first attempt at fixing the issue. I went back to the  default 
settings for these files. Now the Pi will connect to the BT board repeatedly in 20 seconds or less.  I can certainly live with that... many thanks to Marcel for for providing the files and directory structure for this fix. 

Marc Hamilton

unread,
Jan 6, 2022, 3:54:28 PM1/6/22
to PicoChess
Here's a YouTube video where I used a stopwatch to time the connection speed. Two-consecutive connections in under 20 seconds.  https://youtu.be/5JNKwf4kgQQ

Randy Reade

unread,
Jan 6, 2022, 4:20:06 PM1/6/22
to pico...@googlegroups.com
Marc,

If you power OFF the BT board and leave the Pi running, will it reconnect at a later time? I guess you could either leave PicoChess running or stop it and restart it via ssh. Or just use bluetoothctl info to monitor if it reconnects.

Randy

m371...@gmail.com

unread,
Jan 6, 2022, 4:58:18 PM1/6/22
to pico...@googlegroups.com

Yes, it will… I shut off the BT, verified the Pi would not recognize a move and turned the BT on the board back on and it connected in about 5 seconds.

 

Sent from Mail for Windows

 

From: Randy Reade
Sent: Thursday, January 6, 2022 1:20 PM
To: pico...@googlegroups.com
Subject: Re: Bluetooth issue on v3

 

Marc,

Randy Reade

unread,
Jan 6, 2022, 5:02:36 PM1/6/22
to pico...@googlegroups.com
Can't ask for more than that. 🙂

Thanks for testing, Marc.

Marc Hamilton

unread,
Jan 8, 2022, 9:14:03 AM1/8/22
to PicoChess
I'm not anticipating the Debian Bullseye version of Raspberry will fix this issue. Connecting by Bluetooth from the Raspberry OS to the PC was never a issue. It was connecting it to the Bluetooth DGT board that was the issue, so the issue may be with the board's 3.1 firmware.
Unfortunately, changing out the version 2 Picochess Bluetooth files with the version 3 "fixes" my issue, but it's a hack of the OS and can't be distributed in that format.

However, I saved all the V3 Bluetooth files by renaming them to V3_Filename, so I'm going to go back and replace each version 2 file one at a time and see if I can determine if a single file change fixes the connection issue with the board. At least then we've better isolated the issue and made the fix (hack) a simpler process. 

BTW - I have three Pi's; a 3b in my DGT Pi, and a stand-alone 3 and 4b model. Both the stand-alone models are running the Debian Bullseye version, but I have no idea how to install the Picochess app to test this. 

m371...@gmail.com

unread,
Jan 8, 2022, 9:22:15 AM1/8/22
to pico...@googlegroups.com

Randy,

If you provide me with a link to the Bullseye image that contains Picochess, I’ll test the BT.

 

Sent from Mail for Windows

 

Randy Reade

unread,
Jan 8, 2022, 9:49:11 AM1/8/22
to pico...@googlegroups.com
Marc, you should be able to test without PicoChess installed. Just see if BT reconnects after pairing and trusting.

Randy

Alan Cooper

unread,
Jan 8, 2022, 10:20:37 AM1/8/22
to pico...@googlegroups.com
Hi all,

I’m replying from a hospital bed (back in with a kidney infection. & other complications)

I had briefly tried bullseye twice on my “Scally Pi” (a modified DGT Pi with RPi4 & speakers) before my Operation in November. Both times I had BT issues.

Once I’m home & stronger I will of course be testing more, like Marc I have several DGT Pi’s with various RPi’s inside, a normal DGT Board & my Rev 2 to test BT. 

Keep up the good work everyone,

Al ….

Sent from Scally's iPhone 13 Pro


On 8 Jan 2022, at 14:49, Randy Reade <randy...@gmail.com> wrote:



RandyR

unread,
Jan 8, 2022, 10:43:38 AM1/8/22
to PicoChess
Hi Al.

Thanks for that info. As Marc mentioned, maybe we can isolate which file is no longer working. Then we can discuss it on the relevant GitHub repo (BlueZ?). It sounds like it's NOT the RPi bluetooth firmware since Marcel just replaced files.

Get well soon.

Randy

Marc Hamilton

unread,
Jan 8, 2022, 11:42:08 AM1/8/22
to PicoChess
I isolated it... I only had to change the file: bluetoothctl in one location /bin with the version 2 file bluetoothctl,  and I get a repeatable connection at boot in about 20 seconds. If I cycle the BT on and off on the board, it will reconnect to the Pi.   

Steps
1) Get Marcel's picochess.zip file that contains the V2 version of the bluetooth files
2) Powershell to pi OS
3) Set the permissions to the /bin directory: sudo chmod 777 /bin
4) Back the current bluetoothctl file to v3_bluetoothctl : mv bluetoothctl v3_bluetoothctl
5) Send the version 2 file to the /bin directory. I used  the pscp protocol:  "C:\Program Files (x86)\pscp\pscp"  -pw <yourpassword> "C:\Users\winUser\\Desktop\usr\bin\bluetoothctl" p...@192.168.1.XX:/bin
6) Change the bluetoothctl to an executable: sudo chmod +x bluetoothctl
7) Change ownership of the bluetoothctl to root: sudo chown root:root bluetoothctl
8) Reset the permissions on the /bin directory: sudo chmod 755 /bin

Marc

m371...@gmail.com

unread,
Jan 8, 2022, 12:09:36 PM1/8/22
to pico...@googlegroups.com

I should add… that I was working on a clean version of Picochess and not the previous one I modified.  So I’m fairly certain, the isolation is sound.

 

Sent from Mail for Windows

 

From: Marc Hamilton
Sent: Saturday, January 8, 2022 8:42 AM
To: PicoChess
Subject: Re: Bluetooth issue on v3

 

I isolated it... I only had to change the file: bluetoothctl in one location /bin with the version 2 file bluetoothctl,  and I get a repeatable connection at boot in about 20 seconds. If I cycle the BT on and off on the board, it will reconnect to the Pi.   

--

You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/pffCqH6LDB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.

Randy Reade

unread,
Jan 8, 2022, 2:47:09 PM1/8/22
to pico...@googlegroups.com
Nice work, Marc. I guess the next step is to continue updating bluetoothctl from the version that works to each successive release until we find the one that breaks it. Then we can query the maintainer to try to figure it out.

Randy

You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/D6294BBC-CDD6-417E-811B-EC97AAD794DE%40hxcore.ol.

Marc Hamilton

unread,
Jan 8, 2022, 5:09:22 PM1/8/22
to PicoChess
I don't think there is any issues modifying the Raspberry OS for Picochess users, since your Lite and Desktop images are only distributed to a small, select group as long as we make those people aware of it.  
Here's a video that shows the BT move response time between the board to the Pi and then to the PC.  Certainly on par with the response I was getting from the USB Type-C (Mini) with the Smartboard.  

https://youtu.be/026i5bVeO9w

Mark HL

unread,
Jan 10, 2022, 10:46:42 AM1/10/22
to pico...@googlegroups.com
Randy, 
After reconsideration, I don't think you should distribute the Raspberry OS with a version 2 of the Bluetoothctl. The best "we" can do is provide information on how to fix the issue. 

Otherwise, we could be crossing into ethical and legal boundaries. 

Sent from my Samsung Tab S7

From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of Marc Hamilton <m371...@gmail.com>
Sent: Saturday, January 8, 2022 2:09:22 PM
To: PicoChess <pico...@googlegroups.com>

Randy Reade

unread,
Jan 10, 2022, 11:02:57 AM1/10/22
to pico...@googlegroups.com
I think I have a better fix. Just doing some testing with my new BT board. :^)

Randy

Mark HL

unread,
Jan 10, 2022, 11:19:51 AM1/10/22
to pico...@googlegroups.com
Excellent... glad you got that badly, needed reason to get one :-)

Sent from my Samsung Tab S7

From: pico...@googlegroups.com <pico...@googlegroups.com> on behalf of Randy Reade <randy...@gmail.com>
Sent: Monday, January 10, 2022 8:02:45 AM
To: pico...@googlegroups.com <pico...@googlegroups.com>

Subject: Re: Bluetooth issue on v3
I think I have a better fix. Just doing some testing with my new BT board. :^)

Randy

--
You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/pffCqH6LDB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.

RandyR

unread,
Jan 10, 2022, 12:35:35 PM1/10/22
to PicoChess
Yes. I must be crazy.

I have tested on a clean Lite image with the DGTPi (RPi 3b). Afterwards I ran sudo apt update/sudo apt full-upgrade and it still works. Attached are the steps to carry out via SSH or with a monitor/keyboard attached. I have not yet tested on a standalone Pi, nor with other BT devices (e.g. speakers) attached.

I believe the issue is that the BT boards use serial bluetooth comms and rfcomm was deprecated after BlueZ 5.43 (if I have that right).

If you test it, let me know how you make out or if the instructions aren't clear.

Randy
Bluetooth Board.txt

RandyR

unread,
Jan 10, 2022, 2:01:00 PM1/10/22
to PicoChess
I have confirmed it works on the DGTPi with the Desktop image. Now, I'll test the RPi4b-8GB.

RandyR

unread,
Jan 10, 2022, 4:00:51 PM1/10/22
to PicoChess
Ok. It works on a standalone RPi as well as in RPiOS Bullseye. The connection is almost instantaneous. Hopefully Al, when he's feeling better, or someone else can test on the Rev II. I haven't altered my images so the edits must be done manually.

Randy

Marc Hamilton

unread,
Jan 11, 2022, 1:39:02 AM1/11/22
to PicoChess
I made the edits that Randy suggested (took me a few tries) but I'm getting a FAST Bluetooth connection from the board to the DGT Pi.
The BT connection is made about 14 seconds after the beep when the DGT Pi starts to boot.
Marc

Randy Reade

unread,
Jan 11, 2022, 9:02:39 AM1/11/22
to pico...@googlegroups.com
That's great, Marc. Thanks for persevering. 😁

Randy

--
You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/pffCqH6LDB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.

Marc Hamilton

unread,
Jan 11, 2022, 10:50:21 AM1/11/22
to PicoChess
Here's video showing the connection speed (14.5 seconds)
Reply all
Reply to author
Forward
Message has been deleted
0 new messages