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

    Bug: data mobile interface looses ip

    Scheduled Pinned Locked Moved OS
    22 Posts 5 Posters 1.2k Views 5 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.
    • pparentP Offline
      pparent
      last edited by pparent

      I've mentioned in Smooth Edges a bug that drives me mad concerning the fact that I regularly loose mobile data on my Vollaphone 22 on 24.04-1.1 ( with "free mobile"), and I have to switch to 2G then go back to LTE to have it working again.

      I have investigated and now I know more. It seems to be an IP adress problem. When the bug appears I see "L" (for LTE) in the status bar but I have:

      ccmni1: flags=193<UP,RUNNING,NOARP>  mtu 1280
              inet6 fe80::58e:ee25  prefixlen 64  scopeid 0x20<link>
              unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
              RX packets 123325  bytes 160619148 (160.6 MB)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 47763  bytes 4939925 (4.9 MB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      

      And ip route is null.

      After swtiching to 2G and then 4G I get

      ccmni0: flags=193<UP,RUNNING,NOARP>  mtu 1500
              inet 10.15.62.187  netmask 255.0.0.0
              unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
              RX packets 834  bytes 79443 (79.4 KB)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 22  bytes 5869 (5.8 KB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      
      phablet@ubuntu-phablet:~$ ip route
      default via 10.15.62.187 dev ccmni0 proto static metric 700 
      10.0.0.0/8 dev ccmni0 proto kernel scope link src 10.15.62.187 
      10.15.62.187 dev ccmni0 proto static scope link metric 700
      

      Next time I see the problem I will see if running a simple dhclient solves it (I think it will). If so I might write a simple script to detect when I loose the IP while the LTE network is connected, and trigger automatically a dhclient as a temporary fix for my own use. Even if including a fix to the system would be ideal.

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

        @pparent Sometimes (not always) I don't have internet after stopping - starting or restarting my Volla 22 even if the icon shown is L. I also occasionally lose internet even with L in the indicators. The simplest solution is to turn off the cellular data and turn it back on and the internet comes back. Bouygues for me. This since i have Noble.

        pparentP 1 Reply Last reply Reply Quote 0
        • pparentP Offline
          pparent @domubpkm
          last edited by

          @domubpkm said in Bug: data mobile interface looses ip:

          The simplest solution is to turn off the cellular data and turn it back

          Yes I know but this is a workaround not a real solution, it's not convenient at all, especially if you expect to receive notifications Internet needs to run always in background without manual action. Especially in the context of VoLTE I wonder what impact it has on incoming calls.

          D 1 Reply Last reply Reply Quote 1
          • pparentP pparent referenced this topic on
          • D Offline
            domubpkm @pparent
            last edited by domubpkm

            @pparent said in Bug: data mobile interface looses ip:

            this is a workaround not a real solution

            totally agree

            I don't know if this currently has an impact on telephone communications since I can call and receive calls with disconnected cellular data. And for 4G calls, Volte is not working for me currently.

            1 Reply Last reply Reply Quote 0
            • pparentP Offline
              pparent
              last edited by

              By the way I've just noticed something else strange in the logs:
              sometimes I have 2 interfaces called "ccmni1" and "ccmni2". But sometimes I have "ccmni0" and "ccmni2" . I'm not sure if it is related to this bug or not, as both possibilities seem to be able to work if the interface has proper IP.

              1 Reply Last reply Reply Quote 0
              • pparentP Offline
                pparent
                last edited by

                Actually I have had the bug once again, and this time the interface holding the IP "ccmni0" was down, but forcing it up did not restore the connexion, I could ping the gateway but nothing more.

                pparentP 1 Reply Last reply Reply Quote 0
                • pparentP Offline
                  pparent @pparent
                  last edited by

                  I'm wondering about something, as this problem is an IP loss problem, I think it should be noted that by defualt NetworkManager uses it's internal dhcp handler. But it is also possible to configure it to use dhclient. And I wonder if the later would not be more reliable.

                  So I think I will test to change the configuration of my NetworkManager to use dhclient, and see if it has any impact on this bug.

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

                    Any news about this annoying issue ?

                    pparentP 1 Reply Last reply Reply Quote 0
                    • pparentP Offline
                      pparent @domubpkm
                      last edited by

                      @domubpkm

                      I will soon try to write a workaround script, but when I have time.

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

                        @pparent THANKS. I still linked this post to NotKit from the Volla team. This is still a big problem for the Volla 22 which will have to be fixed. In addition, network loss is almost systematic each time the volla 22 is restarted.

                        pparentP 1 Reply Last reply Reply Quote 0
                        • pparentP Offline
                          pparent @domubpkm
                          last edited by

                          @domubpkm

                          I've written a workaround script that I'm currently testing, that detects an IP loss on the interface and automatically reinitialize the modem when it happens. For now it seems to work quite well, and even seems to have a positive impact on VoLTE connexion. I will test it for a few days, and if everything goes well, I will publish it here.

                          D G 2 Replies Last reply Reply Quote 3
                          • D Offline
                            domubpkm @pparent
                            last edited by

                            @pparent Great.
                            A good test is to see if the connection is still lost after reboot or complete shutdown and startup.

                            pparentP 1 Reply Last reply Reply Quote 0
                            • pparentP Offline
                              pparent @domubpkm
                              last edited by

                              @domubpkm said:

                              A good test is to see if the connection is still lost after reboot or complete shutdown and startup.

                              This is not really the purpose of the script for now. The purpose of the script is that, when you keep the phone up, and you travel, Internet remain accessible at any moment, without needing to manualy go in the settings to restart the connection.

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

                                @pparent ok. Thanks for the clarification. I just said that because it is a behavior i noticed very frequently.

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

                                  @pparent

                                  For the record I never commented on this problem because I had not yet seen it but I recently observed something that looked like it: I did pass in an area without cellular support and when going back to civilization, the cellular data did come back but no routing it seems, as you describe.
                                  I'd need a Faraday cage to confirm.

                                  pparentP 1 Reply Last reply Reply Quote 0
                                  • pparentP Offline
                                    pparent @gpatel-fr
                                    last edited by pparent

                                    Here is the script that I currently use, it improves greatly the usability of my phone, because it reduces dramatically the need to go in the settings to restart cellular connexion, in order to get access to the Internet.

                                    Though it's not perfect and might have side effects, use at your own risks!

                                    #!/bin/bash
                                    
                                    MODEM="/ril_0"
                                    HOST_TO_PING="8.8.8.8 www.google.com ubports.com 1.1.1.1 9.9.9.9 cloudflare.com amazon.com microsoft.com wikipedia.org apple.com"
                                    
                                    function get_modem_iface()
                                    {
                                    /usr/share/ofono/scripts/list-contexts |awk -v target="$1" '
                                    /^\[ \/ril_/ { r=$2 }
                                    
                                    /Type = internet/ { i=1 }
                                    
                                    /Interface=ccmni/ && r==target && i {
                                        sub(/^.*Interface=/, "")
                                        sub(/ .*/, "")
                                        print
                                        exit
                                    }
                                    '
                                    }
                                    
                                    IFACE=$(get_modem_iface $MODEM)
                                    
                                    i=0;
                                    
                                    while true; do
                                        if [ "$IFACE" = "" ]; then
                                            IFACE=$(get_modem_iface $MODEM)
                                        fi
                                        ifconfig $IFACE | grep -v inet6 | grep inet > /dev/null 2>&1
                                        if [ "$?" -ne "0" ]; then
                                            gdbus call --system --dest org.ofono --object-path "$MODEM" --method org.ofono.NetworkRegistration.GetProperties | grep "'Technology': <'lte'>" > /dev/null 2>&1
                                            if [ "$?" -eq "0" ]; then
                                                date
                                                echo "IFACE: $IFACE";
                                                echo "IP loss detected"
                                                /usr/share/ofono/scripts/offline-modem $MODEM
                                                /usr/share/ofono/scripts/online-modem $MODEM
                                                sleep 5;
                                                IFACE=$(get_modem_iface $MODEM)
                                            fi
                                        else
                                            route=$(ip route show default)
                                            if [ "$route" = "" ]; then 
                                                gdbus call --system --dest org.ofono --object-path "$MODEM" --method org.ofono.NetworkRegistration.GetProperties | grep "'Technology': <'lte'>" > /dev/null 2>&1
                                                if [ "$?" -eq "0" ]; then
                                                    date
                                                    echo "IFACE: $IFACE";
                                                    echo "Route loss detected"
                                                    /usr/share/ofono/scripts/offline-modem $MODEM
                                                    /usr/share/ofono/scripts/online-modem $MODEM
                                                    sleep 5;
                                                    IFACE=$(get_modem_iface $MODEM)
                                                fi
                                            fi
                                        fi
                                        
                                        i=$((i+1))
                                        if [ "$i" -gt "15" ]; then
                                            i=0;
                                            gdbus call --system --dest org.ofono --object-path "$MODEM" --method org.ofono.NetworkRegistration.GetProperties | grep "'Technology': <'lte'>" > /dev/null 2>&1
                                            if [ "$?" -eq "0" ]; then
                                                internetaccess=0;
                                                for host in $HOST_TO_PING ; do
                                                    ping -W 1 -c 1 $host >/dev/null 2>&1
                                                    if [ "$?" -eq "0" ]; then
                                                        internetaccess=1;
                                                        break;
                                                    else
                                                        echo "Ping to $host failed, trying next one in 4s ...."
                                                        sleep 4;
                                                    fi
                                                done
                                                if [ "$internetaccess" -eq "0" ]; then
                                                        date
                                                        echo "IFACE: $IFACE";
                                                        echo "Internet access loss detected"
                                                        /usr/share/ofono/scripts/offline-modem $MODEM
                                                        /usr/share/ofono/scripts/online-modem $MODEM
                                                        sleep 5;
                                                        IFACE=$(get_modem_iface $MODEM)
                                                fi
                                            fi
                                        fi
                                        sleep 20;
                                    done
                                    
                                    D 1 Reply Last reply Reply Quote 0
                                    • lduboeufL Offline
                                      lduboeuf
                                      last edited by

                                      did you reported the issue to the porter ?.
                                      i personaly have some issues on FP4 regrding network too:
                                      e.g Noticed that QNetworkConfigurationManager doesn't report isOnline properly

                                      pparentP 1 Reply Last reply Reply Quote 0
                                      • pparentP Offline
                                        pparent @lduboeuf
                                        last edited by

                                        @lduboeuf said:

                                        did you reported the issue to the porter ?.

                                        I plan to do so when I have time.

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jojumaxx
                                          last edited by

                                          I just read through this post and want to add that lately, I have that exact issue on my Volla X (24.04-1.2 stable).
                                          I'll test the script and report back.

                                          In my case this goes hand in hand with not being able to receive calls. I can initiate calls, but it takes around a minute until a call is established (until the ring sound).

                                          Happily running Ubuntu Touch:

                                          • BQ Aquaris E5 HD (Retired)
                                          • BQ Aquaris M10 HD (Retired)
                                          • Meizu MX4 Pro (Retired)
                                          • Meizu Pro 5 (Retired)
                                          • PinePhone UBPorts Edition
                                          • Volla Phone
                                          • Volla Phone X
                                          1 Reply Last reply Reply Quote 0
                                          • D Offline
                                            domubpkm @pparent
                                            last edited by

                                            @pparent Hello. Thanks for the script. Did you notice side effects (you said that, i have a Volla 22 too) ?
                                            May you please suggest a complete procedure to test (as done here https://forums.ubports.com/topic/6211/howto-alternate-way-of-saving-battery-when-using-4g-lte ) ?
                                            Thanks in advance.

                                            pparentP 2 Replies Last reply Reply Quote 1

                                            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