Before you test the GPRS connection, first disconnect any wired or wireless networking connections you might already have with your hardware and restart the device. This will help ensure there are no issues or confusion over accessing the PPP interface vs. other network interfaces. You might need to connect a monitor and keyboard to your hardware to access it when all the network connections are disconnected (however on a BeagleBone Black you can connect the USB connection to a computer and access it through its private network connection I found in my testing).
To bring up the FONA GPRS connection and setup a PPP connection, run the following command:
sudo pon fona
cat /var/log/syslog | grep pppd
Jul 8 03:47:40 raspberrypi pppd[2321]: pppd 2.4.5 started by root, uid 0 Jul 8 03:47:40 raspberrypi pppd[2321]: Serial connection established. Jul 8 03:47:40 raspberrypi pppd[2321]: Using interface ppp0 Jul 8 03:47:40 raspberrypi pppd[2321]: Connect: ppp0 <--> /dev/ttyAMA0 Jul 8 03:47:41 raspberrypi pppd[2321]: PAP authentication succeeded Jul 8 03:47:42 raspberrypi pppd[2321]: Could not determine remote IP address: defaulting to 10.64.64.64 Jul 8 03:47:42 raspberrypi pppd[2321]: local IP address 21.144.145.193 Jul 8 03:47:42 raspberrypi pppd[2321]: remote IP address 10.64.64.64 Jul 8 03:47:42 raspberrypi pppd[2321]: primary DNS address 10.177.0.34 Jul 8 03:47:42 raspberrypi pppd[2321]: secondary DNS address 10.168.185.116
One thing to look for is the flashing of the red LED on FONA--if the GPRS connection is established the red LED will flash quickly (about twice a second).
If you see an error in the PPPD log then there was likely a problem setting up the GPRS connection. You can examine the raw serial communication with FONA by looking at the chat command log. Execute the following to view the chat log:
cat /var/log/syslog | grep chat
Jul 8 03:47:40 raspberrypi chat[2323]: abort on (BUSY) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (VOICE) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (NO CARRIER) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (NO DIALTONE) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (NO DIAL TONE) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (NO ANSWER) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (DELAYED) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (ERROR) Jul 8 03:47:40 raspberrypi chat[2323]: abort on (+CGATT: 0) Jul 8 03:47:40 raspberrypi chat[2323]: send (AT^M) Jul 8 03:47:40 raspberrypi chat[2323]: timeout set to 12 seconds Jul 8 03:47:40 raspberrypi chat[2323]: expect (OK) Jul 8 03:47:40 raspberrypi chat[2323]: AT^M^M Jul 8 03:47:40 raspberrypi chat[2323]: OK Jul 8 03:47:40 raspberrypi chat[2323]: -- got it Jul 8 03:47:40 raspberrypi chat[2323]: send (ATH^M) Jul 8 03:47:40 raspberrypi chat[2323]: expect (OK) Jul 8 03:47:40 raspberrypi chat[2323]: ^M Jul 8 03:47:40 raspberrypi chat[2323]: ATH^M^M Jul 8 03:47:40 raspberrypi chat[2323]: OK Jul 8 03:47:40 raspberrypi chat[2323]: -- got it Jul 8 03:47:40 raspberrypi chat[2323]: send (ATE1^M) Jul 8 03:47:40 raspberrypi chat[2323]: expect (OK) Jul 8 03:47:40 raspberrypi chat[2323]: ^M Jul 8 03:47:40 raspberrypi chat[2323]: ATE1^M^M Jul 8 03:47:40 raspberrypi chat[2323]: OK Jul 8 03:47:40 raspberrypi chat[2323]: -- got it Jul 8 03:47:40 raspberrypi chat[2323]: send (AT+CGDCONT=1,"IP","web.omwtoday.com","",0,0^M) Jul 8 03:47:40 raspberrypi chat[2323]: expect (OK) Jul 8 03:47:40 raspberrypi chat[2323]: ^M Jul 8 03:47:40 raspberrypi chat[2323]: AT+CGDCONT=1,"IP","web.omwtoday.com","",0,0^M^M Jul 8 03:47:40 raspberrypi chat[2323]: OK Jul 8 03:47:40 raspberrypi chat[2323]: -- got it Jul 8 03:47:40 raspberrypi chat[2323]: send (ATD*99#^M) Jul 8 03:47:40 raspberrypi chat[2323]: timeout set to 22 seconds Jul 8 03:47:40 raspberrypi chat[2323]: expect (CONNECT) Jul 8 03:47:40 raspberrypi chat[2323]: ^M Jul 8 03:47:40 raspberrypi chat[2323]: ATD*99#^M^M Jul 8 03:47:40 raspberrypi chat[2323]: CONNECT Jul 8 03:47:40 raspberrypi chat[2323]: -- got it Jul 8 03:47:40 raspberrypi chat[2323]: send (^M)
Unfortunately cellular providers might have specific restriction or requirements for setting up a GPRS connection so it's difficult to troubleshoot all possible failures in this guide. If you're running into errors try to search the web for details on configuring PPP with your provider.
If you don't see any errors in the PPPD or chat logs, congratulations your FONA's GPRS connection should be tethered to your Raspberry Pi/BeagleBone Black! To check that there is a new ppp network interface run the following command:
ifconfig
ppp0 Link encap:Point-to-Point Protocol inet addr:21.144.145.193 P-t-P:10.64.64.64 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:72 (72.0 B) TX bytes:111 (111.0 B)
Now test pinging adafruit.com with the GPRS connection by executing:
ping adafruit.com
If the ping is successfull you should see a result like:
PING adafruit.com (207.58.139.247) from 21.144.145.193 ppp0: 56(84) bytes of data. 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=1 ttl=45 time=316 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=2 ttl=45 time=275 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=3 ttl=45 time=773 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=4 ttl=45 time=293 ms
If you receive an error like 'unknown host adafruit.com' then your cell provider didn't provide a DNS configuration. Try manually adding OpenDNS servers to your resolve.conf by following these steps.
If you receive no response with the ping command, check that your SIM and cellular provider allows you to access the internet. If possible, try using the SIM in a GSM phone with access to data to check it can access the internet.
If the ping command succeeded, now try accessing adafruit.com in a text-based web browser. Execute the following command:
elinks http://www.adafruit.com/
Notice the maximum speed of the internet connection is quite slow. Over a 2G GPRS connection you will only see about 5-10 kilobytes/second of download speed! This connection is far too slow to transfer large amounts of data, however it's perfect for talking to web services, sending emails, tweets, running a simple server, etc.
Press q and enter to close elinks.
Once you've verified you can ping and access adafruit.com then your FONA GPRS connection should be ready to use however you desire!
Remember, your cell phone provider might put limits or extra charges on your data usage so be careful before heavily using the GPRS connection! Also be extra careful if your provider charges extra for international or roaming data access--don't be the next person to rack up a $20,000+ cell phone bill!
When you're done with the GPRS connection it's easy to stop it by executing:
sudo poff fona
Automatic PPP Connection On Boot
If you'd like to configure your device to automatically bring up the PPP connection with FONA on boot, it's easy to do so by updating the network configuration. First make sure you've verified you can manually bring up the PPP connection in the previous steps. Also be sure you've disabled the kernel serial console on the Raspberry Pi, or updated uEnv.txt with the BB-UART4 device tree overlay on the BeagleBone Black--skipping either of those steps will fail to bring up the PPP connection on boot!Edit the /etc/network/interfaces file by executing:
sudo nano /etc/network/interfaces
auto fona iface fona inet ppp provider fona
Save the file, exit the editor, and reboot your device. As the device boots up, watch the FONA LEDs to see that the red LED starts flashing quickly to indicate a GPRS connection is activated. Once the device has finished booting, log in and check the ppp0 interface is up by running ifconfig. You can also check the PPPD and chat logs with the commands from earlier in the setup. If there are errors, check the logs to see what issues might be occuring.
If there are no errors, congratulations your device is now configured to automatically connect to the internet through FONA's GPRS connection! Enjoy accessing the internet from anywhere there is a 2G GPRS cellular connection!