<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[HowTo] Alternate way of saving battery when using 4G&#x2F;LTE]]></title><description><![CDATA[<p dir="auto"><strong>What it does:</strong></p>
<ol>
<li><strong>Script I</strong>: Switch to 2G when screen is locked and switch back to 4G when screen is unlocked. TELEports or Dekko notifications work well.</li>
<li><strong>Alternative script II</strong>: Switch to 2G when screen is off and switch back to 4G when screen is on (regardless of screen lock). TELEports or Dekko notifications work well.</li>
<li><strong>Alternative script III</strong>: Turn off cellular data when screen is off and turn on cellular data again when screen is on (regardless of screen lock). No TELEports or Dekko notifications when screen is off.</li>
</ol>
<p dir="auto"><strong>Precondition:</strong> Working 4G connection which drains battery when device is inactive (screen is locked or off).<br />
<strong>Originally made for Xiaomi Mi A2</strong> and tested on it but can be useful for any device.</p>
<hr />
<p dir="auto">Create a script "/home/phablet/lte-battery-saver"<br />
<strong>Script I</strong>:</p>
<pre><code>#!/bin/bash

primary_preference="lte"
saving_preference="gsm"
sim_slot="/ril_0"

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"* ]] &amp;&amp; /usr/share/ofono/scripts/set-tech-preference "${sim_slot}" "${saving_preference}" 1&gt;/dev/null
                        [[ ${line} == *"false"* ]] &amp;&amp; /usr/share/ofono/scripts/set-tech-preference "${sim_slot}" "${primary_preference}" 1&gt;/dev/null
                fi
        fi
done
</code></pre>
<p dir="auto">Make script executable</p>
<pre><code>chmod u+x /home/phablet/lte-battery-saver
</code></pre>
<p dir="auto">Create an upstart session job "/home/phablet/.config/upstart/lte-battery-saver.conf"</p>
<pre><code>description "LTE battery saver"

start on started dbus
stop on stopped dbus

exec /home/phablet/lte-battery-saver
</code></pre>
<p dir="auto">Start the job</p>
<pre><code>start lte-battery-saver
</code></pre>
<p dir="auto">or reboot the phone.</p>
<hr />
<p dir="auto"><strong>NOTES</strong> (Script I and Alternative script II):</p>
<ul>
<li>Change "/ril_0" to "<strong>/ril_1</strong>" if your data SIM is in <strong>slot 2</strong> (see <strong>sim_slot</strong> variable)</li>
<li>If switching back doesn't work, try to set <strong>primary_preference</strong> variable to "<strong>any</strong>"</li>
<li>To switch between 3G and 2G replace "lte" with "<strong>umts</strong>" (see <strong>primary_preference</strong> variable)</li>
<li>To switch between 4G and 3G replace "gsm" with "<strong>umts</strong>" (see <strong>saving_preference</strong> variable)</li>
</ul>
<p dir="auto">To apply the changes, restart the job</p>
<pre><code>restart lte-battery-saver
</code></pre>
<p dir="auto">or reboot the phone.</p>
<hr />
<p dir="auto">To remove all changes</p>
<pre><code>stop lte-battery-saver
rm /home/phablet/.config/upstart/lte-battery-saver.conf
rm /home/phablet/lte-battery-saver
</code></pre>
<hr />
<p dir="auto"><strong>Alternative script II</strong>:</p>
<pre><code>#!/bin/bash

primary_preference="lte"
saving_preference="gsm"
sim_slot="/ril_0"

interface=com.canonical.Unity.Screen
member=DisplayPowerStateChange

dbus-monitor --system "type=signal,interface='${interface}',member='${member}'" |
while read -r line; do
	if [[ ${line} == *"int32 0" ]]; then
		read
		/usr/share/ofono/scripts/set-tech-preference "${sim_slot}" "${saving_preference}" 1&gt;/dev/null
	elif [[ ${line} == *"int32 1" ]]; then
		read
		/usr/share/ofono/scripts/set-tech-preference "${sim_slot}" "${primary_preference}" 1&gt;/dev/null
	fi
