Changes between Version 40 and Version 41 of expansion/gw16126


Ignore:
Timestamp:
02/05/2020 12:16:10 AM (5 years ago)
Author:
Cale Collins
Comment:

added section for pppd

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16126

    v40 v41  
    206206 * [#openwrt OpenWrt]
    207207 * [#libqmi libqmi]
     208
     209===== PPPD
     210This is the recommended method for establishing a connection when using the SARA R410 and Ubuntu.
     211
     212To configure a connection to the Hologram network execute the following commands:
     213
     214* Install pppd
     215{{{#!bash
     216apt-get install ppp
     217}}}
     218* Disable ModemManager
     219{{{#!bash
     220systemctl stop ModemManager
     221systemctl disable ModemManager
     222}}}
     223* Create the following files
     224{{{#!bash
     225cat <<EOF >> /etc/chatscripts/sara
     226# Chat script for Hologram Nova using Hologram SIM card
     227# See hologram.io for more information
     228
     229ABORT 'BUSY'
     230ABORT 'NO CARRIER'
     231ABORT 'VOICE'
     232ABORT 'NO DIALTONE'
     233ABORT 'NO DIAL TONE'
     234ABORT 'NO ANSWER'
     235ABORT 'DELAYED'
     236TIMEOUT 12
     237REPORT CONNECT
     238
     239"" AT
     240OK ATH
     241OK ATZ
     242OK ATQ0
     243OK AT+CGDCONT=1,"IP","hologram"
     244OK ATDT*99***1#
     245CONNECT ''
     246EOF
     247}}}
     248{{{#!bash
     249cat <<EOF >> /etc/ppp/peers/sara
     250# PPP configuration for Hologram Nova modem using Hologram SIM card
     251# For more information see hologram.io
     252
     253connect "/usr/sbin/chat -v -f /etc/chatscripts/sara "
     254
     255# Serial device to which the modem is connected.
     256/dev/ttyUSB2
     257
     258# Speed of the serial line.
     2599600
     260
     261# Assumes that your IP address is allocated dynamically by the ISP.
     262noipdefault
     263# Try to get the name server addresses from the ISP.
     264usepeerdns
     265# Use this connection as the default route.
     266defaultroute
     267
     268# Makes pppd "dial again" when the connection is lost.
     269persist
     270
     271# Do not ask the remote to authenticate.
     272noauth
     273EOF
     274}}}
     275{{{#!bash
     276cat <<EOF >> /etc/network/interfaces
     277# interfaces(5) file used by ifup(8) and ifdown(8)
     278# Include files from /etc/network/interfaces.d:
     279source-directory /etc/network/interfaces.d
     280#allow-hotplug eth0
     281#auto eth0
     282iface eth0 inet dhcp
     283
     284auto ppp0
     285iface ppp0 inet ppp
     286provider sara
     287EOF
     288}}}
     289{{{#!bash
     290cat <<EOF >> /etc/network/if-pre-up.d/sara
     291#!/bin/sh
     292
     293if [ "$IFACE" = ppp0 ]; then
     294        DEVICE=/dev/$(for i in $(ls -d /sys/bus/usb/drivers/option/*/ttyUSB*); do basename $i; done | tail -n1)
     295        sed -i 's;/dev/ttyUSB[[:digit:]]*;'"$DEVICE"';' /etc/ppp/peers/sara
     296        echo "ppp0 up"
     297        echo "AT+COPS=2" > $DEVICE
     298        echo "AT+UMNOPROF=0" > $DEVICE
     299        echo "AT+UMNOPROF=3" > $DEVICE
     300        echo "AT+CFUN=15" > $DEVICE
     301        sleep 10
     302fi
     303EOF
     304}}}
     305
     306Execute the command "sync", then reboot.  If there are no typos or discrepancies the interface "ppp0" should be available with a dhcp assigned address. 
     307
     308To troubleshoot check that the command below returns the correct device:
     309
     310{{{#!bash
     311echo /dev/$(for i in $(ls -d /sys/bus/usb/drivers/option/*/ttyUSB*); do basename $i; done | tail -n1)
     312}}}
     313
     314Note: name resolution will need to be configured.
    208315
    209316[=#nmcli]