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