done
</code></pre>
<hr />
<p dir="auto"><strong>Alternative script III</strong>:</p>
<pre><code>#!/bin/bash

interface=com.canonical.Unity.Screen
member=DisplayPowerStateChange

dbus-monitor --system "type=signal,interface='${interface}',member='${member}'" |
while read -r line; do
	if [[ ${line} == *"int32 0" ]]; then
		read
		dbus-send --type=method_call --dest=com.ubuntu.connectivity1 /com/ubuntu/connectivity1/Private org.freedesktop.DBus.Properties.Set string:com.ubuntu.connectivity1.Private string:MobileDataEnabled variant:boolean:false
	elif [[ ${line} == *"int32 1" ]]; then
		read
		dbus-send --type=method_call --dest=com.ubuntu.connectivity1 /com/ubuntu/connectivity1/Private org.freedesktop.DBus.Properties.Set string:com.ubuntu.connectivity1.Private string:MobileDataEnabled variant:boolean:true
	fi
done
</code></pre>
]]></description><link>https://forums.ubports.com/topic/6211/howto-alternate-way-of-saving-battery-when-using-4g-lte</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 02:49:19 GMT</lastBuildDate><atom:link href="https://forums.ubports.com/topic/6211.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 May 2021 01:40:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Sat, 16 Dec 2023 21:51:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> Thanks for your new project. Well personally, in normal use, I generally completely turn off cellular data and activate it when necessary. I don't know how difficult it can be to develop, but I imagine an option that automatically turns on cellular data in case of one or more open apps or web-apps using it, and automatically turns off cellular data when apps or web-apps that used cellular data are all closed...</p>
]]></description><link>https://forums.ubports.com/post/77556</link><guid isPermaLink="true">https://forums.ubports.com/post/77556</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Sat, 16 Dec 2023 21:51:53 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Sat, 16 Dec 2023 16:39:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/domubpkm" aria-label="Profile: domubpkm">@<bdi>domubpkm</bdi></a> said in <a href="/post/77552">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> . When i saw <a href="https://open-store.io/app/batterysaver.lduboeuf" rel="nofollow ugc">https://open-store.io/app/batterysaver.lduboeuf</a> , i thought first it was a GUI of this topic. Or could your app evolve towards this?</p>
</blockquote>
<p dir="auto">A bit different yes than always switching 2g/4g according tp screen state. But if i have 100 notif a day, it means 100 times the screen will turn on, i doubt it would be efficient...<br />
But could be improved for sure</p>
]]></description><link>https://forums.ubports.com/post/77553</link><guid isPermaLink="true">https://forums.ubports.com/post/77553</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Sat, 16 Dec 2023 16:39:53 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Sat, 16 Dec 2023 14:41:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> . When i saw <a href="https://open-store.io/app/batterysaver.lduboeuf" rel="nofollow ugc">https://open-store.io/app/batterysaver.lduboeuf</a> , i thought first it was a GUI of this topic. Or could your app evolve towards this?</p>
]]></description><link>https://forums.ubports.com/post/77552</link><guid isPermaLink="true">https://forums.ubports.com/post/77552</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Sat, 16 Dec 2023 14:41:14 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Wed, 27 Sep 2023 20:01:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/keneda" aria-label="Profile: Keneda">@<bdi>Keneda</bdi></a> said in <a href="/post/75775">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a></p>
<p dir="auto">Would you release it on openstore ?</p>
</blockquote>
<p dir="auto">Maybe in the future, the ideal would be to have it integrated, but much much work involved + the fact that upcoming volTE will probably conflict with.</p>
<blockquote>
<p dir="auto">Is this for Xenial or Focal, or both ?</p>
</blockquote>
<p dir="auto">Focal only, only 24h a day <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=e9f7455a4ac" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forums.ubports.com/post/75777</link><guid isPermaLink="true">https://forums.ubports.com/post/75777</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Wed, 27 Sep 2023 20:01:28 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Wed, 27 Sep 2023 19:44:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a></p>
<p dir="auto">Would you release it on openstore ?<br />
Is this for Xenial or Focal, or both ?</p>
]]></description><link>https://forums.ubports.com/post/75775</link><guid isPermaLink="true">https://forums.ubports.com/post/75775</guid><dc:creator><![CDATA[Keneda]]></dc:creator><pubDate>Wed, 27 Sep 2023 19:44:23 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 29 Sep 2023 19:26:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi all,<br />
[20.04 only]<br />
I've made an app to allow to auto toggle LTE (4G) when cellular data is requested, and back to GSM (2G) when no data.</p>
<p dir="auto">If anyone interested:<br />
<a href="https://gitlab.com/lduboeuf/battery-saver/-/artifacts" rel="nofollow ugc">https://gitlab.com/lduboeuf/battery-saver/-/artifacts</a></p>
<p dir="auto">source code:<br />
<a href="https://gitlab.com/lduboeuf/battery-saver" rel="nofollow ugc">https://gitlab.com/lduboeuf/battery-saver</a></p>
<p dir="auto">the app can be closed after clicking "start" and if you see "Running...", it will create a background service</p>
<p dir="auto">Edit: don't know if it is related but connectivity tends to have issue on upgrading to 4G. Or maybe only an indicator issue.</p>
]]></description><link>https://forums.ubports.com/post/75773</link><guid isPermaLink="true">https://forums.ubports.com/post/75773</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Fri, 29 Sep 2023 19:26:09 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Tue, 19 Sep 2023 21:57:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> I didn't knew about FastDormancy, make sense to priorise it.<br />
Thank you for your answers and patience</p>
]]></description><link>https://forums.ubports.com/post/75598</link><guid isPermaLink="true">https://forums.ubports.com/post/75598</guid><dc:creator><![CDATA[AmauryDBZ]]></dc:creator><pubDate>Tue, 19 Sep 2023 21:57:07 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Tue, 19 Sep 2023 15:04:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amaurydbz" aria-label="Profile: AmauryDBZ">@<bdi>AmauryDBZ</bdi></a> said in <a href="/post/75587">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lkroll" aria-label="Profile: lkroll">@<bdi>lkroll</bdi></a> Thanks a lot for your script, works like a charm !<br />
As I said to <a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> , I was wondering if it could be possible to add some exceptions ?<br />
For instance, 4G could be maintained when the device is charging, or when hotspot activated, or even when an specific app is running (Futify for me).</p>
</blockquote>
<p dir="auto">Of course it should be possible but takes time. But would be better to look at the root cause, why LTE need so much battery. There are room for improvement, e.g we still don't manage the FastDormancy.</p>
]]></description><link>https://forums.ubports.com/post/75588</link><guid isPermaLink="true">https://forums.ubports.com/post/75588</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Tue, 19 Sep 2023 15:04:37 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Tue, 19 Sep 2023 14:47:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lkroll" aria-label="Profile: lkroll">@<bdi>lkroll</bdi></a> Thanks a lot for your script, works like a charm !<br />
As I said to <a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> , I was wondering if it could be possible to add some exceptions ?<br />
For instance, 4G could be maintained when the device is charging, or when hotspot activated, or even when an specific app is running (Futify for me).</p>
]]></description><link>https://forums.ubports.com/post/75587</link><guid isPermaLink="true">https://forums.ubports.com/post/75587</guid><dc:creator><![CDATA[AmauryDBZ]]></dc:creator><pubDate>Tue, 19 Sep 2023 14:47:24 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Sun, 17 Sep 2023 12:19:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> sorry I didn't understand that the behavior of your hack was different from <a class="plugin-mentions-user plugin-mentions-a" href="/user/lkroll" aria-label="Profile: lkroll">@<bdi>lkroll</bdi></a>'s.</p>
]]></description><link>https://forums.ubports.com/post/75550</link><guid isPermaLink="true">https://forums.ubports.com/post/75550</guid><dc:creator><![CDATA[AmauryDBZ]]></dc:creator><pubDate>Sun, 17 Sep 2023 12:19:44 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 10:34:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amaurydbz" aria-label="Profile: AmauryDBZ">@<bdi>AmauryDBZ</bdi></a> said in <a href="/post/75506">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> I would have say if enable <em>stay</em> on 4G even if the screen shutsdown, but that's the idea.</p>
</blockquote>
<p dir="auto">ah ok but might not be related to my work around. It only toggles on 4G when request data and toggle 2G when data off.</p>
]]></description><link>https://forums.ubports.com/post/75507</link><guid isPermaLink="true">https://forums.ubports.com/post/75507</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Fri, 15 Sep 2023 10:34:11 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 09:43:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> I would have say if enable <em>stay</em> on 4G even if the screen shutsdown, but that's the idea.</p>
]]></description><link>https://forums.ubports.com/post/75506</link><guid isPermaLink="true">https://forums.ubports.com/post/75506</guid><dc:creator><![CDATA[AmauryDBZ]]></dc:creator><pubDate>Fri, 15 Sep 2023 09:43:46 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 09:35:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amaurydbz" aria-label="Profile: AmauryDBZ">@<bdi>AmauryDBZ</bdi></a> said in <a href="/post/75502">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> you're right I have no idea of what consequence it could have ! Thanks for your help !</p>
<p dir="auto">To come back on the subject of this topic, would it be possible to add an exception when the hotspot is activated ?</p>
</blockquote>
<p dir="auto">Humm, what would be the bahavior for hotspot, if enable then auto switch to 4G ?</p>
]]></description><link>https://forums.ubports.com/post/75504</link><guid isPermaLink="true">https://forums.ubports.com/post/75504</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Fri, 15 Sep 2023 09:35:09 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 09:21:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> you're right I have no idea of what consequence it could have ! Thanks for your help !</p>
<p dir="auto">To come back on the subject of this topic, would it be possible to add an exception when the hotspot is activated ?</p>
]]></description><link>https://forums.ubports.com/post/75502</link><guid isPermaLink="true">https://forums.ubports.com/post/75502</guid><dc:creator><![CDATA[AmauryDBZ]]></dc:creator><pubDate>Fri, 15 Sep 2023 09:21:58 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 08:02:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amaurydbz" aria-label="Profile: AmauryDBZ">@<bdi>AmauryDBZ</bdi></a> said in <a href="/post/75498">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> said in <a href="/post/75497">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto">by mouting rw the partition and then upgrade.</p>
</blockquote>
<p dir="auto">do you have a tutorial ?</p>
</blockquote>
<p dir="auto">Well, if you ask, maybe you don't know the possible consequences ?<br />
If ok then remount rw the partition: <code>sudo mount -o remount,rw /</code><br />
then <code>sudo apt upgrade</code></p>
]]></description><link>https://forums.ubports.com/post/75499</link><guid isPermaLink="true">https://forums.ubports.com/post/75499</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Fri, 15 Sep 2023 08:02:36 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 07:27:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> said in <a href="/post/75497">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto">by mouting rw the partition and then upgrade.</p>
</blockquote>
<p dir="auto">do you have a tutorial ?</p>
]]></description><link>https://forums.ubports.com/post/75498</link><guid isPermaLink="true">https://forums.ubports.com/post/75498</guid><dc:creator><![CDATA[AmauryDBZ]]></dc:creator><pubDate>Fri, 15 Sep 2023 07:27:07 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 07:16:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amaurydbz" aria-label="Profile: AmauryDBZ">@<bdi>AmauryDBZ</bdi></a> said in <a href="/post/75496">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> thanks for your 'dirty hack' !<br />
after installing it says I have to upgrade, but <code>sudo apt upgrade</code> returns</p>
<pre><code class="language-hablet@ubuntu-phablet:~$">Lecture des listes de paquets... Fait            
Construction de l'arbre des dépendances          
Lecture des informations d'état... Fait          
Calcul de la mise à jour... Fait                 
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:                             
  libswresample3 libmediainfo0v5 libavcodec58 libavutil56 libopenexr24                            
  libsdl2-2.0-0                                  
