Is there a terminal command to disable the mobile data connection?
-
Is there a simple command to disable mobile data in a script?
nmcli radio wwan off
nmcli connection downgsettings set com.lomiri.touch.connectivity.cellular data-enabled false
gsettings set com.lomiri.touch.connectivity.cellular data-active falsedbus-send ... com.canonical.Unity.Connectivity.SetCellularDataEnabled boolean:false
/usr/share/ofono/scripts/deactivate-context /ril_0 1 (APN-Kontext entladen)
/usr/share/ofono/scripts/set-gprs-powered /ril_0 false (GPRS-Modul abschalten)
/usr/share/ofono/scripts/set-tech-preference /ril_0 gsm (Drosselung auf 2G/GSM)Nothing disables mobile data
-
try
dbus-send --session --type=method_call --print-reply --dest=com.lomiri.connectivity1 /com/lomiri/connectivity1/Private org.freedesktop.DBus.Properties.Set string:com.lomiri.connectivity1.Private string: MobileDataEnabled variant:boolean:true -
@gpatel-fr Thank you so much for the crucial tip! With just a few tweaks, it now works on my device. I was also able to successfully determine my location this way.
The one-click “NOKIA 3210 mode” is now complete!
Battery life is 3 days, but I can always be reached by phone or text message. -
@gpatel-fr
Unfortunately, disabling location tracking doesn't work quite as well as it should. It turns off location tracking, but it also disables the toggle switch.## Turn off location services sudo -u phablet DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/32011/bus" dbus-send --session --type=method_call --print-reply --dest=com.lomiri.location.Service /com/lomiri/location/Service com.lomiri.location.Service.SetEnabled boolean:false 2>/dev/null sudo -u phablet DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/32011/bus" dbus-send --session --type=method_call --print-reply --dest=com.ubuntu.location.Service /com/ubuntu/location/Service com.ubuntu.location.Service.SetEnabled boolean:false 2>/dev/null -
try
sudo dbus-send --system --type=method_call --print-reply --dest=com.lomiri.location.Service /com/lomiri/location/Service org.freedesktop.DBus.Properties.Set string:com.lomiri.location.Service string:IsOnline variant:boolean:truedbus-monitor is your friend for this kind of problem.
sudo dbus-monitor --system >system.txtor
dbus-monitor --session >session.txt -
@gpatel-fr That´s perfect!
Thank you very much for solving this stubborn problem.Now I can put the Pixel 3a into ‘Nokia 3210 mode’ with a single click. Calls and text messages work, and the battery lasts at least three days in this mode.
#!/bin/bash # ==================================================================== # NOKIA 3210 MODUS: CPU throttling + All offline services (Pixel 3a) # ==================================================================== if [ "$EUID" -ne 0 ]; then echo "ERROR: Please run the script using: sudo $0" exit 1 fi echo "Enable Nokia 3210 mode..." # 1. Force CPU cores into power-saving mode for governor in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do if [ -f "$governor" ]; then echo "powersave" > "$governor" fi done echo "[✓] CPU throttling enabled." # 2. Turn off Wi-Fi nmcli radio wifi off echo "[✓] Wi-Fi disabled." # 3. Turn off location tracking (GPS) sudo dbus-send --system --type=method_call --print-reply --dest=com.lomiri.location.Service /com/lomiri/location/Service org.freedesktop.DBus.Properties.Set string:com.lomiri.location.Service string:IsOnline variant:boolean:false echo "[✓] Location tracking disabled." # 4. Turn off Bluetooth rfkill block bluetooth echo "[✓] Bluetooth disabled." # 5. Turn off mobile data sudo -u phablet DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/32011/bus" dbus-send --session --type=method_call --print-reply --dest=com.lomiri.connectivity1 /com/lomiri/connectivity1/Private org.freedesktop.DBus.Properties.Set string:com.lomiri.connectivity1.Private string:MobileDataEnabled variant:boolean:false echo "[✓] Mobile data disabled." # 6. Greenline-Service stop at user level XDG_RUNTIME_DIR=/run/user/32011 sudo -u phablet systemctl --user stop greenline.service 2>/dev/null echo "[✓] greenline.service stopped." echo "------------------------------------------------" echo "Success! CPU, wireless modules and GPS are in sleep mode." sleep 3
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login