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

    [Question] How to enable cellular connection using terminal?

    Scheduled Pinned Locked Moved Support
    terminalcellularnmcliquestion
    4 Posts 3 Posters 1.3k 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.
      • B Offline
        BigB
        last edited by BigB

        Introduction

        Hi, I wrote few scripts that reconnect user to configured VPN in specific situations e.g. when wifi is off it enables it.
        I would like to do same thing with cellular data. Unfortunately I can't find out what is the command for it. I tired some nmcli commands with no success.

        Question

        Is there possibility to enable cellular data using terminal without sudo?

        My Tries

        1

        nmcli device connect ril_0
        
        Error: Filed to add/activate new connection: Message recipient disconnected from message bus without replying
        

        2

        nmcli connection up ifname ril_0
        
        Error: Connection activation filed: The device 'ril_0' has no connection available for activation
        

        3
        When you type nmcli c show the gsm is assigned to device field and it looks like something that shouldn't be shared in Internet 😉

        nmcli c up /xxxxxxxxxxxx/xxxxx
        
        Error: connection activation filed: No suitable device found for this connection.
        

        4

        nmcli monitor
        

        Then I clicked switch to enable cellular data, output:

        ril_0: disconnected
        Networkmanager is now in the 'connecting state'
        ril_0: connecting (prepare)
        ril_0: using connection '/xxxxxxxxxx/xxxxx'
        rmnet0: device removed
        Connectivity is now 'full'
        '/xxxxxxxxxxxxxx/xxxxxx' is now primary connection
        Networkmanager is now in the 'connected' state 
        ril_0: connected
        

        So how we can do all above steps manually?

        Solution

        here will be the solution
        

        First post changelog

        • 2020.08.21 - issue creation.
        C 1 Reply Last reply Reply Quote 0
        • C Offline
          Capsia @BigB
          last edited by

          @BigB Hi, afaik NetworkManager doesn't manage cellular connection in UT, you should probably try with ofono / rild.

          1 Reply Last reply Reply Quote 1
          • G Offline
            garyn4
            last edited by

            @Capsia said in [Question] How to enable cellular connection using terminal?:

            ofono / rild

            Hi, interesting too, my cell phone loses the connection to the cell network.

            1 Reply Last reply Reply Quote 0
            • B Offline
              BigB
              last edited by BigB

              @Capsia Thank You! 🙂

              I'll continue searching but now with proper tools.
              For more advanced users maybe this or this will help - Especially this part of article: "Here is an example script of modem initialization:(...)"

              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