Learn more about Ubuntu Pro at https://ubuntu.com/pro                                             
W: Verrou non utilisé pour le fichier /var/lib/dpkg/lock-frontend en lecture seule                
W: Verrou non utilisé pour le fichier /var/lib/dpkg/lock en lecture seule                         
E: Le répertoire d'archive /var/cache/apt/archives/partial n'existe pas. - Acquire (30: Read-only file system)
</code></pre>
<p dir="auto">Any idea how to resolve ?<br />
Moreover, is it possible to add an exception when hotspot is on ?</p>
</blockquote>
<p dir="auto">Well, your device must be up to date before doing any <code>ubports-qa</code> things.<br />
You can either reinstall UT or go by mouting rw the partition and then upgrade.</p>
]]></description><link>https://forums.ubports.com/post/75497</link><guid isPermaLink="true">https://forums.ubports.com/post/75497</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Fri, 15 Sep 2023 07:16:11 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Fri, 15 Sep 2023 06:42:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> thanks for your 'dirty hack' !<br />
after installing it says I have to upgrade, but <code>sudo apt upgrade</code> returns</p>
<pre><code class="language-hablet@ubuntu-phablet:~$">Lecture des listes de paquets... Fait            
Construction de l'arbre des dépendances          
Lecture des informations d'état... Fait          
Calcul de la mise à jour... Fait                 
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:                             
  libswresample3 libmediainfo0v5 libavcodec58 libavutil56 libopenexr24                            
  libsdl2-2.0-0                                  
