• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

How to stop and restart Bluetooth service?

Scheduled Pinned Locked Moved Solved Support
bluetoothsmartwatch
17 Posts 4 Posters 1.6k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      Moem @kugiigi
      last edited by 25 Feb 2021, 13:29

      @kugiigi said in How to stop and restart Bluetooth service?:

      You can create a bash script in your home directory with the commands needed.

      See, now we are getting somewhere... 🙂
      Might there be a way to create a launcher to call up that script?

      K K 2 Replies Last reply 25 Feb 2021, 13:34 Reply Quote 0
      • K Online
        kugiigi @Moem
        last edited by 25 Feb 2021, 13:34

        @moem I believe you can create a desktop file manually in ~/.local/share/applications

        M 1 Reply Last reply 25 Feb 2021, 13:40 Reply Quote 0
        • M Offline
          Moem @kugiigi
          last edited by 25 Feb 2021, 13:40

          @kugiigi Oooh. Good info, thank you! I will investigate.

          1 Reply Last reply Reply Quote 0
          • K Offline
            Keneda @Moem
            last edited by Keneda 25 Feb 2021, 13:59

            @moem said in How to stop and restart Bluetooth service?:

            Might there be a way to create a launcher to call up that script?

            If i remember correctly, Launcher Modular allows ro create shortcuts of that kind (command line).

            2015-2023 : Meizu MX4 ☠️⚰️✝️
            2023-2024 : Nexus 5 ☠️⚰️✝️
            2024-***** : FPOS Fairphone 5 waiting UT for freedom 😉
            🇲🇫🇬🇧

            M 1 Reply Last reply 25 Feb 2021, 14:49 Reply Quote 0
            • M Offline
              Moem @Keneda
              last edited by 25 Feb 2021, 14:49

              @keneda That would be a great solution, thank you very much! Going to look into that...

              A 1 Reply Last reply 25 Feb 2021, 18:23 Reply Quote 0
              • A Offline
                AntiDroid @Moem
                last edited by AntiDroid 25 Feb 2021, 18:23

                @moem if you follow the clickable instructions for setting up an app development enviroment the first thing you do after installing all the required dependencies and programs is you generate an app template. That template is a program with a single button in the middle that when you click it, it prints "hello world" to the command line. I would think it would be easy to change that to one of the commands above (after manually testing via the command line at least once). It would be a great way to get into making yout own programs too.

                OnePlus One with UT OTA-15 daily driver. I would be testing the Halium 7.1 port if I could roll back to OTA-15
                OnePlus 6T PostmarketOS Custom Gnome on Mainline Kernel

                M 1 Reply Last reply 25 Feb 2021, 18:29 Reply Quote 0
                • M Offline
                  Moem @AntiDroid
                  last edited by 25 Feb 2021, 18:29

                  @antidroid That's not something I'm interested in, but thanks!

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    Moem @AntiDroid
                    last edited by 25 Feb 2021, 19:07

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      Moem @AntiDroid
                      last edited by 26 Feb 2021, 08:21

                      @antidroid said in How to stop and restart Bluetooth service?:

                      @moem You could try

                      sudo service bluetooth restart
                      

                      Or maybe even this old trick to get bluetooth speakers to reconnect on Xenial. I do not know if it will work on UT.

                      rfkill block bluetooth
                      
                      rfkill unblock bluetooth
                      
                      

                      I tried both of these options. The first one was not a succes: BT stopped and never started again (which a reboot solved). The second one worked very well!

                      So in Launcher Modular, which I'm using anyway, I made a custom icon as suggested by @Keneda. This is a winning combination.
                      The command I used is

                      rfkill block bluetooth && rfkill unblock bluetooth
                      

                      and this morning, when I woke up, the Pebble was unlinked (it has an option to unlink when it does not sense any motion for half an hour, to save battery power) so I tapped the icon.
                      The notifier for BT flashed very briefly and immediately went active, and the Pebble buzzed to indicate connection.
                      In other words, this is a complete success and I'm now going to mark it solved and celebrate with a mug of my best tea. 🎉

                      Thank you, folks, for some great information!

                      K 1 Reply Last reply 26 Feb 2021, 09:37 Reply Quote 1
                      • K Offline
                        Keneda @Moem
                        last edited by 26 Feb 2021, 09:37

                        @moem
                        You're welcome. I hope Launcher Modular to grow as it's a good app, but some bugs on MX4 unfortunatly.

                        2015-2023 : Meizu MX4 ☠️⚰️✝️
                        2023-2024 : Nexus 5 ☠️⚰️✝️
                        2024-***** : FPOS Fairphone 5 waiting UT for freedom 😉
                        🇲🇫🇬🇧

                        M 1 Reply Last reply 26 Feb 2021, 10:34 Reply Quote 0
                        • M Offline
                          Moem @Keneda
                          last edited by 26 Feb 2021, 10:34

                          @keneda said in How to stop and restart Bluetooth service?:

                          some bugs on MX4 unfortunatly

                          Sorry to hear that! On OpO, it's pretty much flawless. It really helped me when switching from Android... I felt a lot more at home (sorry, devs). And I like having an analog clock on the home screen.

                          1 Reply Last reply Reply Quote 0
                          • K Keneda referenced this topic on 10 Jan 2022, 09:21
                          • K Keneda referenced this topic on 10 Jan 2022, 09:22
                          • K Keneda referenced this topic on 10 Jan 2022, 09:37
                          16 out of 17
                          • First post
                            16/17
                            Last post