Changes between Version 14 and Version 15 of expansion/gw16126


Ignore:
Timestamp:
01/09/2019 11:56:02 PM (6 years ago)
Author:
Ryan Erbstoesser
Comment:

add comments for modem connection

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16126

    v14 v15  
    5858''' Note, because this modem uses raw-ip, the IP from the provider will not automatically be applied to the interface. The provider will give an IP and then it must manually be applied to the wwan0 interface.'''
    5959
    60 Examples: (set APN env var appropriately)
     603 different examples of how to connect, testing done on a Newport family board : (set APN env var appropriately)
    6161 * Ubuntu using !NetworkManager:
    6262{{{#!bash
    6363root@xenial-newport:~# nmcli --version
    6464nmcli tool, version 1.2.6
    65 root@xenial-newport:~# nmcli connection down id 'Wired connection 1'
     65root@xenial-newport:~# nmcli connection down id 'Wired connection 1' #bring down ethernet to avoid confusion
    6666Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0)
    67 root@xenial-newport:~# nmcli connection add type gsm ifname cdc-wdm0 con-name mymodem apn $APN
     67root@xenial-newport:~# nmcli connection add type gsm ifname cdc-wdm0 con-name mymodem apn $APN #add the connection
    6868Connection 'mymodem' (1c6d1b7f-2c89-4e21-93ee-231073605578) successfully added.
    69 root@xenial-newport:~# nmcli connection up id mymodem
     69root@xenial-newport:~# nmcli connection up id mymodem  #bring up the modem
    7070Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
    71 root@xenial-newport:~# ifconfig wwan0
     71root@xenial-newport:~# ifconfig wwan0 #verify what the ip is
    7272wwan0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
    7373          inet addr:100.75.76.187  P-t-P:100.75.76.187  Mask:255.255.255.248
     
    7878          RX bytes:354005 (354.0 KB)  TX bytes:54090 (54.0 KB)
    7979
    80 root@xenial-newport:~# ping -c2 www.google.com
     80root@xenial-newport:~# ping -c2 www.google.com #ping for testing
    8181PING www.google.com (216.58.192.196) 56(84) bytes of data.
    828264 bytes from ord30s25-in-f196.1e100.net (216.58.192.196): icmp_seq=1 ttl=52 time=568 ms
     
    8989 * Ubuntu using !ModemManager:
    9090{{{#!bash
    91 root@xenial-newport:~# mmcli --modem 0
     91root@xenial-newport:~# mmcli --modem 0 #verify modem is detected
    9292
    9393/org/freedesktop/ModemManager1/Modem/0 (device id '5cbc1489609fb1b95308ccf41b45f14e0f57771d')
     
    137137  Bearers  |          paths: 'none'
    138138
    139 root@xenial-newport:~# mmcli --modem 0 | grep imei
     139root@xenial-newport:~# mmcli --modem 0 | grep imei #check imei
    140140  3GPP     |           imei: '357812090840163'
    141 root@xenial-newport:~# mmcli --modem 0 --enable
     141root@xenial-newport:~# mmcli --modem 0 --enable #enable the modem
    142142successfully enabled the modem
    143 root@xenial-newport:~# mmcli --modem 0 --simple-connect="apn=$APN" # Note 'CallFailed' is likely an invalid APN
     143root@xenial-newport:~# mmcli --modem 0 --simple-connect="apn=$APN" # Actually connect the modem. Note 'CallFailed' is likely an invalid APN
    144144successfully connected the modem
    145 root@xenial-newport:~# mmcli --modem 0 --bearer 0
     145root@xenial-newport:~# mmcli --modem 0 --bearer 0 #get IP address
    146146Bearer '/org/freedesktop/ModemManager1/Bearer/0'
    147147  -------------------------
     
    171171                     |    Bytes received: 'N/A'
    172172                     | Bytes transmitted: 'N/A'
    173 root@xenial-newport:~# ifdown eth0
     173root@xenial-newport:~# ifdown eth0 #take down ethernet to avoid confusion
    174174Killed old client process
    175175Internet Systems Consortium DHCP Client 4.3.3
     
    183183DHCPRELEASE on eth0 to 172.24.0.2 port 67 (xid=0x3cab7268)
    184184Restarting ntp (via systemctl): ntp.service.
    185 root@xenial-newport:~# ifconfig wwan0 100.75.76.187/29
    186 root@xenial-newport:~# route add default gw 100.75.76.188
    187 root@xenial-newport:~# echo "nameserver 198.224.182.135" > /etc/resolv.conf
    188 root@xenial-newport:~# ping www.google.com
    189 root@xenial-newport:~# ping -c2 www.google.com
     185root@xenial-newport:~# ifconfig wwan0 100.75.76.187/29 #set IP address
     186root@xenial-newport:~# route add default gw 100.75.76.188 #set route
     187root@xenial-newport:~# echo "nameserver 198.224.182.135" > /etc/resolv.conf #set nameserver
     188root@xenial-newport:~# ping -c2 www.google.com #ping google to verify connection
    190189PING www.google.com (216.58.192.196) 56(84) bytes of data.
    19119064 bytes from ord30s25-in-f196.1e100.net (216.58.192.196): icmp_seq=1 ttl=52 time=568 ms
     
    213212> PROXY=yes
    214213> EOF
    215 root@xenial-newport:~# qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=raw-ip
     214root@xenial-newport:~# qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=raw-ip #set modem for raw-ip
    216215[/dev/cdc-wdm0] Successfully set data format
    217216                        QoS flow header: no
     
    222221Downlink data aggregation max datagrams: '0'
    223222     Downlink data aggregation max size: '0'
    224 root@xenial-newport:~# qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip
     223root@xenial-newport:~# qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip #set modem for raw-ip
    225224[/dev/cdc-wdm0] expected data format set to: raw-ip
    226 root@xenial-newport:~# qmi-network /dev/cdc-wdm0 start
     225root@xenial-newport:~# qmi-network /dev/cdc-wdm0 start #start modem connection
    227226Loading profile at /etc/qmi-network.conf...
    228227    APN: NIMBLINK.GW12.VZWENTP
     
    239238Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 2194536080)
    240239Network started successfully
    241 root@xenial-newport:~# qmicli --device /dev/cdc-wdm0 --wds-get-current-settings
     240root@xenial-newport:~# qmicli --device /dev/cdc-wdm0 --wds-get-current-settings #get IP from provider
    242241[/dev/cdc-wdm0] Current settings retrieved:
    243242           IP Family: IPv4