Learn more about Ubuntu Pro at https://ubuntu.com/pro                                             
W: Verrou non utilisé pour le fichier /var/lib/dpkg/lock-frontend en lecture seule                
W: Verrou non utilisé pour le fichier /var/lib/dpkg/lock en lecture seule                         
E: Le répertoire d'archive /var/cache/apt/archives/partial n'existe pas. - Acquire (30: Read-only file system)
</code></pre>
<p dir="auto">Any idea how to resolve ?<br />
Moreover, is it possible to add an exception when hotspot is on ?</p>
]]></description><link>https://forums.ubports.com/post/75496</link><guid isPermaLink="true">https://forums.ubports.com/post/75496</guid><dc:creator><![CDATA[AmauryDBZ]]></dc:creator><pubDate>Fri, 15 Sep 2023 06:42:32 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Tue, 05 Sep 2023 19:57:49 GMT]]></title><description><![CDATA[<p dir="auto">[ Focal only ]<br />
If anyone want my dirty hack ( when cellular data off -&gt; then use 2G , when data on -&gt; switch to LTE)</p>
<p dir="auto">You must have a focal device on devel channel, then <code>sudo ubports-qa install focal_-_PR_lomiri-system-settings-cellular_6</code></p>
<p dir="auto">This will auto toggle LTE when cellular data requested , and back to 2G when off,<br />
<a href="https://gitlab.com/ubports/development/core/lomiri-system-settings-cellular/-/merge_requests/6" rel="nofollow ugc">https://gitlab.com/ubports/development/core/lomiri-system-settings-cellular/-/merge_requests/6</a></p>
<p dir="auto">( only work when toggled from the settings, not the indicator )</p>
]]></description><link>https://forums.ubports.com/post/75291</link><guid isPermaLink="true">https://forums.ubports.com/post/75291</guid><dc:creator><![CDATA[lduboeuf]]></dc:creator><pubDate>Tue, 05 Sep 2023 19:57:49 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Tue, 30 May 2023 19:16:03 GMT]]></title><description><![CDATA[<p dir="auto">Battery drain on standby with 4G is still a problem on focal, so I updated the script and created a small systemd service to automatically run the script at startup. Maybe this will be useful for some.</p>
<hr />
<p dir="auto">The greeter in focal is called "<strong>com.lomiri.LomiriGreeter</strong>" instead of "com.canonical.UnityGreeter". So i changed that in the script and tested that it indeed still works.</p>
<p dir="auto">I placed the updated script in:<br />
<code>/home/phablet/.local/bin</code></p>
<pre><code>#!/bin/bash

