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

    Is there a terminal command to disable the mobile data connection?

    Scheduled Pinned Locked Moved Unsolved Support
    5 Posts 2 Posters 71 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.
    • Linus67L Online
      Linus67
      last edited by

      Is there a simple command to disable mobile data in a script?

      nmcli radio wwan off
      nmcli connection down

      gsettings set com.lomiri.touch.connectivity.cellular data-enabled false
      gsettings set com.lomiri.touch.connectivity.cellular data-active false

      dbus-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

      Pixel 3a, works with NextCloud, pihole, Wireguard VPN, Trilium, GhostCloud, Paperless ngx...and a lot of great apps from the Open Store.

      G 1 Reply Last reply Reply Quote 0
      • G Offline
        gpatel-fr @Linus67
        last edited by

        @Linus67

        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
        
        Linus67L 2 Replies Last reply Reply Quote 0
        • Linus67L Online
          Linus67 @gpatel-fr
          last edited by

          @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.

          Pixel 3a, works with NextCloud, pihole, Wireguard VPN, Trilium, GhostCloud, Paperless ngx...and a lot of great apps from the Open Store.

          1 Reply Last reply Reply Quote 0
          • Linus67L Online
            Linus67 @gpatel-fr
            last edited by

            @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
            

            Pixel 3a, works with NextCloud, pihole, Wireguard VPN, Trilium, GhostCloud, Paperless ngx...and a lot of great apps from the Open Store.

            G 1 Reply Last reply Reply Quote 0
            • G Offline
              gpatel-fr @Linus67
              last edited by

              @Linus67

              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:true
              

              dbus-monitor is your friend for this kind of problem.

              sudo dbus-monitor --system >system.txt
              

              or

              dbus-monitor --session >session.txt
              
              1 Reply Last reply Reply Quote 0

              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
              • First post
                Last post