Difference between revisions of "SW startup guide for Vayu 2G"

From Yantrr Wiki
Jump to: navigation, search
(AT Commands Manual)
 
(49 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
 +
For a quick guide to starting with the Vayu 2G cape's HW, see [[media:Leaflet_for_Vayu_2GP_Cape.pdf| Leaflet for 2G cape]].
 +
 +
Below, we describe how to set up the 2G capes and its associated software.
 +
 
= Software overview for using Vayu-2G-A/Vayu-2GP-A Cape =
 
= Software overview for using Vayu-2G-A/Vayu-2GP-A Cape =
 +
Data connection is established based on PPP protocols. Wvdial is mainly used to configure the dialup settings.
 +
For setting up various settings for PPP connection and establishing a data connection on these capes follow the link to the wiki
 +
* Way to setup the Vayu 2G Capes
 +
* How to read location and coarse time  as NMEA-0183 message from the serial UART ttyO4 port 
 +
* How to write wvdial conf files for any network
 +
* Sample wvdial.conf file for [http://www.yantrr.com/wiki/Sample_wvdial.conf_file#Sample_Wvdial_conf_file_for_AT.26T_3G'''<big>AT&T</big>'''] and [http://www.yantrr.com/wiki/Sample_wvdial.conf_file#Sample_Wvdial_conf_file_for_TMOBILE_2G'''<big>T-Mobile USA</big>''']
 +
 
For using the Vayu-2G-A/Vayu-2GP-A Cape, please ensure that you have the following :
 
For using the Vayu-2G-A/Vayu-2GP-A Cape, please ensure that you have the following :
 
Debian Wheezy image which has following :
 
  
 
1. PPS drivers enabled in kernel, required if GPS module is present.
 
1. PPS drivers enabled in kernel, required if GPS module is present.
Line 8: Line 18:
 
2. Vayu Device tree overlay file  
 
2. Vayu Device tree overlay file  
  
You can either download kernel patches containing the same to use with your existing images or you can download our prebuilt MicroSD card image or EMMC flasher image .
+
You can either download kernel patches containing the same to use with your existing images or you can download our prebuilt MicroSD card image or EMMC flasher image.
  
 
All the images and files and extra support on software can be found here :
 
All the images and files and extra support on software can be found here :
 +
'''<big>[[Vayu_Cape_SW_images_and_drivers]]</big>'''
  
[http://www.yantrr.com/products/m2m-cape-for-beaglebone/support/ http://www.yantrr.com/products/m2m-cape-for-beaglebone/support/]
 
  
 
== Device enable for Vayu-2G-A/Vayu-2GP-A Cape ==
 
== Device enable for Vayu-2G-A/Vayu-2GP-A Cape ==
== GSM/GPRS Modem ==
+
===Setting up the system===
 +
1. Place a mini sim in the sim card slot and connect a GSM antenna to the SMA connector.
 +
 
 +
2. Mount the cape on BBB carefully.
 +
 
 +
3. Ensuring that the power jumper on the cape is in its place, power up the setup using a 5V DC adapter(min 2.5A) to barrel jack. D2 LED on the cape will glow alongwith LEDs on the Beaglebone black.
 +
 
 +
::*'''Note : Before proceeding further ensure D2 LED is glowing properly. Make sure that the adapter being used is of proper rating and has been connected properly. Further check for the presence of the power jumper(#12 on [http://www.yantrr.com/w/images/4/4b/Leaflet_for_Vayu_2GP_Cape.pdf leaflet]).'''
 +
 
 +
::*'''Note : Do not try to power up using USB cable alone. Always power up system with a DC adapter. Also while disconnecting power, USB cable should be removed before the DC adapter.'''
 +
 
 +
=== GSM/GPRS Modem ===
 
'''Note:'''&nbsp;All commands are executed as root on Debian unless otherwise mentioned.
 
'''Note:'''&nbsp;All commands are executed as root on Debian unless otherwise mentioned.
  
Line 23: Line 44:
  
 
'''Step 2.''' Go to /lib/firmware
 
'''Step 2.''' Go to /lib/firmware
 
+
<pre>
 
cd /lib/firmware
 
cd /lib/firmware
 +
</pre>
  
'''Step 3.''' After ensuring that there is a file BB-UART1-00A0.dtbo in directly, apply the device tree overlay by :
+
'''Step 3.''' After ensuring that file BB-UART1-00A0.dtbo exists, apply the device tree overlay as :
 
+
<pre>
 
echo BB-UART1 > /sys/devices/bone_capemgr.9/slots
 
echo BB-UART1 > /sys/devices/bone_capemgr.9/slots
 +
</pre>
 +
 +
On Debian 9.* use
 +
<pre>
 +
echo BB-UART1 > /sys/devices/platform/bone_capemgr/slots
 +
</pre>
  
 
'''Step 4. '''On reading ‘’’slots’’’ if you are able to see UART1 , then it has been applied successfully.
 
'''Step 4. '''On reading ‘’’slots’’’ if you are able to see UART1 , then it has been applied successfully.
 
+
<pre>
 
cat /sys/devices/bone_capemgr.9/slots
 
cat /sys/devices/bone_capemgr.9/slots
 
+
</pre>
[[Image:]]
+
On Debian 9.*. use
 
+
<pre>
 +
cat /sys/devices/platform/bone_capemgr/slots
 +
</pre>
 
'''Step 5'''. You can verify that UART1 (ttyO1 ) by checking for ttyO1 in devices (/dev/)
 
'''Step 5'''. You can verify that UART1 (ttyO1 ) by checking for ttyO1 in devices (/dev/)
 
+
<pre>
 
ls /dev/ttyO*
 
ls /dev/ttyO*
 +
</pre>
  
 
Output will show /dev/ttyO0 and /dev/ttyO1 .  
 
Output will show /dev/ttyO0 and /dev/ttyO1 .  
  
Over UART1 port we can communicate with our modem and execute AT commands too when required.
+
Over UART1 port we can communicate with the modem and also AT commands can be executed whenever required.
 
+
 
The UART port of modem is available at one instant only, either it is establishing ppp connection or AT commands are executed on it.  
 
The UART port of modem is available at one instant only, either it is establishing ppp connection or AT commands are executed on it.  
 
+
We now see and understand different modes for controlling the GPS/GPRS Modem and ensure that it is properly powered on and available for establishing data connection.
We now see and understand different modes for controlling our GPS/GPRS Modem and ensure that it is properly powered on and available for establishing data connection.
+
 
+
  
 
The Modem has different operating modes.
 
The Modem has different operating modes.
  
[[Image:]]
+
[[File:SIM900A Power modes.png]]
  
 
'''To use the modem after powering up the Cape, it needs to be properly turned on. '''
 
'''To use the modem after powering up the Cape, it needs to be properly turned on. '''
Line 59: Line 87:
 
'''i.'''&nbsp;'''STATUS LED D3'''&nbsp;: This Led gives the state of the Modem. It is on when the module is turned on and off when it is turned off.
 
'''i.'''&nbsp;'''STATUS LED D3'''&nbsp;: This Led gives the state of the Modem. It is on when the module is turned on and off when it is turned off.
  
'''ii.'''&nbsp;'''NETLIGHT LED D4'''&nbsp;: It has different states depending on the mode of operation of the Modem -
+
'''ii.'''&nbsp;'''NETLIGHT LED D4'''&nbsp;: It has different states depending on the mode of operation of the Modem :-
  
 
a. Off when Modem is off
 
a. Off when Modem is off
Line 71: Line 99:
  
 
On the Cape, ON/OFF pin and Reset pin can be controlled via a push button switch as well as GPIOs assigned to them on Beaglebone Black.  
 
On the Cape, ON/OFF pin and Reset pin can be controlled via a push button switch as well as GPIOs assigned to them on Beaglebone Black.  
 
 
For ON/OFF pin, S1 is the ON/OFF push button switch provided on cape and GPIO45 in Beaglebone Black is assigned the same. '''GPIO45 should always be set high.'''
 
For ON/OFF pin, S1 is the ON/OFF push button switch provided on cape and GPIO45 in Beaglebone Black is assigned the same. '''GPIO45 should always be set high.'''
 
 
For Reset pin, S2 is the Hard Reset push button switch provided on cape and GPIO60 in Beaglebone Black is assigned the same. '''GPIO60 should always be set high.'''
 
For Reset pin, S2 is the Hard Reset push button switch provided on cape and GPIO60 in Beaglebone Black is assigned the same. '''GPIO60 should always be set high.'''
  
Line 87: Line 113:
 
'''Step 6: '''Set GPIO45 High, after Beaglebone Black has booted completely with Vayu Cape mounted on it to turn on the modem properly.
 
'''Step 6: '''Set GPIO45 High, after Beaglebone Black has booted completely with Vayu Cape mounted on it to turn on the modem properly.
  
'''Step 7: '''
+
'''Step 7: '''Once ttyO1 port was enabled, you can execute AT commands for the modem on it or see the messages from the modem that are sent there. You can use minicom for it.
 
+
<pre>
Once ttyO1 port was enabled, you can execute AT commands for the modem on it or see the messages from the modem that are sent there. You can use minicom for it.
+
apt-get install minicom (This is there in the SW image)
 
+
minicom –s
''apt-get install minicom (This is there in the SW image)''
+
</pre>
 
+
''minicom –s ''
+
 
+
 
and set serial port settings as '''/dev/ttyO1 115200 8N1'''
 
and set serial port settings as '''/dev/ttyO1 115200 8N1'''
 
 
When you , properly turn on the modem after you have booted i.e. set GPIO45 high, or whenever modem is turned ON , you will see an output on /dev/ttyO1 port.  
 
When you , properly turn on the modem after you have booted i.e. set GPIO45 high, or whenever modem is turned ON , you will see an output on /dev/ttyO1 port.  
 
 
'''RDY'''
 
'''RDY'''
 
 
Power On of Modem is indicated by the STATUS GPIO or LED which should be ON . Also the NETLIGHT LED will start blinking depending on whether SIM Card is present or not.  
 
Power On of Modem is indicated by the STATUS GPIO or LED which should be ON . Also the NETLIGHT LED will start blinking depending on whether SIM Card is present or not.  
  
Line 107: Line 127:
 
Modem can be powered off by :  
 
Modem can be powered off by :  
  
1. Normal power down procedure : Power down by ON/OFF Pin
+
1. Normal power down procedure :  
  
a. Press the switch S1 for atleast 1s and then release it
+
* Power down by ON/OFF Pin :
  
b. Set GPIO45 low for atleast 1s and set it high
+
&nbsp;i. Press the switch S1 for atleast 1s and then release it
  
2. Normal power down procedure : Power down by AT command AT+CPOWD=1 , at /dev/ttyO1
+
&nbsp;ii. Set GPIO45 low for atleast 1s and set it high
  
3. Abnormal Power down procedure : Over-voltage or under-voltage automatic power down
+
* Power down by AT command : AT+CPOWD=1 , at /dev/ttyO1
  
4. Abnormal Power down procedure : over-temperature or under-temperature automatic power down
+
2. Abnormal Power down procedure :  
  
 +
* Over-voltage or under-voltage automatic power down
 +
* over-temperature or under-temperature automatic power down
  
In Normal powerdown, the modem port , /dev/ttyO1 will read out the following message :  
+
In Normal Power down, the modem port /dev/ttyO1 will read out the following message :  
  
'''NORMAL POWER DOWN'''
+
<pre>
 +
NORMAL POWER DOWN
 +
</pre>
  
 
In Abnormal Power down Procedure , AT commands cannot be issued anymore, only RTC is active.
 
In Abnormal Power down Procedure , AT commands cannot be issued anymore, only RTC is active.
Line 144: Line 168:
 
<nowiki>If temperature < -40degree Celsius, </nowiki>'''_CMTE:-2'''
 
<nowiki>If temperature < -40degree Celsius, </nowiki>'''_CMTE:-2'''
  
Powerdown of Modem is indicated by STATUS LED not glowing or GPIO going low. Also, NETLIGHT LED will be Off.
+
'''Power down of Modem is indicated by STATUS LED not glowing or GPIO going low. Also, NETLIGHT LED will be Off.'''
  
 
'''Soft Reset the Modem :'''
 
'''Soft Reset the Modem :'''
  
Power Down the Module  
+
1. Power Down the Module  
  
Wait for atleast 800ms after STATUS LED switched off or GPIO went low
+
2. Wait for atleast 800ms after STATUS LED switched off or GPIO went low
  
Power On the Module
+
3. Power On the Module
  
 
'''Hard Reset the Modem:'''
 
'''Hard Reset the Modem:'''
Line 158: Line 182:
 
This is an emergency reset only.Use this only when ON/OFF pin or “AT+CPOWD=1” have no effect.  
 
This is an emergency reset only.Use this only when ON/OFF pin or “AT+CPOWD=1” have no effect.  
  
The Hard reset pin can be pulled low for atleast 1.2s and then set high.
+
1. The Hard reset pin can be pulled low for atleast 1.2s and then set high.
  
GPIO60 should be high all the time. S2 is Hard reset push button switch for Modem.
+
2. GPIO60 should be high all the time. S2 is Hard reset push button switch for Modem.
  
 +
'''Note :''' The GPRS modem on the cape has been shipped pre-set with settings so that its serial port is working and appropriate settings has been stored in the modem. For more details about its operation modes refer to datasheet.
  
The GPRS modem on the cape has been shipped pre-set with settings so that its serial port is working and appropriate settings has been stored in the modem. For more details about its operation modes refer to datasheet.
+
If SIM900A has been set to minimum functionality by “AT+CFUN=0”, the RF function and SIM card function will be closed. In this case, the serial port is still accessible, but all AT commands correlative with RF function or SIM card function will not be accessible.
 
+
For SIM900A, it requests to set AT command “AT+CSCLK=1” to enable the sleep mode; the default value is 0, that can’t make the module enter sleep mode
Currently module has Data communication enabled and is fully functional (+CFUN=1) and in sleep mode 0 (+CSCLK=0) and will not go to sleep ever.
+
  
 
To change the modes or any settings related to modem , you need access to AT ports and run AT commands there.  
 
To change the modes or any settings related to modem , you need access to AT ports and run AT commands there.  
Line 171: Line 195:
 
Considering that, Cape is connected properly to Beaglebone black and user is logged in as root and has checked for UART1 port, we check that the Modem is turned on properly before trying to establish a connection, so:
 
Considering that, Cape is connected properly to Beaglebone black and user is logged in as root and has checked for UART1 port, we check that the Modem is turned on properly before trying to establish a connection, so:
  
'''i.'''&nbsp;D3 is continuously on and D4 is blinking as 64ms ON/800ms OFF, when SIM card is not present or not detected/inserted properly.
+
'''i.'''&nbsp;D3 is continuously glowing and D4 is blinking as 64ms ON/800ms OFF, when SIM card is not present or not detected/inserted properly.
  
'''ii.'''<nowiki>&nbsp;D3 is continuously on and D4 is blinking as 64ms ON/3000 ms OFF when a valid SIM card is present. If SIM card was inserted while the modem was on, please software reset the modem by turning it OFF and then ON again using Software GPIO commands or Push button switch. [refer to]</nowiki>
+
'''ii.'''<nowiki>&nbsp;D3 is continuously glowing and D4 is blinking as 64ms ON/3000 ms OFF when a valid SIM card is present. If SIM card was inserted while the modem was on, please software reset the modem by turning it OFF and then ON again using Software GPIO commands or Push button switch. [refer to]</nowiki>
  
 
If any other state of LEDs is present, please soft reset the modem using push button switch or GPIOs.
 
If any other state of LEDs is present, please soft reset the modem using push button switch or GPIOs.
  
So when it is established that modem is in&nbsp;'''ii'''&nbsp;we try to establish connection
+
So when it is established that modem is in&nbsp;'''ii'''&nbsp; state , now we try to establish connection
  
 
Summarizing, following are the steps to enable PPP connection using the Modem :
 
Summarizing, following are the steps to enable PPP connection using the Modem :
Line 193: Line 217:
 
'''Step 5: '''Once it has been ensured modem is properly switched on, we can proceed with establishing PPP connection either using PPPd or Wvdial. For more details on using them, please refer to Application notes for 2G/2GP cape.
 
'''Step 5: '''Once it has been ensured modem is properly switched on, we can proceed with establishing PPP connection either using PPPd or Wvdial. For more details on using them, please refer to Application notes for 2G/2GP cape.
  
 +
===AT Commands Manual===
 +
All the AT commands can be executed on the serial port /dev/ttyO1 with baud rate of 115200 8N1.
  
'''All the images and files and extra support on software can be found here :'''
+
* '''2G Modem (SIM800)'''
 +
** [http://wiki.yantrr.com/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf SIM800_Series_AT_Command_Manual_V1.09.pdf]
 +
** [[:media:GPRS_Module_AT_Commands.pdf|SIM900_Series_AT_Command_Manual]]
  
[http://www.yantrr.com/products/m2m-cape-for-beaglebone/support/ http://www.yantrr.com/products/m2m-cape-for-beaglebone/support/]
+
===FAQ===
 +
FAQ for this section [[FAQ_2G_Power_On_Modem | click here]]
 +
 
 +
==Software Images and Files==
 +
'''All the images and files and extra support on software can be found here :''' [[Vayu_Cape_SW_images_and_drivers | click here]]
  
 
== Wvdial Configuration for Debian Wheezy : ==
 
== Wvdial Configuration for Debian Wheezy : ==
'''Note : '''All commands are recommended to executed as root user.
+
'''Note : '''All commands are recommended to be executed as root user.
  
 
Download and install Wvdial
 
Download and install Wvdial
 
+
<pre>
 
$ apt-get install wvdial
 
$ apt-get install wvdial
 
+
</pre>
 
Executing the following command usually sets the wvdial.conf file which is used for dialing to GPRS communication, but since here our modem port is on a UART(/dev/ttyO1) and not on /dev/ttyS* or /dev/ttyUSB* ports, we will have to&nbsp;'''manually configure '''it.
 
Executing the following command usually sets the wvdial.conf file which is used for dialing to GPRS communication, but since here our modem port is on a UART(/dev/ttyO1) and not on /dev/ttyS* or /dev/ttyUSB* ports, we will have to&nbsp;'''manually configure '''it.
 
+
<pre>
 
$ wvdialconf
 
$ wvdialconf
 
+
</pre>
 
So, open the wvdial.conf file
 
So, open the wvdial.conf file
 
+
<pre>
 
$ nano /etc/wvdial.conf
 
$ nano /etc/wvdial.conf
 +
</pre>
 +
Considering that, you have the USERNAME, PASSWORD and APN available for the service provider of the sim card being used, edit and make wvdial.conf file like this.
  
Consideirng that, you have the USERNAME, PASSWORD and APN available for the service provider of the sim card being used, edit and make wvdial.conf file like this.
+
<pre>
 
+
[Dialer Defaults]
<nowiki>[Dialer Defaults]</nowiki>
+
 
+
 
Modem Type = Analog
 
Modem Type = Analog
 
 
ModemPhone = *99#
 
ModemPhone = *99#
 
 
ISDN = 0
 
ISDN = 0
 
 
Baud = 115200
 
Baud = 115200
 
 
Username = USERNAME
 
Username = USERNAME
 
 
Password = PASSWORD
 
Password = PASSWORD
 
 
Modem = /dev/ttyO1
 
Modem = /dev/ttyO1
 
 
Init1 = ATZ
 
Init1 = ATZ
 
 
Init2 = at+cgdcont=1,"ip","APN"
 
Init2 = at+cgdcont=1,"ip","APN"
 
 
Stupid Mode = 1
 
Stupid Mode = 1
 +
</pre>
  
 
Usually for GSM Networks, Modemphone is *99# or *99***1#
 
Usually for GSM Networks, Modemphone is *99# or *99***1#
 
+
After editing save and exit, now run wvdial for establishing communication.
After editing save and exit
+
<pre>
 
+
Now run wvdial for establishing communication.
+
 
+
 
$ wvdial
 
$ wvdial
 
+
</pre>
 
<nowiki>You can also edit the wvdial.conf file for multiple service providers by providing its name here [Dialer Defaults]&nbsp;:</nowiki>
 
<nowiki>You can also edit the wvdial.conf file for multiple service providers by providing its name here [Dialer Defaults]&nbsp;:</nowiki>
  
<nowiki>[Dialer Vodafone]</nowiki>
+
<pre>
 
+
[Dialer Vodafone]
 
Modem Type = Analog Modem
 
Modem Type = Analog Modem
 
 
Phone = *99#
 
Phone = *99#
 
 
ISDN = 0
 
ISDN = 0
 
 
Baud = 115200
 
Baud = 115200
 
 
Username = 0
 
Username = 0
 
 
Password = 0
 
Password = 0
 
 
Modem = /dev/ttyO1
 
Modem = /dev/ttyO1
 
 
Init1 = ATZ
 
Init1 = ATZ
 
 
Init2 = at+cgdcont=1,"ip","www"
 
Init2 = at+cgdcont=1,"ip","www"
 
 
Stupid Mode = 1
 
Stupid Mode = 1
 
+
[Dialer Airtel]
<nowiki>[Dialer Airtel]</nowiki>
+
 
+
 
Modem Type = Analog Modem
 
Modem Type = Analog Modem
 
 
Phone = *99#
 
Phone = *99#
 
 
ISDN = 0
 
ISDN = 0
 
 
Baud = 115200
 
Baud = 115200
 
 
Username = airtel
 
Username = airtel
 
 
Password = airtel
 
Password = airtel
 
 
Modem = /dev/ttyO1
 
Modem = /dev/ttyO1
 
 
Init1 = ATZ
 
Init1 = ATZ
 
 
Init2 = at+cgdcont=1,"ip","airtelgprs.com"
 
Init2 = at+cgdcont=1,"ip","airtelgprs.com"
 
 
Stupid Mode = 1
 
Stupid Mode = 1
 
+
</pre>
 
+
 
And run wvdial for the required service provider as follows:
 
And run wvdial for the required service provider as follows:
 +
<pre> wvdial airtel </pre>
  
wvdial airtel
+
A list of running commands should be visible on the shell, trying to establish PPP connection. Once PPP connection has been established, you will see a ppp0 IP.
 
+
A list of running commands should be visible on the shell, trying to establish PPP connection.
+
 
+
once PPP connection has been established, you will see a ppp0 IP.
+
 
+
 
To check the status of wvdial and find out its IP open a new shell and use either of following:
 
To check the status of wvdial and find out its IP open a new shell and use either of following:
  
1. Run ifconfig and find ppp0 in the list of network connections.
+
* Run ifconfig and find ppp0 in the list of network connections.
 
+
<pre>
 
$ ifconfig
 
$ ifconfig
 
 
or
 
or
 
 
$ ifconfig ppp0
 
$ ifconfig ppp0
 
+
</pre>
2. Check the network statistics for IP and their gateways and check the Iface column for ppp0
+
* Check the network statistics for IP and their gateways and check the Iface column for ppp0
 
+
<pre>
 
$ netstat -arn
 
$ netstat -arn
 
+
* Kernel IP routing table  
 
+
Kernel IP routing table
+
 
+
  
 
Destination Gateway Genmask Flags MSS Window irtt Iface
 
Destination Gateway Genmask Flags MSS Window irtt Iface
 
 
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
 
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
 
 
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
 
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
 
 
192.168.7.0 0.0.0.0 255.255.255.252 U 0 0 0 usb0
 
192.168.7.0 0.0.0.0 255.255.255.252 U 0 0 0 usb0
 
 
192.200.1.21 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
 
192.200.1.21 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
 
+
</pre>
 
+
 
3. Read the system messages as
 
3. Read the system messages as
 
+
<pre>
 
$ cat /var/log/messages
 
$ cat /var/log/messages
 
+
</pre>
 
It lists all the attempts at establishing ppp communication using the modem and ips for the successful attempt.
 
It lists all the attempts at establishing ppp communication using the modem and ips for the successful attempt.
 
+
Now all that is left, is to route the network traffic over the gateway of ppp0 instead of eth0 so that GPRS communication is fully completed.
Now all that is left is to route the network traffic over the gateway of ppp0 instead of eth0 so that GPRS communication is fully completed.
+
 
+
For that, download and run this&nbsp;[http://www.yantrr.com/w/index.php?title=0000routefix&action=edit&redlink=1 script]
+
 
+
$ chmod +x 0000routefix
+
 
+
$ ./0000routefix
+
 
+
Now on Ip table should look like this&nbsp;:
+
 
+
$ netstat -arn
+
 
+
Kernel IP routing table
+
 
+
Destination Gateway Genmask Flags MSS Window irtt Iface
+
 
+
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
+
 
+
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
+
 
+
192.168.7.0 0.0.0.0 255.255.255.252 U 0 0 0 usb0
+
 
+
192.200.1.21 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
+
 
+
  
 
'''PPP connection has been established over GPRS using 2G module and wvdial.'''
 
'''PPP connection has been established over GPRS using 2G module and wvdial.'''
Line 375: Line 337:
  
 
You can alternately run wvdial for multiple service providers and store their wvdial.conf files too by this way also
 
You can alternately run wvdial for multiple service providers and store their wvdial.conf files too by this way also
 
+
<pre>
 
$ wvdial -C /etc/wvdial.conf.provider_name
 
$ wvdial -C /etc/wvdial.conf.provider_name
 +
</pre>
  
where wvdial.conf.provider_name is wvdial.conf for the SIM card currently inserted.
+
where wvdial.conf.provider_name is wvdial.conf for the SIM card currently inserted. Also, you can Wvdial in background to free up the shell instead of opening another new shell by&nbsp;:
 
+
Also, you can Wvdial in background to free up the shell instead of opening another new shell by&nbsp;:
+
  
 +
<pre>
 
$ wvdial & disown
 
$ wvdial & disown
 +
</pre>
  
 +
===FAQ===
 +
FAQ for this section [[FAQ_2G_PPP | click here]]
  
Sample Wvdial files for some service providers can be downloaded from below mentioned links :
 
 
1. Airtel, India
 
 
2. Vodafone, India
 
 
3. MTNL, India
 
 
4. Sample wvdial.conf with all above three providers in one file.
 
 
=== Adding a DNS if BBB doesnt get it ===
 
nano /etc/resolv.conf add following
 
 
nameserver 8.8.8.8
 
 
nameserver 208.67.222.222
 
  
 +
Sample Wvdial files for some service providers are given[[Sample_wvdial.conf_file#Sample_Wvdial_conf_file_for_T-Mobile_2G | <big>'''HERE'''</big>]]
  
 
== Using GPS module with Debian Wheezy ==
 
== Using GPS module with Debian Wheezy ==
Vayu -2GP-A cape , Vayu-3GHP-A, Vayu-3GCP-A and Vayu-P cape come with a GPS module.
 
 
It has following interfaces with available to user and connecting to Beaglebone Black :
 
 
1. '''UART4 (/dev/ttyO4)''' : It is used for reading the GPS NMEA messages from UART port of GPS module. It should be configured for use at baud rate '''19200 raw '''after ttyO4 has been enabled in the kernel by applying device tree overlay for UART4.
 
 
2. '''GPIO50''' : It is used for resetting the GPS modules. It should be pulled high all the time.
 
 
3. '''GPIO27 ''': It is used as an input GPIO to receive 1 PPS output from the GPS module.
 
 
4. '''Switch S3''' on Cape : It is push button Reset switch. To reset the module , push this button for atleast 1s or set the reset GPIO50 low for atleast 1s.
 
 
5. '''LED D5 on Cape : '''It is GPS fix LED of the GPS Module. When the Module has acquired GPS fix, this LED starts blinking at 1s OFF/1s ON . Also 1PPS output can be detected at GPIO27 after that.
 
 
6. '''LED D7 on Cape :''' It is 3.3V power Led for cape, also indicating that it should be always glowing for the GPS module to be powered on.
 
 
 
Connect the GPS antenna at SMA connector P6 and place the antenna under open sky for better operations and Boot up Beaglebone Black with cape mounted on it. Notice LED D7 powering up.
 
 
Depending on the GPS module had a cold start , warm start or hot start , You should soon see LED D5 to start blinking, denoting that GPS Fix has been acquired.
 
 
To read the NMEA messages from the GPS Module on Beaglebone Black :
 
 
'''Step 1 : '''Enable UART4 (/dev/ttyO4) in device tree kernel.
 
 
''cd /lib/firmware''
 
 
''echo BB-UART4 > /sys/devices/bone_capemgr.9/slots''
 
 
You can read the ''slots'' or use ''dmesg'' to see that UART4 has been enabled.
 
 
''cat /sys/devices/bone_capemgr.9/slots''
 
 
Output will be like this :
 
 
''0: 54:PF---''
 
 
''1: 55:PF---''
 
 
''2: 56:PF---''
 
 
''3: 57:PF---''
 
 
''4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G''
 
 
''5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI''
 
 
''7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART4''
 
 
 
'''Step 2 : '''Install Minicom or use the following commands to see NMEA messages
 
 
''apt-get install minicom''
 
 
''minicom –s'' (port settings /dev/ttyO4 19200 8N1 )
 
 
or
 
 
''stty –F /dev/ttyO4 19200 raw''
 
 
''cat /dev/ttyO4''
 
 
 
For more information and detailed guide on Time synchronization and GPS Location , please refer to the following :
 
 
[http://www.yantrr.com/wiki/Configuring_for_GPS_Location_and_Time_Synchronization http://www.yantrr.com/wiki/Configuring_for_GPS_Location_and_Time_Synchronization]
 
 
 
= Hardware and Software FAQ for Vayu Capes =
 
# '''How to use the modem on this cape for establishing data connection?'''
 
 
'''Ans :''' Please refer to Application notes for configuring Cape for first time use and configuring for data connection using PPP/wvdial in debian wheezy or Angstrom.
 
 
2. '''How to use the GPS module on this cape ?'''
 
 
'''Ans :''' Please refer to Application notes for Configuring Cape for first time use and GPS location and NTP Synchronization in Debian Wheezy or Angstrom.
 
 
 
# '''What are various applications of having GPS module on this cape? How can I use them ?'''
 
 
'''Ans :''' Please refer to Application note for GPS Location and NTP Synchronization in Debian Wheezy or Angstrom.
 
 
 
# '''How to set the PPP settings for a service provider ?'''
 
 
'''Ans :''' Please refer to Application note for Configuring for data connection using PPP/Wvdial in Debian Wheezy or Angstrom
 
 
 
# '''How to use the modem wtihWvdial ?'''
 
 
'''Ans : '''Please refer to Application note for Configuring for data connection using Wvdial in Debian Wheezy or Angstrom
 
 
 
# '''What all software patches do I need to use this cape ? Are there any images readily available to use it on the go ?'''
 
 
'''Ans :''' To use GPS Module completely, PPS drivers for GPIO enabled in kernel and NTP packages to be installed.
 
 
To use Modem, Wvdial and/or PPP files need to configured for establishing PPP connection.
 
 
All this is available in a Downloadable image for both Angstrom and Debian Wheezy as a normal SD card image or EMMC flasher image.
 
 
Kernel patch files are also available for use with pre-existing Debian/Angstrom Images and steps for compiling kernel for these drivers and installing packages are provided here. Please refer to Application notes for more details.
 
 
 
# '''Which all OS does the Cape support ? Can I use it with Android on Beaglebone Black ?'''
 
 
'''Ans:''' Currently Our Cape has full support on Debian Wheezy and Angstrom Linux. We are working to expand it for use with Android and other OS that Beaglebone Black supports.
 
 
 
# '''Cape/Modem was not Powered off when I shut Beaglebone Black down by pressing Power button or executing shutdown command ?'''
 
 
'''Ans:''' When Beaglebone Black is shutdown with Power adapter still plugged in then Modem just resets and turns back on because it draws power directly from Power Adapter and not the PMIC on Beaglebone Black.
 
 
So, usually when remotely shutting down Beaglebone Black, Turn off the Modem before that . Resetting Beagle bone Black resets the Modem in any case.
 
 
GPS module simply turns off when Beaglebone Black is shutdown.
 
 
 
# '''PPP is established, but I cannot access/login to Beaglebone Black over PPP IP ?'''
 
 
'''Ans :''' After establishing PPP connection and ensuring that it has been established properly, the Network Gateway on the Beaglebone black has to be switched from eth0 by default to the ppp0 .
 
 
It can be done using following commands :
 
 
''GW=$(ip address show ppp0 | awk ‘/peer/ {print $4}’ | cut –d “/” –f1)''
 
 
''ip route replace default via $GW dev ppp0 ''
 
 
You can simply replace the ‘GW’ by the Gateway ip for ppp0 too by looking from ifconfig output.
 
 
Now, check status of gateway being changed from eth0 to ppp0 by
 
 
''netstat –arn''
 
 
Similarly, you can reset back from ppp0 to eth0
 
 
 
# '''How to enable PPP redial when connection drops in between ?'''
 
 
'''Ans:'''
 
 
 
# '''What are the GPIOs for Resetting or turning ON/OFF the Modem and the GPS module?'''
 
 
'''Ans:''' For turning the Modem On or Off, GPIO 45 is used. GPIO45 should be high by default.
 
 
For Soft Resetting, cycle GPIO45 through OFF and then ON .
 
 
For Hard Resetting the modem, GPIO 60 is used. GPIO60 should be high by default
 
 
For Resetting the GPS module, GPIO50 is used. GPIO50 should be high by default.
 
 
There is no ON/OFF control for GPS Module.
 
 
Alternatively, push button switches can be used instead of GPIOs.
 
 
Please refer to Application notes for more information.
 
 
 
# '''At which port is GPS NMEA data coming?'''
 
 
'''Ans :''' GPS NMEA data is coming at UART4 or /dev/ttyO4 .
 
 
As a root user you can do the following :
 
 
''stty –F /dev/ttyO4 19200 raw''
 
 
''cat /dev/ttyO4 ''
 
 
or see the data over minicom at ttyO4 port.
 
 
 
# '''What are AT command settings for modem?'''
 
 
'''Ans :''' There is a AT command set available for the Modems . They can be downloaded from here.
 
 
AT command port for GPRS modem is /dev/ttyO1 at baud rate 115200 8N1.
 
 
 
# '''How to know whether PPP has been established successfully?'''
 
 
'''Ans :''' Please refer to Application note for Configuring Data connection using Wvdial/PPP for more details.
 
 
 
# '''How to see the NTP server data?'''
 
 
'''Ans :''' After starting NTP server, its data can be seen by using following query command :
 
 
''ntpq –p''
 
 
This would list all the peers that you have entered in your ntp.conf file.
 
 
 
# '''How to check that pps input data is coming ?'''
 
 
'''Ans:''' PPS inut data from GPS module is coming at /dev/pps1 after it has got a Fix . As a root user, follow these commands :
 
 
''cd /usr/src/pps-tools''
 
 
''./ppstest /dev/pps1''
 
 
 
The output should be something like this for a valid pps input
 
 
''trying PPS source "/dev/pps1"''
 
 
''found PPS source "/dev/pps1"''
 
 
''ok, found 1 source(s), now start fetching data...''
 
 
''source 0 - assert 1392269685.015340936, sequence: 53 - clear 0.000000000, sequence: 0''
 
 
''source 0 - assert 1392269686.015346237, sequence: 54 - clear 0.000000000, sequence: 0''
 
 
''source 0 - assert 1392269687.015357137, sequence: 55 - clear 0.000000000, sequence: 0''
 
 
 
# '''Can I use my own existing Debian image with this cape ? What extra files/software patches do I require to install?'''
 
 
'''Ans''': Yes, you can use your own Debian/Angstrom image with our cape. You will need to include the precompiled kernel patches available from '''here''' and copy in your image as directed and reboot with the new image. It is advised to backup your existing image before doing this.
 
 
After applying kernel patches, follow application notes to configure the cape for establishing PPP connection or running a NTP server for time synchronization.
 
 
 
# '''What is the exact process to Turn Modem On and off and reset it using On/off switch or SW GPIOs ?'''
 
 
'''Ans:''' For turning the modem On or Off , GPIO 45 is used. Following is the process how it has to be used :
 
 
''GPIO45 High, delay of 4 seconds, GPIO45 Low, delay of 4 seconds, GPIO45 High''
 
 
GPIO45 should be High by default.
 
 
For soft resetting, cycle GPIO45 through OFF and then ON like following:
 
 
''GPIO45 High, delay of 4 seconds, GPIO45 Low, delay of 4 seconds , GPIO45 High, delay of 4 seconds, GPIO45 Low, delay of 4 seconds, GPIO45 High''
 
 
For Hard Resetting the modem, GPIO 60 is used. Following is the process:
 
 
''GPIO60 Low, delay 1 second, GPIO60 High''
 
 
GPIO60 should be high by default
 
 
For Resetting the GPS module, GPIO50 is used. Following is the process:
 
 
''GPIO50 Low, delay 2 second, GPIO50 High''
 
 
GPIO50 should be high by default.
 
 
Alternatively, Push button Switches can be used instead of GPIOs in similar cycles.
 
 
Please refer to Application notes for more information.
 
 
 
# '''What to do when the Modem hangs up ?'''
 
 
'''Ans :''' In cases when the Modem hangs up or its firmware stops responding to AT COMMANDS and cannot be turned OFF and then ON, Use Hard Reset.
 
 
Hard reset is advised to be used in such cases only otherwise prefer soft resets for minor aberrations.
 
 
 
# '''What is the process of resetting the GPS module ?'''
 
 
'''Ans:''' For reseting the GPS module, GPIO50 is used. Following is the process:
 
 
''GPIO50 low, delay 2 second, GPIO50 High''
 
 
GPIO50 should be high by default.
 
 
Alternatively, push button switch can be used instead of GPIO in similar cycle.
 
 
Please refer to Application notes for more information.
 
 
 
# '''If I remove the SIM card while Cape is still ON and replace it with a new SIM card, what should be done next ?'''
 
 
'''Ans :''' You will need to restart the modem ( OFF ON cycle).
 
 
 
# '''GPS module takes time to get GPS fix indoors, does the antenna need to outdoors always ?'''
 
 
'''Ans :''' Yes for best results, it is advised that GPS antennas be under open sky to get fast GPS Fix as per the hot start, warm start or cold start times. After GPS fix has been achieved, antenna can be moved indoors if required.
 
 
 
# '''On my Modem+ GPS cape, is there a way that either of the modules be used selectively ?'''
 
 
'''Ans :''' Yes , if you want that at some time only GPS module be used and not the Modem, you can either remove Power Jumper from the 5V supply or simply Turn the Modem OFF.
 
 
Similarly, to use only the Modem alone and not the GPS modem , you can pull down the GPIO50 which controls the reset input of GPS module.
 
 
 
# '''What is Power requirements of the cape ? How much Current is drawn by Modem and by GPS module ?'''
 
 
'''Ans :''' Modem + GPS version of Cape in active mode requires around 2A @5V.
 
 
Modem uses 1800mA@ 4V when data connection has been established and is being used.
 
 
GPS Module draws upto 50mA @3.3V.
 
 
Power usage values of Beaglebone black ranges 210-430 mA @5V as per its SRM.
 
 
 
# '''What is the recommended ratings of Power adapter to use with Cape ?'''
 
 
'''Ans ''': It is recommended to use atleast a 2.5A 5V power adapter with our cape for complete utilisation of all the functions of Beaglebone Black and our cape.
 
 
 
# '''What is the function of each LED ? What do they denote and how do they function under different conditions ?'''
 
 
'''Ans :''' D2 is power Led of Cape, which denotes the 5V power being provided to Cape and for the Modem.
 
 
D7 is 3.3V power LED from the Beaglebone Black. This denotes 3.3V power for GPS module and other ICs on Cape.
 
 
D5 is 1 PPS Fix led for the GPS module. It will blink at the rate of 1s, when GPS module has got its fix.
 
 
D4 is Netlight/Signal Led for the Modem. It has different behaviours depending on the state of Modem.
 
 
D3 is Status LED for the GPRS Modem. It gives the indication whether the GPRS Modem is on or not.
 
 
# '''What are the functions of the different Switches ?'''
 
 
'''Ans :''' S1 is ON/OFF push button switch for the Modem.
 
 
S2 is Hard Reset push Button switch for the Modem.
 
 
S3 is Reset push button switch for the GPS module.
 
 
S4 is 2 position DIP switch for specifying address for the EEPROM IC of cape on I2C2 bus of Beaglebone Black.
 
 
 
# '''How to use the audio from the Modem ? '''
 
 
'''Ans :''' Stereo audio/speaker and Mic ports are configured for the Modem. You need a surface mount type RJ9 4P4C connector to be mounted at P8 before a normal handset can be used.
 
 
Following part is recommended : '''Molex 95503-6451'''
 
 
 
# '''Which other capes are compatible with your cape ?'''
 
 
'''Ans :''' Please refer to '''this document''' for a current list of frequently queried compatibility of capes with our versions of cape. This list is constantly updated on query basis.
 
 
 
# '''Are there any extra Features on this cape ?'''
 
 
'''Ans:''' There is an Audio port available for use with the modem. The connector P8 needs to be mounted. (there is a four pin header P4 available outside of expansion header with UART2/I2C1 to possibly use with sensors or similar standalone applications ??)
 
 
 
# '''Are there any different functioning modes for the Modem ? Can it go to sleep when idle ? How to wake it up when its idle ?'''
 
 
'''Ans :''' There are different functioning modes for GPRS modem. Please refer to application note on device enable for 2G capes here.
 
 
# '''What is fanout of 1 PPS output signal ? Can it be reused other than from Beaglebone Black?'''
 
 
'''Ans :'''
 
 
 
# '''I used the USB cable to power on Beaglebone black with Cape on it, Beaglebone black did not boot properly, what is the issue?'''
 
 
'''Ans:''' USB cable alone cannot provide sufficient power(only500mA max) to drive the Beaglebone Black and Cape together , that is why it did not boot properly. Use a power adapter of 2.5A,5V rating to properly boot Beaglebone black with our cape.
 
 
 
# '''How to get in touch for an RMA ? What all information is required while applying for it ?'''
 
 
'''Ans :''' Please refer to our Warranty, Return and Support policy here . You can also contact our support for any queries regarding the same.
 
 
 
# '''How can I setup NTP server on beaglebone Black to use GPS data and PPS from GPS module of cape ?'''
 
 
'''Ans :''' Please refer to Application note for GPS Location and NTP Synchronization in Debian Wheezy or Angstrom.
 
 
 
# '''What is the meaning of data under different fields while querying NTP server information ?'''
 
 
'''Ans :''' Columns Defined:remote: peers speficified in the ntp.conf file<nowiki>* = current time source</nowiki><nowiki># = source selected, distance exceeds maximum value</nowiki>o = source selected, Pulse Per Second (PPS) used+ = source selected, included in final setx = source false ticker. = source selected from end of candidate list- = source discarded by cluster algorithmblank = source discarded high stratum, failed sanity
 
 
refid: remote source’s synchronization source
 
 
stratum: stratum level of the source
 
 
t: types availablel = local (such as a GPS, WWVB)u = unicast (most common)m = multicastb = broadcast- = netaddr
 
 
when: number of seconds passed since last response
 
 
poll: polling interval, in seconds, for source
 
 
reach: indicates success/failure to reach source, 377 all attempts successful
 
 
delay: indicates the roundtrip time, in milliseconds, to receive a reply
 
 
offset: indicates the time difference, in milliseconds, between the client server and source
 
 
disp/jitter: indicates the difference, in milliseconds, between two samples
 
 
 
# '''Can the firmware of the modules be upgraded? Will there be any updates?'''
 
 
'''Ans :''' Yes the firmware of the modules can be upgraded. But we have chosen not to keep that option open ended. If there is any issue with the firmware of the modules (modem or GPS), please contact our support.
 
  
'''Trying to update or debug the firmware of the modules will likely be grounds for ceasing any support from us under warranty period.'''
+
Please refer to [[SW_startup_guide_for_Vayu_GPS| Software startup Guide for VAYU GPS]]

Latest revision as of 03:03, 26 April 2019

For a quick guide to starting with the Vayu 2G cape's HW, see Leaflet for 2G cape.

Below, we describe how to set up the 2G capes and its associated software.

Software overview for using Vayu-2G-A/Vayu-2GP-A Cape

Data connection is established based on PPP protocols. Wvdial is mainly used to configure the dialup settings. For setting up various settings for PPP connection and establishing a data connection on these capes follow the link to the wiki

  • Way to setup the Vayu 2G Capes
  • How to read location and coarse time as NMEA-0183 message from the serial UART ttyO4 port
  • How to write wvdial conf files for any network
  • Sample wvdial.conf file for AT&T and T-Mobile USA

For using the Vayu-2G-A/Vayu-2GP-A Cape, please ensure that you have the following :

1. PPS drivers enabled in kernel, required if GPS module is present.

2. Vayu Device tree overlay file

You can either download kernel patches containing the same to use with your existing images or you can download our prebuilt MicroSD card image or EMMC flasher image.

All the images and files and extra support on software can be found here : Vayu_Cape_SW_images_and_drivers


Device enable for Vayu-2G-A/Vayu-2GP-A Cape

Setting up the system

1. Place a mini sim in the sim card slot and connect a GSM antenna to the SMA connector.

2. Mount the cape on BBB carefully.

3. Ensuring that the power jumper on the cape is in its place, power up the setup using a 5V DC adapter(min 2.5A) to barrel jack. D2 LED on the cape will glow alongwith LEDs on the Beaglebone black.

  • Note : Before proceeding further ensure D2 LED is glowing properly. Make sure that the adapter being used is of proper rating and has been connected properly. Further check for the presence of the power jumper(#12 on leaflet).
  • Note : Do not try to power up using USB cable alone. Always power up system with a DC adapter. Also while disconnecting power, USB cable should be removed before the DC adapter.

GSM/GPRS Modem

Note: All commands are executed as root on Debian unless otherwise mentioned.

GSM/GPRS Modem is connected to Beaglebone Black at UART1 port. To access the Modem from Beaglebone Black, we need to first enable the UART1 (ttyO1) port in kernel. For this do following :

Step 1. Boot into Beaglebone Black , running Debian Wheezy on it. Login as root user

Step 2. Go to /lib/firmware

cd /lib/firmware

Step 3. After ensuring that file BB-UART1-00A0.dtbo exists, apply the device tree overlay as :

echo BB-UART1 > /sys/devices/bone_capemgr.9/slots

On Debian 9.* use

echo BB-UART1 > /sys/devices/platform/bone_capemgr/slots

Step 4. On reading ‘’’slots’’’ if you are able to see UART1 , then it has been applied successfully.

cat /sys/devices/bone_capemgr.9/slots

On Debian 9.*. use

cat /sys/devices/platform/bone_capemgr/slots

Step 5. You can verify that UART1 (ttyO1 ) by checking for ttyO1 in devices (/dev/)

ls /dev/ttyO*

Output will show /dev/ttyO0 and /dev/ttyO1 .

Over UART1 port we can communicate with the modem and also AT commands can be executed whenever required. The UART port of modem is available at one instant only, either it is establishing ppp connection or AT commands are executed on it. We now see and understand different modes for controlling the GPS/GPRS Modem and ensure that it is properly powered on and available for establishing data connection.

The Modem has different operating modes.

SIM900A Power modes.png

To use the modem after powering up the Cape, it needs to be properly turned on.

For the Modem , there is a ON/OFF pin and a Reset pin which are used to turn the modem on/off or soft reset and hard reset it. Now, on the Vayu Cape, there are two Leds which indicate status of 2G module :

i. STATUS LED D3 : This Led gives the state of the Modem. It is on when the module is turned on and off when it is turned off.

ii. NETLIGHT LED D4 : It has different states depending on the mode of operation of the Modem :-

a. Off when Modem is off

b. 64ms ON/800ms OFF when Modem is on but it is not registered on a network i.e. sim card has not been detected or is not present

c. 64ms ON/3000ms OFF when Modem is on and is registered to a network i.e. sim card has been detected but a network connection has not been established.

d. 64ms ON/300ms OFF when Modem is on and GPRS communication has been established.


On the Cape, ON/OFF pin and Reset pin can be controlled via a push button switch as well as GPIOs assigned to them on Beaglebone Black. For ON/OFF pin, S1 is the ON/OFF push button switch provided on cape and GPIO45 in Beaglebone Black is assigned the same. GPIO45 should always be set high. For Reset pin, S2 is the Hard Reset push button switch provided on cape and GPIO60 in Beaglebone Black is assigned the same. GPIO60 should always be set high.

To Power on Modem :

User can Power on or off the modem by hardware push button or by software method (prefered)

  • pressing the switch S1 for atleast 1s and then releasing it after Beaglebone Black is booted properly
  • By setting GPIO45 ‘Active Low’ for atleast 1s and then setting it ‘Active high’.

Also, when Cape and Beaglebone black, both are powered up and booted, GPIO45 is initially set low internally.

Step 6: Set GPIO45 High, after Beaglebone Black has booted completely with Vayu Cape mounted on it to turn on the modem properly.

Step 7: Once ttyO1 port was enabled, you can execute AT commands for the modem on it or see the messages from the modem that are sent there. You can use minicom for it.

apt-get install minicom (This is there in the SW image)
minicom –s

and set serial port settings as /dev/ttyO1 115200 8N1 When you , properly turn on the modem after you have booted i.e. set GPIO45 high, or whenever modem is turned ON , you will see an output on /dev/ttyO1 port. RDY Power On of Modem is indicated by the STATUS GPIO or LED which should be ON . Also the NETLIGHT LED will start blinking depending on whether SIM Card is present or not.

To power off Modem :

Modem can be powered off by :

1. Normal power down procedure :

  • Power down by ON/OFF Pin :

 i. Press the switch S1 for atleast 1s and then release it

 ii. Set GPIO45 low for atleast 1s and set it high

  • Power down by AT command : AT+CPOWD=1 , at /dev/ttyO1

2. Abnormal Power down procedure :

  • Over-voltage or under-voltage automatic power down
  • over-temperature or under-temperature automatic power down

In Normal Power down, the modem port /dev/ttyO1 will read out the following message :

NORMAL POWER DOWN

In Abnormal Power down Procedure , AT commands cannot be issued anymore, only RTC is active.

Following URC will be reported :

If voltage <= 3.3V, UNDER-VOLTAGE WARNING

If voltage >= 4.7V, OVER-VOLTAGE WARNING

If voltage < 3.2V, UNDER-VOLTAGE POWERDOWN

If voltage > 4.8V, OVER-VOLTAGE POWERDOWN

If temperature > 80degree Celsius , +CMTE:1

If temperature < -30degree Celsius , +CMTE:-1

If temperature > +85degree Celsius, +CMTE:2

If temperature < -40degree Celsius, _CMTE:-2

Power down of Modem is indicated by STATUS LED not glowing or GPIO going low. Also, NETLIGHT LED will be Off.

Soft Reset the Modem :

1. Power Down the Module

2. Wait for atleast 800ms after STATUS LED switched off or GPIO went low

3. Power On the Module

Hard Reset the Modem:

This is an emergency reset only.Use this only when ON/OFF pin or “AT+CPOWD=1” have no effect.

1. The Hard reset pin can be pulled low for atleast 1.2s and then set high.

2. GPIO60 should be high all the time. S2 is Hard reset push button switch for Modem.

Note : The GPRS modem on the cape has been shipped pre-set with settings so that its serial port is working and appropriate settings has been stored in the modem. For more details about its operation modes refer to datasheet.

If SIM900A has been set to minimum functionality by “AT+CFUN=0”, the RF function and SIM card function will be closed. In this case, the serial port is still accessible, but all AT commands correlative with RF function or SIM card function will not be accessible. For SIM900A, it requests to set AT command “AT+CSCLK=1” to enable the sleep mode; the default value is 0, that can’t make the module enter sleep mode

To change the modes or any settings related to modem , you need access to AT ports and run AT commands there.

Considering that, Cape is connected properly to Beaglebone black and user is logged in as root and has checked for UART1 port, we check that the Modem is turned on properly before trying to establish a connection, so:

i. D3 is continuously glowing and D4 is blinking as 64ms ON/800ms OFF, when SIM card is not present or not detected/inserted properly.

ii. D3 is continuously glowing and D4 is blinking as 64ms ON/3000 ms OFF when a valid SIM card is present. If SIM card was inserted while the modem was on, please software reset the modem by turning it OFF and then ON again using Software GPIO commands or Push button switch. [refer to]

If any other state of LEDs is present, please soft reset the modem using push button switch or GPIOs.

So when it is established that modem is in ii  state , now we try to establish connection

Summarizing, following are the steps to enable PPP connection using the Modem :

Step 1 : Ensure that a GSM/GPRS enabled SIM card is placed in the simcard slot, before Beaglebone black is booted up with the cape.

Step 2 : Enable UART1(/dev/ttyO1 ) in the kernel by applying its device tree overlay from /lib/firmware directory.

Step 3: Check for the status of the LEDs, D3(STATUS) and D4(NETLIGHT). D3 should be high and D4 should be blinking. If no sim card is present, and D4 blinks accordingly, then insert the sim card in the slot and Soft Reset the Modem.

Step 4 : Now we have to ensure that the modem is properly switched on. The GPIO45 is pulled low in Beaglebone black when it has booted , but ON/OFF Pin in modem also has internal pullup so basically it is turned on when the Board boots up. But to be safe, we have to set the GPIO45 high.

When you turn GPIO45 high, check once again that setting the ON/OFF pin high, completed the Power ON cycle for the modem and not the Power OFF cycle, by checking the STATUS LED which should still be ON.

Step 5: Once it has been ensured modem is properly switched on, we can proceed with establishing PPP connection either using PPPd or Wvdial. For more details on using them, please refer to Application notes for 2G/2GP cape.

AT Commands Manual

All the AT commands can be executed on the serial port /dev/ttyO1 with baud rate of 115200 8N1.

FAQ

FAQ for this section click here

Software Images and Files

All the images and files and extra support on software can be found here : click here

Wvdial Configuration for Debian Wheezy :

Note : All commands are recommended to be executed as root user.

Download and install Wvdial

$ apt-get install wvdial

Executing the following command usually sets the wvdial.conf file which is used for dialing to GPRS communication, but since here our modem port is on a UART(/dev/ttyO1) and not on /dev/ttyS* or /dev/ttyUSB* ports, we will have to manually configure it.

$ wvdialconf

So, open the wvdial.conf file

$ nano /etc/wvdial.conf

Considering that, you have the USERNAME, PASSWORD and APN available for the service provider of the sim card being used, edit and make wvdial.conf file like this.

[Dialer Defaults]
Modem Type = Analog
ModemPhone = *99#
ISDN = 0
Baud = 115200
Username = USERNAME
Password = PASSWORD
Modem = /dev/ttyO1
Init1 = ATZ
Init2 = at+cgdcont=1,"ip","APN"
Stupid Mode = 1

Usually for GSM Networks, Modemphone is *99# or *99***1# After editing save and exit, now run wvdial for establishing communication.

$ wvdial

You can also edit the wvdial.conf file for multiple service providers by providing its name here [Dialer Defaults] :

[Dialer Vodafone]
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Baud = 115200
Username = 0
Password = 0
Modem = /dev/ttyO1
Init1 = ATZ
Init2 = at+cgdcont=1,"ip","www"
Stupid Mode = 1
[Dialer Airtel]
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Baud = 115200
Username = airtel
Password = airtel
Modem = /dev/ttyO1
Init1 = ATZ
Init2 = at+cgdcont=1,"ip","airtelgprs.com"
Stupid Mode = 1

And run wvdial for the required service provider as follows:

 wvdial airtel 

A list of running commands should be visible on the shell, trying to establish PPP connection. Once PPP connection has been established, you will see a ppp0 IP. To check the status of wvdial and find out its IP open a new shell and use either of following:

  • Run ifconfig and find ppp0 in the list of network connections.
$ ifconfig
or
$ ifconfig ppp0
  • Check the network statistics for IP and their gateways and check the Iface column for ppp0
$ netstat -arn
* Kernel IP routing table 

Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.7.0 0.0.0.0 255.255.255.252 U 0 0 0 usb0
192.200.1.21 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0

3. Read the system messages as

$ cat /var/log/messages

It lists all the attempts at establishing ppp communication using the modem and ips for the successful attempt. Now all that is left, is to route the network traffic over the gateway of ppp0 instead of eth0 so that GPRS communication is fully completed.

PPP connection has been established over GPRS using 2G module and wvdial.

After PPP has been established, the following is the status of the LEDs and GPIOs

1. STATUS LED D3 – It is continuously glowing, once the Modem was turned on.

2. SIGNAL LED D4 – It is now blinking at 64ms ON/300ms OFF . Earlier when PPP was not established but SIMcard was detected by modem, then it was blinking at 64ms ON/3000ms OFF.

3. STATUS GPIO23 – Its value is be 1, once modem was turned on.

4. ON/OFF GPIO45 – Its value should be 1.

5. RESET GPIO60 – Its value should always be 1.

You can alternately run wvdial for multiple service providers and store their wvdial.conf files too by this way also

$ wvdial -C /etc/wvdial.conf.provider_name

where wvdial.conf.provider_name is wvdial.conf for the SIM card currently inserted. Also, you can Wvdial in background to free up the shell instead of opening another new shell by :

$ wvdial & disown

FAQ

FAQ for this section click here


Sample Wvdial files for some service providers are given HERE

Using GPS module with Debian Wheezy

Please refer to Software startup Guide for VAYU GPS