primary_preference="lte"
saving_preference="gsm"
sim_slot="/ril_0"

interface=org.freedesktop.DBus.Properties
member=PropertiesChanged

dbus-monitor --session "type=signal,interface='${interface}',member='${member}'" |
while read -r line; do
        if [[ ${line} == *"com.lomiri.LomiriGreeter"* ]]; then
                read; read; read -r line
                if [[ ${line} == *"IsActive"* ]]; then
                        read -r line
                        [[ ${line} == *"true"* ]] &amp;&amp; /usr/share/ofono/scripts/set-tech-preference "${sim_slot}" "${saving_preference}" 1&gt;/dev/null
                        [[ ${line} == *"false"* ]] &amp;&amp; /usr/share/ofono/scripts/set-tech-preference "${sim_slot}" "${primary_preference}" 1&gt;/dev/null
                fi
        fi
done
</code></pre>
<p dir="auto">Don't forget to make it executable:</p>
<pre><code>chmod u+x /home/phablet/.local/bin/lte-battery-saver.sh
</code></pre>
<p dir="auto">Ubuntu 20.04 uses systemd instead of upstart so I created a systemd user service in:<br />
<code>/home/phablet/.config/systemd/user/lte-battery-saver.service</code></p>
<pre><code>[Unit]
Description=LTE battery saver
Requires=dbus.socket
After=dbus.socket

