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

    [HowTo] Change the name of your device for Bluetooth pairing

    Scheduled Pinned Locked Moved Support
    flo hacks
    10 Posts 6 Posters 3.2k Views 1 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.
      • flohackF Offline
        flohack
        last edited by UniSuperBox

        Motivation
        If you are using Bluetooth you might have noticed that there is something odd about the device name. It is set statically to "XY Ubuntu Edition" or "FP2" or whatever. On the Oneplus, its currently even wrong, indicating "FP2".

        So if you for example share a family car, and there are more UT users. how can they distinguish their phones in the carkit? And so on...

        We are aware of this problem and will try to fix it in upcoming releases. Meanwhile you can apply the following fix. So, lets once more hack the system...

        How
        This time its really simple. You need to type those commands on your PC in a shell window, not on the phone itself:

        1. Open an adb shell into your phone: adb shell
        2. Gain root privileges by typing sudo -i and entering your unlock PIN or password
        3. Remount the root file system writable: mount -o remount,rw /
        4. edit the config file that is responsible: nano /etc/machine-info
        5. Change the PRETTY_HOSTNAME field to whatever you like. I recommend though to not use special characters. Spaces are OK!
        6. Reboot the phone

        Note: After rebooting the phone is set to readonly again, so in case you want to change the name later you need to follow the whole procedure again.

        This should be all that is necessary to give you a rocking unique Bluetooth name!

        My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

        advocatuxA KenedaK 2 Replies Last reply Reply Quote 3
        • advocatuxA Offline
          advocatux @flohack
          last edited by

          @flohack good guide as always.

          I have two suggestions (if you don't mind the insolence :-D) :

          • Advanced users will want to use vi but for newbies is better nano
          • It is not clear that after rebooting the phone, the system will be read-only again
          flohackF 1 Reply Last reply Reply Quote 0
          • flohackF Offline
            flohack @advocatux
            last edited by

            @advocatux Ok done πŸ˜‰

            My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

            1 Reply Last reply Reply Quote 0
            • mihaelM Offline
              mihael
              last edited by

              I believe this changes also the name displayed when connecting to a wifi TV...

              1 Reply Last reply Reply Quote 0
              • advocatuxA Offline
                advocatux
                last edited by advocatux

                @Flohack helping a user in the Welcome & Install group today, after a fresh UT install, he said the content of /etc/machine-info was only CHASSIS=handset

                I told him to add the PRETTY_HOSTNAME line before that other line but I want to know if this is normal or not (to add it to this HowTo). Has anyone encountered the same issue?

                Edit to add that this user tells me now:

                After installation i run the normal setup (language, location, wlan, name), setup a security code, enabled the developer mode, testet adb-onnection and have try to mount (MTP) the device for ssh-key transfer. After solving the usb-problem i follow your bluetooth howto.

                So maybe one of those steps changed the machine-info file.

                1 Reply Last reply Reply Quote 0
                • N Offline
                  nutzernam
                  last edited by

                  @advocatux i tried it today on my OPO with (15.04 r3)

                  My machine-info has the PRETTY_HOSTNAME field

                  advocatuxA 1 Reply Last reply Reply Quote 0
                  • advocatuxA Offline
                    advocatux @nutzernam
                    last edited by

                    @nutzernam thank you for confirming it.

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      kugiigi
                      last edited by

                      Is rebooting necessary for this to take effect?

                      flohackF 1 Reply Last reply Reply Quote 0
                      • flohackF Offline
                        flohack @kugiigi
                        last edited by

                        @kugiigi yes I think

                        My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                        1 Reply Last reply Reply Quote 1
                        • KenedaK Offline
                          Keneda @flohack
                          last edited by Keneda

                          @flohack said in [HowTo] Change the name of your device for Bluetooth pairing:

                          We are aware of this problem and will try to fix it in upcoming releases.

                          @kugiigi said in [HowTo] Change the name of your device for Bluetooth pairing:

                          Is rebooting necessary for this to take effect?

                          @flohack said in [HowTo] Change the name of your device for Bluetooth pairing:

                          @kugiigi yes I think

                          So i guess it's not fixed yet ^^

                          One question though :

                          @flohack said in [HowTo] Change the name of your device for Bluetooth pairing:

                          You need to type those commands on your PC in a shell window, not on the phone itself:

                          Why can't it be done directly from the device using terminal?

                          2015-2023 : Meizu MX4 ☠️⚰️✝️
                          2023-2024 : Nexus 5 ☠️⚰️✝️
                          2024-***** : FPOS Fairphone 5 waiting UT for freedom πŸ˜‰
                          πŸ‡²πŸ‡«πŸ‡¬πŸ‡§

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post