Chapter 19 - Using Linux With Ev3 Devices; Shell Commands; Testing Serial Ports; Create A Ppp Connection - Multitech MultiConnect MTPCIE-EV3 Developer's Manual

Table of Contents

Advertisement

Chapter 19 – Using Linux with EV3 Devices

Shell Commands

Testing Serial Ports

To test the serial ports created by the driver, type in a shell:
cat /dev/ttyUSBx &
# echo –en "ATE0\r" > /dev/ttyUSBx
# echo –en "AT\r" > /dev/ttyUSBx
Note:
Sending ATE0 is required, to avoid issues in the terminal output. It prevents the sending/receiving
spurious characters to/from the modem when used with the Linux commands "echo" and "cat"

Create a PPP Connection

Most recent Linux distributions have GUI tools for creating PPP connections; the following instructions are for
creating a PPP connection through command line interface.
PPP support must be compiled into the kernel; pppd and chat programs are also required.

H5 Example

Step 1. Use a text editor to create a peer file containing the lines in the example below. (/dev/ttyACM0 may need
to be something like /dev/ttyS0 for a serial build). Save the file as /etc/ppp/peers/H5-peer.
Example peer file:
/dev/ttyACM0
connect "/usr/sbin/chat -v -f /etc/chatscripts/H5-chat"
noipdefault
usepeerdns
defaultroute
noauth
Step 2. Use a text editor to create a chat script containing the lines in the example below. In this example [APN]
should be replaced with the APN assigned by your cellular provider. Save the file as /etc/chatscripts/H5-chat.
Example chat script:
ABORT "ERROR"
ABORT "NO CARRIER"
ABORT "BUSY"
"" at+cgdcont=1,"IP","[APN]"
OK atd*99***1#
CONNECT ""
Step 3. Use the following command line to start pppd:
pppd debug call H5-peer
This command line enables logging of debug information and tells pppd to use the peer file referenced by the call
option. After 20-30 seconds, type ifconfig and check whether a ppp interface is listed. If it is not, then check syslog
®
MultiConnect
PCIe MTPCIE-EV3 Developer Guide
USING LINUX WITH EV3 DEVICES
55

Advertisement

Table of Contents
loading

Table of Contents