[Service]
ExecStart=/home/phablet/.local/bin/lte-battery-saver.sh

[Install]
WantedBy=dbus.socket
</code></pre>
<p dir="auto">Now to enable the service:</p>
<pre><code>systemctl --user enable --now lte-battery-saver
</code></pre>
<p dir="auto">Verify that it is running and up:</p>
<pre><code>systemctl --user status lte-battery-saver
</code></pre>
<p dir="auto">It should return active and enabled:</p>
<pre><code>● lte-battery-saver.service - LTE battery saver
     Loaded: loaded (/home/phablet/.config/systemd/user/lte-battery-saver.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-04-29 18:44:27 CEST; 1h 11min ago
</code></pre>
<p dir="auto">That's it, now everytime the phone is locked the connection will drop to 2G and back to 4G/LTE once unlocked.<br />
I tested and verified it on my Oneplus 5T, but it should work on other devices running focal.</p>
]]></description><link>https://forums.ubports.com/post/72767</link><guid isPermaLink="true">https://forums.ubports.com/post/72767</guid><dc:creator><![CDATA[lkroll]]></dc:creator><pubDate>Tue, 30 May 2023 19:16:03 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Wed, 04 May 2022 06:37:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/prog-amateur" aria-label="Profile: prog-amateur">@<bdi>prog-amateur</bdi></a> said in <a href="/post/64041">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto">I have used the "lte" modification in the script without success. Then I have reboot my phone and the script was working perfectly.</p>
</blockquote>
<p dir="auto">Thank you for the report, you have to use "<strong>restart lte-battery-saver</strong>" to apply script changes. I will add a note about it. It looks like "<strong>lte</strong>" is more generic then "<strong>any</strong>" so I'll change the script.</p>
]]></description><link>https://forums.ubports.com/post/64042</link><guid isPermaLink="true">https://forums.ubports.com/post/64042</guid><dc:creator><![CDATA[c4pp4]]></dc:creator><pubDate>Wed, 04 May 2022 06:37:36 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Wed, 04 May 2022 02:07:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/c4pp4" aria-label="Profile: c4pp4">@<bdi>c4pp4</bdi></a> thank you VE-RY much for your script. Please, could you edit your 1st post just to inform about the following ?</p>
<p dir="auto">-&gt; <code>Final step : Reboot the phone</code></p>
<p dir="auto">Reason : I have done the script II and I could not come back to 4G (2G was OK), so I have used the "lte" modification in the script without success. Then I have reboot my phone and the script was working perfectly.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yoni" aria-label="Profile: yoni">@<bdi>yoni</bdi></a> said in <a href="/post/58236">[HowTo] Alternate way of saving battery when using 4G/LTE</a>:</p>
<blockquote>
<p dir="auto">Here are the battery tests, starting with 4G with data on:<br />
<img src="/assets/uploads/files/1638292840610-badtest.jpg" alt="badtest.JPG" class=" img-fluid img-markdown" /><br />
2G with data on:<br />
<img src="/assets/uploads/files/1638292871604-2gbatest.jpg" alt="2gbatest.JPG" class=" img-fluid img-markdown" /></p>
</blockquote>
<p dir="auto">When I see you plots without / with script, it is a day and night ! My Nexus 5 has a battery drain (or the battery is not enough powerful), I just installed the script so I lack of time to feedback but I hope results like yours, it would be wonderful.</p>
<p dir="auto">Again, thank you very much for your kind help, such a topic shall be pinned I think.</p>
]]></description><link>https://forums.ubports.com/post/64041</link><guid isPermaLink="true">https://forums.ubports.com/post/64041</guid><dc:creator><![CDATA[prog-amateur]]></dc:creator><pubDate>Wed, 04 May 2022 02:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Mon, 25 Apr 2022 17:41:43 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/c4pp4" aria-label="Profile: c4pp4">@<bdi>c4pp4</bdi></a>,</p>
<p dir="auto">Thank you for the scripts. <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/2665.png?v=e9f7455a4ac" class="not-responsive emoji emoji-android emoji--hearts" style="height:23px;width:auto;vertical-align:middle" title=":hearts:" alt="♥" /><br />
I found out that if the device doesn't have 4G you have to put "umts" in "primary_preference". (My device is e4.5 - Krillin - )</p>
<p dir="auto">primary_preference="umts"</p>
<p dir="auto">I've taken the liberty of sharing your scripts on my blog to reach more people, I hope you don't mind.</p>
<p dir="auto"><a href="https://elcondonrotodegnu.wordpress.com/2022/04/25/scripts-para-ahorrar-bateria-en-ubuntu-touch/" rel="nofollow ugc">https://elcondonrotodegnu.wordpress.com/2022/04/25/scripts-para-ahorrar-bateria-en-ubuntu-touch/</a></p>
<p dir="auto">Thanks again. <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=e9f7455a4ac" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forums.ubports.com/post/63943</link><guid isPermaLink="true">https://forums.ubports.com/post/63943</guid><dc:creator><![CDATA[Bolly]]></dc:creator><pubDate>Mon, 25 Apr 2022 17:41:43 GMT</pubDate></item><item><title><![CDATA[Reply to [HowTo] Alternate way of saving battery when using 4G&#x2F;LTE on Wed, 22 Dec 2021 15:03:18 GMT]]></title><description><![CDATA[<p dir="auto">Redownload mms mecanism works fine on Volla RC 43 : for this feature, thanks to <a class="plugin-mentions-user plugin-mentions-a" href="/user/jezek" aria-label="Profile: jezek">@<bdi>jezek</bdi></a> and <a class="plugin-mentions-user plugin-mentions-a" href="/user/lduboeuf" aria-label="Profile: lduboeuf">@<bdi>lduboeuf</bdi></a> as it is a very usefull nechanism to save battery too !</p>
]]></description><link>https://forums.ubports.com/post/59102</link><guid isPermaLink="true">https://forums.ubports.com/post/59102</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Wed, 22 Dec 2021 15:03:18 GMT</pubDate></item></channel></rss>