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

    [HowTo] Alternate way of saving battery when using 4G/LTE

    Scheduled Pinned Locked Moved Support
    89 Posts 16 Posters 28.2k Views 9 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.
      • jezekJ Offline
        jezek @domubpkm
        last edited by

        @domubpkm There is a pull request waiting for approval, which handles all the trouble when receiving MMS while cellular data is off. Feel free to test and report. šŸ˜‰

        jEzEk

        D 1 Reply Last reply Reply Quote 1
        • Mario.CHM Offline
          Mario.CH
          last edited by

          Hello c4pp4,
          thanks for your work on the topic of battery saving.
          I did the test on my Sony Xperia X (F5121). The device switches to G2 as promised. However, when the device wakes up, it does not switch back to LTE.
          Unfortunately for me, my network provider no longer supports G2, so I have no connection to the antenna, i.e. "The subscriber is currently unavailable".:beaming_face_with_smiling_eyes:
          Now I want to remove the script or the changes I made.
          Is that possible?
          And how do I do that?
          Could you support me.
          Greetings Mario

          Translated with www.DeepL.com/Translator (free version)

          šŸ“± Oneplus Nord N100 UT20.40 (OTA5); then Xperia X (since 2020) at last UT 20.04(OTA5), now out of service due to defective camera
          šŸŽ When you realize you are riding a dead horse, get off!
          My languages skill: šŸ‡ØšŸ‡­šŸ‡¦šŸ‡¹ šŸ‡©šŸ‡Ŗ, and only orally: šŸ‡¬šŸ‡§ šŸ‡¹šŸ‡­

          c4pp4C 1 Reply Last reply Reply Quote 0
          • D Offline
            domubpkm
            last edited by

            To do that, i deleted the script (lte-battery-saver) and the upstart session job (lte-battery-saver.conf) and rebooted the smartphone.

            1 Reply Last reply Reply Quote 0
            • c4pp4C Offline
              c4pp4 @Mario.CH
              last edited by

              @mario-ch Hello,
              what kind of connections are available in your case? I can help you to tweak the script for your needs.

              Anyway to take back the changes, remove both files:

              rm /home/phablet/lte-battery-saver
              rm /home/phablet/.config/upstart/lte-battery-saver.conf
              
              Mario.CHM 1 Reply Last reply Reply Quote 1
              • Mario.CHM Offline
                Mario.CH @c4pp4
                last edited by

                @c4pp4 As it seems, or rather I think 3G would work.

                šŸ“± Oneplus Nord N100 UT20.40 (OTA5); then Xperia X (since 2020) at last UT 20.04(OTA5), now out of service due to defective camera
                šŸŽ When you realize you are riding a dead horse, get off!
                My languages skill: šŸ‡ØšŸ‡­šŸ‡¦šŸ‡¹ šŸ‡©šŸ‡Ŗ, and only orally: šŸ‡¬šŸ‡§ šŸ‡¹šŸ‡­

                c4pp4C 1 Reply Last reply Reply Quote 0
                • c4pp4C Offline
                  c4pp4 @Mario.CH
                  last edited by

                  @mario-ch You mean switch to 3G when display is off and switch back to 4G when on?

                  Mario.CHM 1 Reply Last reply Reply Quote 0
                  • Mario.CHM Offline
                    Mario.CH @c4pp4
                    last edited by

                    @c4pp4 yep, that's exactly what i mean.

                    šŸ“± Oneplus Nord N100 UT20.40 (OTA5); then Xperia X (since 2020) at last UT 20.04(OTA5), now out of service due to defective camera
                    šŸŽ When you realize you are riding a dead horse, get off!
                    My languages skill: šŸ‡ØšŸ‡­šŸ‡¦šŸ‡¹ šŸ‡©šŸ‡Ŗ, and only orally: šŸ‡¬šŸ‡§ šŸ‡¹šŸ‡­

                    c4pp4C 2 Replies Last reply Reply Quote 0
                    • c4pp4C Offline
                      c4pp4 @Mario.CH
                      last edited by c4pp4

                      @mario-ch Ok give me some time, I will test it on my xperia x and let you know.

                      BTW you can try it on your own when you replace "gsm" with "umts".

                      1 Reply Last reply Reply Quote 0
                      • c4pp4C Offline
                        c4pp4 @Mario.CH
                        last edited by c4pp4

                        @mario-ch In case of Xperia X (maybe it's related to Halium 7.1) we have to set it to "lte" option instead of "any", so the script for your needs (3G<->4G) is here:

                        #!/bin/bash
                        
                        interface=org.freedesktop.DBus.Properties
                        member=PropertiesChanged
                        
                        dbus-monitor --session "type=signal,interface='${interface}',member='${member}'" |
                        while read -r line; do
                                if [[ ${line} == *"com.canonical.UnityGreeter"* ]]; then
                                        read && read && read -r line
                                        if [[ ${line} == *"IsActive"* ]]; then
                                                read -r line
                                                [[ ${line} == *"true"* ]] && /usr/share/ofono/scripts/set-tech-preference /ril_0 umts 1>/dev/null
                                                [[ ${line} == *"false"* ]] && /usr/share/ofono/scripts/set-tech-preference /ril_0 lte 1>/dev/null
                                        fi
                                fi
                        done
                        
                        Mario.CHM 1 Reply Last reply Reply Quote 2
                        • D Offline
                          domubpkm @jezek
                          last edited by

                          @jezek said in [HowTo] Alternate way of saving battery when using 4G/LTE:

                          which handles all the trouble when receiving MMS while cellular data is off

                          Hello. You done a huge work..! congratulations.

                          Does it mean that the main purpose of the work is that MMS could be received normally with cellular data OFF ?

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

                            @domubpkm said in [HowTo] Alternate way of saving battery when using 4G/LTE:

                            Does it mean that the main purpose of the work is that MMS could be received normally with cellular data OFF ?

                            No the purpose is to not loose MMS in any cases and being able to download them when data is back on.
                            You can't receive MMS without data on, no software tweak can change this.
                            See there if not already done for full story : https://forums.ubports.com/topic/5100/the-mms-lost-story

                            2015-2023 : Meizu MX4 ā˜ ļøāš°ļøāœļø
                            2023-2024 : Nexus 5 ā˜ ļøāš°ļøāœļø
                            2024-***** : FPOS Fairphone 5 waiting UT for freedom šŸ˜‰
                            šŸ‡²šŸ‡«šŸ‡¬šŸ‡§

                            1 Reply Last reply Reply Quote 3
                            • D Offline
                              domubpkm
                              last edited by domubpkm

                              It's not a story, it's a ''bible'' (which I hadn't read) like the amount of work (and surely headaches) put in by @jezek .. Yes, the aim is, rather, to have a delayed download (or to be able to delay downloading the MMS) when the cellular data is reactivated which is great. In short, the idea is to ensure that the MMS is not lost. I think it's more exact.

                              ....and this would be good as it would allow the cellular data to be turned off to save battery power and turned back on when needed to download the MMS. šŸ™‚

                              1 Reply Last reply Reply Quote 1
                              • Mario.CHM Offline
                                Mario.CH @c4pp4
                                last edited by

                                @c4pp4
                                Hello c4pp4,
                                so, my device has been running with this customization for almost a week now.
                                Still, I can't say yet if it causes any improvement in battery life.
                                But for sure I can confirm that it does not contribute to any degradation.
                                Thank you again.

                                Translated with www.DeepL.com/Translator (free version)

                                šŸ“± Oneplus Nord N100 UT20.40 (OTA5); then Xperia X (since 2020) at last UT 20.04(OTA5), now out of service due to defective camera
                                šŸŽ When you realize you are riding a dead horse, get off!
                                My languages skill: šŸ‡ØšŸ‡­šŸ‡¦šŸ‡¹ šŸ‡©šŸ‡Ŗ, and only orally: šŸ‡¬šŸ‡§ šŸ‡¹šŸ‡­

                                c4pp4C 1 Reply Last reply Reply Quote 1
                                • c4pp4C Offline
                                  c4pp4 @Mario.CH
                                  last edited by

                                  @mario-ch Maybe there is no such difference between G3 and G4 consumption.

                                  KenedaK TotalRandoT 2 Replies Last reply Reply Quote 0
                                  • KenedaK Offline
                                    Keneda @c4pp4
                                    last edited by

                                    @c4pp4
                                    I don't use the script but i can tell you that there is a big difference on my phone in battery consumption between 3G and 4G.

                                    2015-2023 : Meizu MX4 ā˜ ļøāš°ļøāœļø
                                    2023-2024 : Nexus 5 ā˜ ļøāš°ļøāœļø
                                    2024-***** : FPOS Fairphone 5 waiting UT for freedom šŸ˜‰
                                    šŸ‡²šŸ‡«šŸ‡¬šŸ‡§

                                    1 Reply Last reply Reply Quote 1
                                    • TotalRandoT Offline
                                      TotalRando @c4pp4
                                      last edited by TotalRando

                                      @c4pp4 Ok, so just to confirm (because I have already messed up Anbox and will probably have to reinstall anyway just for that), this script defaults to 3G/4G? So it won't go back to 2G? Because that's what I want. It annoys me to have to switch back to 3G/4G every time I turn my phone back on (2G is virtually unusable where I live but if the phone sleeps too long, it's back on 2G.) I only need the last script from before the "note for the further investigation" part? Just copy into a Seabass, save script and run in terminal?

                                      NOTE: I don't care about battery consumption-- my phone is plugged in a lot-- but I do like my calls crystal clear when I dial without having to be like "ugh, it's on 2G again". Also, I can't get MMS on 2G but on 3G/4G, works fine.


                                      Nerd with UT on a OnePlus One. OnePlus 6T waiting in the wings for VoLTE.

                                      c4pp4C 1 Reply Last reply Reply Quote 0
                                      • c4pp4C Offline
                                        c4pp4 @TotalRando
                                        last edited by

                                        @totalrando use the walkthrough from the first post, just change variables to:

                                        primary_preference="lte"
                                        saving_preference="umts"
                                        
                                        1 Reply Last reply Reply Quote 2
                                        • D Offline
                                          davedanger
                                          last edited by

                                          Script works good running in the terminal but doesn't seem to work when put in upstart

                                          c4pp4C 1 Reply Last reply Reply Quote 0
                                          • c4pp4C Offline
                                            c4pp4 @davedanger
                                            last edited by

                                            @davedanger What version of UT? There is a regression when using 2G now.

                                            D 1 Reply Last reply Reply Quote 0
                                            • D Offline
                                              davedanger @c4pp4
                                              last edited by

                                              @c4pp4 I'm using OS Ubuntu 16.04 (2021-09-02/2) on a Pixel 3a

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