Jump to content

Recommended Posts

Posted

I've got Orange Pi 2W board and installed Debian 12 Home Assistant image to it (image link). There is a huge problem with it. Very often there is no bluetooth module appeared in system. I need to reboot system for 10-15 timer to make it work. What can be a reason?

I attached 2 boot logs (with good BT appears and no BT appears), I hope it will help to find out the issue.

 

boot_log_bt_good_02.zip

boot_log_bt_bad_02.zip

Posted

Hi,

 

without owning this board, chatgpt is pointing out to an initialisation issue of the bluetooth system caused by the GPIO pin not being correctly handled at boot.

 [    6.024062] WCN: marlin chip en dummy pull up -- need manually set GPIO 

The correct solution would be to handle the init in the dtb file, but you can try the following systemd initialisation as a workaround to see if it works.

 

Create (as root) the following service file /etc/systemd/system/bt-gpio.service with the contents:

[Unit]
Description=Enable GPIO for Bluetooth chip
Before=bluetooth.service

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 225 > /sys/class/gpio/export || true; echo out > /sys/class/gpio/gpio225/direction; echo 1 > /sys/class/gpio/gpio225/value'

[Install]
WantedBy=multi-user.target

Then enable it (as root):

systemctl daemon-reexec
systemctl daemon-reload
systemctl enable bt-gpio.service

Reboot and check if the bluetooth starts correctly. Post the boot log if it does not.

 

Posted

I did not see the bt-gpio service starting on boot.

Can you post the status ?

 

On 6/9/2025 at 8:28 AM, IBV said:
systemctl status bt-gpio.service

 

Posted
user@orangepizero2w:~$ systemctl status bt-gpio.service
× bt-gpio.service - Enable GPIO for Bluetooth chip
     Loaded: loaded (/etc/systemd/system/bt-gpio.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2025-06-10 23:18:23 +03; 11h ago
    Process: 489 ExecStart=/bin/sh -c echo 225 > /sys/class/gpio/export || true; echo out > /sys/class/gpio/gpio225/direction; echo 1 > /sys/class/gpio/gpio225/value (code=exited, status=2)
   Main PID: 489 (code=exited, status=2)
        CPU: 5ms

jun 10 23:18:23 orangepizero2w systemd[1]: Starting bt-gpio.service - Enable GPIO for Bluetooth chip...
jun 10 23:18:23 orangepizero2w sh[489]: /bin/sh: 1: echo: echo: I/O error
jun 10 23:18:23 orangepizero2w sh[489]: /bin/sh: 1: cannot create /sys/class/gpio/gpio225/direction: Directory nonexistent
jun 10 23:18:23 orangepizero2w sh[489]: /bin/sh: 1: cannot create /sys/class/gpio/gpio225/value: Directory nonexistent
jun 10 23:18:23 orangepizero2w systemd[1]: bt-gpio.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
jun 10 23:18:23 orangepizero2w systemd[1]: bt-gpio.service: Failed with result 'exit-code'.
jun 10 23:18:23 orangepizero2w systemd[1]: Failed to start bt-gpio.service - Enable GPIO for Bluetooth chip.

 

Also I attached boot log which is connected to that "systemctl status bt-gpio.service" command.

 

bt_fail_boot_log_3.txt

 

 

When the board was boot correctly (BT is working fine) the output looks the same:

user@orangepizero2w:~$ systemctl status bt-gpio.service
× bt-gpio.service - Enable GPIO for Bluetooth chip
     Loaded: loaded (/etc/systemd/system/bt-gpio.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2025-06-11 11:04:21 +03; 1min 30s ago
    Process: 492 ExecStart=/bin/sh -c echo 225 > /sys/class/gpio/export || true; echo out > /sys/class/gpio/gpio225/direction; echo 1 > /sys/class/gpio/gpio225/value (code=exited, status=2)
   Main PID: 492 (code=exited, status=2)
        CPU: 5ms

jun 11 11:04:21 orangepizero2w systemd[1]: Starting bt-gpio.service - Enable GPIO for Bluetooth chip...
jun 11 11:04:21 orangepizero2w sh[492]: /bin/sh: 1: echo: echo: I/O error
jun 11 11:04:21 orangepizero2w sh[492]: /bin/sh: 1: cannot create /sys/class/gpio/gpio225/direction: Directory nonexistent
jun 11 11:04:21 orangepizero2w sh[492]: /bin/sh: 1: cannot create /sys/class/gpio/gpio225/value: Directory nonexistent
jun 11 11:04:21 orangepizero2w systemd[1]: bt-gpio.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
jun 11 11:04:21 orangepizero2w systemd[1]: bt-gpio.service: Failed with result 'exit-code'.
jun 11 11:04:21 orangepizero2w systemd[1]: Failed to start bt-gpio.service - Enable GPIO for Bluetooth chip.

 

Posted
sudo armbian-config

Are you able to see the below overlays ? If yes, activate them.

System → Hardware/Kernel → Activate UART0, UART1, BT overlays

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines