Get access to the new Intel® IoT Developer Kit, a complete hardware and software solution that allows developers to create exciting new solutions with the Intel® Galileo and Intel® Edison boards. Visit the Intel® Developer Zone for IoT.
This article tries to explain how to establish a data network (using ppp) by connecting a GPRS shield to the Intel® Edison board. An active T-Mobile SIM is being used in the shield.
Enable PPP in Kernel
Enable PPP in the Kernel and install ppp related packages.
Download the source files from http://downloadmirror.intel.com/24698/eng/edison-src-ww05-15.tgz
Before compiling the source files, it is recommended to increase root file system size.
Reference: https://communities.intel.com/docs/DOC-23449
Depending on the system configuration build takes 2-6 hours to finish.
** Ubuntu 12.04 has been used
Error while compilation:
Install libtool using sudo apt-get install libtool.
-
ERROR: Task 535 (/home/inteldell/edison-src/device-software/meta-edison-distro/recipes-connectivity/libwebsockets/libwebsockets_1.23.bb, do_compile) failed with exit code '1'
-
NOTE: Tasks Summary: Attempted 1855 tasks of which 18 didn't need to be rerun and 1 failed.
Fix: Replace the line 22 in the recipe file at
edison-src/device-software/meta-edison-distro/recipes-connectivity/libwebsockets/libwebsockets_1.23.bb
Original: export OPENSSL_CONF=${TMPDIR}/sysroots/x86_64-linux/usr/lib/ssl/openssl.cnf
Replace: export OPENSSL_CONF=${TMPDIR}/sysroots/i686-linux/usr/lib/ssl/openssl.cnf
Configuring PPP in the Kernel.
# bitbake virtual/kernel –c menuconfig

(First I enabled only PPP support for async serial ports, resulted in another error – enable PPP filtering. So ended up enabling all.)
Now install PPP packages from http://repo.opkg.net/edison/repo/core2-32/
Using pppd, create data connection using GPRS shield.
After the successful installation you should see the following file structure.

In order to communicate with modem, the hardware serial port on GPIOs 0 and 1 has to be enabled.
Enable Serial Port
Enable the serial port on pins 0 and 1 by executing the following commands on terminal.
echo 214 > /sys/class/gpio/export 2>&1
echo high > /sys/class/gpio/gpio214/direction
echo low > /sys/class/gpio/gpio214/direction
echo 131 > /sys/class/gpio/export 2>&1
echo mode1 > /sys/kernel/debug/gpio_debug/gpio131/current_pinmux
echo 249 > /sys/class/gpio/export 2>&1
echo high > /sys/class/gpio/gpio249/direction
echo 1 > /sys/class/gpio/gpio249/value
echo 217 > /sys/class/gpio/export 2>&1
echo high > /sys/class/gpio/gpio217/direction
echo 1 > /sys/class/gpio/gpio217/value
echo out > /sys/class/gpio/gpio131/direction
echo 0 > /sys/class/gpio/gpio131/value
echo 130 > /sys/class/gpio/export 2>&1
echo mode1 > /sys/kernel/debug/gpio_debug/gpio130/current_pinmux
echo 248 > /sys/class/gpio/export 2>&1
echo low > /sys/class/gpio/gpio248/direction
echo 0 > /sys/class/gpio/gpio248/value
echo 216 > /sys/class/gpio/export 2>&1
echo in > /sys/class/gpio/gpio216/direction
echo in > /sys/class/gpio/gpio130/direction
echo high > /sys/class/gpio/gpio214/direction
Test the GPRS Shield
Test the status of the GPRS modem by send AT commands using the microcom.
# microcom /dev/ttyMFD1 –s 115200
AT
OK
AT+CMGF=1 Set SMS text format
OK
AT+CMGS="+1503*****79" Send SMS message
> Hello World
+CMGS: 14
OK
The same can be implemented using standard serial port programming or by using mraa library.
Enable GPRS
AT+CGATT=1 attach to GPRS network (normally includes in atd*99#)
AT+CGATT? should return +CGATT: 1
AT+CGDCONT=1,"IP","epc.tmobile.com" context definition (for T-Mobile)
AT+CGACT=1 PDP context activation
AT+CGDATA="PPP",1 enter data mode
Connect to internet using GPRS
Create a script that defines PDP (Packet Data Protocol) context and says connected. Please find the attached zip file for scripts.
Now establish the connection using command
# pppd call gprs &

You can check the log file using
#cat /var/log/ppp/log
Press CTRL-C to close the connection at any stage!
defining PDP context...
AT
OK
ATH
OK
ATE1
OK
AT+CGDCONT=1,"IP","epc.tmobile.com","",0,0
OK
waiting for connect...
ATD*99#
CONNECT
Connected.
Serial connection established.
Using interface ppp0
Connect: ppp0 <--> /dev/ttyMFD1
not replacing default route to wlan0 [192.168.1.1]
local IP address 100.198.64.64
remote IP address 192.200.1.21
primary DNS address 10.177.0.34
secondary DNS address 10.168.185.116
References
https://communities.intel.com/docs/DOC-23449
http://repo.opkg.net/edison/repo/core2-32/
https://communities.intel.com/thread/54236
https://communities.intel.com/thread/55790
http://downloadmirror.intel.com/24698/eng/edison-src-ww05-15.tgz
http://www.att.com/esupport/article.jsp?sid=36059&cv=820#fbid=AcRge45P9Za
http://wiki.openmoko.org/wiki/T-Mobile_pppd_scripts
http://www.tldp.org/HOWTO/PPP-HOWTO/
Intel® Developer Zone for IoT
Start inventing today with the Intel® IoT Developer Program which offers knowledge, tools, kits and a community of experts to quickly and easily turn your innovative ideas into IoT Solutions.
Dream it, Build it with the Intel® IoT Developer Kit for Intel® Edison and Intel® Galileo platforms. These kits are versatile, performance-optimized and fully integrated end-to-end IoT solutions supporting a variety of programming environments, tools, security, cloud connectivity and hardware.
For more resources and to learn how the new Intel® IoT Developer Kit v1.0 can help streamline your IoT projects: