Announcement

Collapse
No announcement yet.

HS4-PI bluetooth doesn't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HS4-PI bluetooth doesn't work

    I downloaded HS4-pi and created an image. HS4 works perfectly. I want to use a bluetooth keyboard but bluetooth was not installed.
    I ran
    Code:
     sudo apt install bluetooth pi-bluetooth bluez blueman
    and everything installed without error and rebooted. But bluetoothctl hangs with or without using sudo.
    I know it isn't a hardware issue because when I use an SD with normal raspbian bluetooth works as expected.

    Anyone have any cluses how I can get bluetooth to work on a HS4-PI image?
    James

    Running HS 3 on Win10 .

    #2
    Do this to enable bluetooth:

    sudo nano /boot/config.txt

    add this 2 lines:

    enable_uart=1

    dtoverlay=pi3-miniuart-bt

    Comment


      #3
      Originally posted by PFL View Post
      Do this to enable bluetooth:

      sudo nano /boot/config.txt

      add this 2 lines:

      enable_uart=1

      dtoverlay=pi3-miniuart-bt
      I tried that and it did not work. I did not mention that I have a raspberry pi 4 (4gb). I noticed a line that disabled the bluetooth
      Code:
      dtoverlay=pi3-disable-bt
      but removing that line did not help either.
      James

      Running HS 3 on Win10 .

      Comment


        #4
        Raspberry Pi 2/3 have two UARTs, uart1 and uart0. Raspberry Pi 4 has four additional UARTs available. Only uart0/1 is enabled over GPIO pin 14/15 by default. The additional UARTs can be enabled through the device tree overlays.

        Comment


          #5
          1. Edit cmdline.txt and remove "console=serial0,115200" - you don't want Linux to start a console on it.
          2. Edit config.txt and add "enable_uart=1".
          3. Reboot, start up a terminal emulator (minicom, etc.) and open /dev/ttyS0 at 9600 baud (or whatever baud rate the device is meant to run at).

          If for some strange reason this doesn't work, you can use the mini-UART for Bluetooth:

          4. Edit config.txt again and add "dtoverlay=miniuart-bt".
          5. Reboot, start up a terminal emulator (minicom, etc.) and open /dev/ttyAMA0 at 9600 baud (or whatever baud rate the device is meant to run at).

          Comment


            #6
            Originally posted by PFL View Post
            5. Reboot, start up a terminal emulator (minicom, etc.) and open /dev/ttyAMA0 at 9600 baud (or whatever baud rate the device is meant to run at).
            The cmdline.txt did not have the console=xxx text so there was nothing to remove. I did add the lines you suggested to my config.txt. Still no progress. Here is the status of the bluetooth deamon

            Code:
            [COLOR=#669900]pi@sedona-hs:~ $ sudo systemctl status bluetooth[/COLOR]
            * bluetooth.service - Bluetooth service
            Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
            Active: inactive (dead)
            Docs: man:bluetoothd(8)
            
            Jan 09 21:22:17 sedona-hs systemd[1]: Condition check resulted in Bluetooth service being skipped.
            James

            Running HS 3 on Win10 .

            Comment


              #7
              Bluetooth is disabled on the HS-Pi build due to it conflicting with the serial interface to the Z-Wave GPIO card. If you're not using that, you might be able to restore the original Raspberry Pi configuration by (1) removing "dtoverlay=pi3-disable-bt" from /boot /config.txt, (2) re-enabling the hciuart service:
              Code:
              sudo systemctl enable hciuart.service
              (3) reboot

              Comment


                #8
                I did install bluetooth and it's working on my Pi 4B HS4 Box
                Code:

                sudo systemctl status bluetooth

                bluetooth.service - Bluetooth service

                Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset

                Active: active (running) since Mon 2022-01-10 13:10:53 EST; 42s ago

                Docs: man:bluetoothd(8)

                Main PID: 1192 (bluetoothd)

                Status: "Running"

                Tasks: 1 (limit: 4915)

                CGroup: /system.slice/bluetooth.service

                └─1192 /usr/lib/bluetooth/bluetoothd




                Jan 10 13:10:53 HTPiHubG2v2 systemd[1]: Starting Bluetooth service...

                Jan 10 13:10:53 HTPiHubG2v2 bluetoothd[1192]: Bluetooth daemon 5.50

                Jan 10 13:10:53 HTPiHubG2v2 systemd[1]: Started Bluetooth service.

                Jan 10 13:10:53 HTPiHubG2v2 bluetoothd[1192]: Starting SDP server

                Jan 10 13:10:53 HTPiHubG2v2 bluetoothd[1192]: Bluetooth management interface 1.1

                lines 1-15/15 (END)

                Comment


                  #9
                  Edit config.txt

                  # Enable Bluetooth alternate port

                  enable_uart=1

                  #dtoverlay=pi3-miniuart-bt

                  dtoverlay=uart4

                  dtoverlay=miniuart-bt

                  sudo reboot

                  sudo hciconfig hci0 reset

                  sudo invoke-rc.d bluetooth restart

                  Comment


                    #10
                    Thanks. I will try to reflash an image and to try again. My image which contains both raspbian and HS4 that I downloaded did not have bluetooth installed. Did you install it first?

                    James

                    Running HS 3 on Win10 .

                    Comment


                      #11
                      Originally posted by jasv View Post
                      Thanks. I will try to reflash an image and to try again. My image which contains both raspbian and HS4 that I downloaded did not have bluetooth installed. Did you install it first?
                      The image from HomeSeer removed bluetooth function due to port conflicts. I reconfigured config.txt and enabled HCI service.

                      Comment


                        #12
                        Success! Thank you very much. I've been obsessed.

                        Originally posted by jasv View Post
                        Thanks. My image which contains both raspbian and HS4 that I downloaded did not have bluetooth installed.
                        I was wrong. It was already installed.


                        Although it is working now, I am getting a couple of errors. Can Ignore them?

                        Code:
                        Jan 10 11:12:13 raspbdev bluetoothd[657]: Bluetooth daemon 5.50
                        Jan 10 11:12:13 raspbdev systemd[1]: Started Bluetooth service.
                        Jan 10 11:12:13 raspbdev bluetoothd[657]: Starting SDP server
                        Jan 10 11:12:13 raspbdev bluetoothd[657]: Bluetooth management interface 1.18 initialized
                        [COLOR=#c0392b]Jan 10 11:12:13 raspbdev bluetoothd[657]: Sap driver initialization failed.
                        Jan 10 11:12:13 raspbdev bluetoothd[657]: sap-server: Operation not permitted (1)[/COLOR]
                        Jan 10 11:12:13 raspbdev bluetoothd[657]: Endpoint registered: sender=:1.31 path=/org/bluez/hci0/A2DP/SBC/Source/1
                        Jan 10 11:12:13 raspbdev bluetoothd[657]: Endpoint registered: sender=:1.31 path=/org/bluez/hci0/A2DP/SBC/Source/2
                        [COLOR=#c0392b]Jan 10 11:12:13 raspbdev bluetoothd[657]: Failed to set privacy: Rejected (0x0b)[/COLOR]
                        James

                        Running HS 3 on Win10 .

                        Comment


                          #13
                          edit bluetooth.service

                          find line and change to /usr/lib/bluetooth/bluetoothd --plugin=a2dp

                          Comment


                            #14
                            Originally posted by PFL View Post
                            Edit config.txt

                            # Enable Bluetooth alternate port

                            enable_uart=1

                            #dtoverlay=pi3-miniuart-bt

                            dtoverlay=uart4

                            dtoverlay=miniuart-bt

                            sudo reboot

                            sudo hciconfig hci0 reset

                            sudo invoke-rc.d bluetooth restart
                            Hi, I wonder if you could clarify for me.

                            Are lines 1-5 added to the end of config.txt? then saved and the remaining 3 lines as separate command lines.

                            If that is the case I get a fail on sudo hciconfig hci0 reset with a no such device, any further ideas?

                            Comment


                              #15
                              Originally posted by trevor-austin View Post

                              Hi, I wonder if you could clarify for me.

                              Are lines 1-5 added to the end of config.txt? then saved and the remaining 3 lines as separate command lines.

                              If that is the case I get a fail on sudo hciconfig hci0 reset with a no such device, any further ideas?
                              Yes, but you still need to do this:


                              sudo apt install bluetooth pi-bluetooth bluez blueman

                              Comment

                              Working...
                              X