SW startup guide for Vayu 3G

From Yantrr Wiki
Revision as of 19:14, 11 March 2014 by Priyank (Talk | contribs) (Software overview for using Vayu-3G-A/Vayu-3GP-A Cape)

Jump to: navigation, search

Software overview for using Vayu-3G-A/Vayu-3GP-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 3g 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 the precise timing and setting up


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

  1. USB drivers for the modem (21f5:2012) installed in kernel
  2. PPS drivers enabled in kernel, required if GPS module is present.
  3. 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


Note : On most beaglebones, there is a known bug with USB hotplug for using USB HUB with Beaglebone black host port. So to efficiently be able to use the modem, follow our documentations for HW guide on it properly. An alternative easier approach is to keep the second host port on cape populated with a usb device.

Device enable for Vayu-3G-A or 3GP-A Cape

The 3G/WCDMA modem has following interfaces available on the Cape:

  1. Mini USB B Device port on Cape (P9): It has to be connected to USB host port on Beaglebone Black.
  2. SMA connector for GSM/WCDMA antenna(P7): Antenna is connected here.
  3. LED D2 (5V Power LED of Cape) : This LED indicates that the Cape is powered on with 5V and GSM/WCDMA modem is also powered.
  4. LED D4 (SIGNAL LED) : This LED is the SIGNAL LED for the GSM/WCDMA modem whose various blinking states denote the different states of the WCDMA Modem.
  5. GPIO45 (ON/OFF PIN) : It is the GPIO connected to Power ON/OFF pin of GSM/WCDMA Modem.
  6. GPIO60 (Hard Reset Pin) : It is the GPIO connected to Reset pin of GSM/WCDMA Modem.
  7. S1 (ON/OFF switch) : This push button switch is connected to Power ON/OFF pin of GSM/WCDMA modem.
  8. S2 (RESET switch) : This push button switch is connected to Hard Reset pin of GSM/WCDMA modem.


GPIO45 and GPIO60 should be set high at all instances for the GSM/WCDMA modem to be available for use.

Power On Modem

The Modem can be powered on by providing a low level pulse at ON/OFF Pin for 3-4s when the module is off. It can be achieved by either using the push button switch S1 or GPIO45.

Power Off Modem

The modem can be powered off by providing a low level pulse at ON/OFF pin for 3-4s when the module is On. It can be achieved by either using the push button switch S1 or GPIO45.

Soft Resetting the Modem

Steps -

  1. Power Off the Modem.
  2. Wait for 1-2s atleast.
  3. Power on the modem

Configuration for Debian Wheezy :

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

Note : USB drivers need to be installed in the kernel for the WCDMA modem to work.

Wvdial Configuration for Debian Wheezy :

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.

So, open the wvdial.conf file

$ nano /etc/wvdial.conf

Assuming 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#. Consult your network provider for exact details in case you are facing difficulties. After editing, save and exit, now run wvdial for establishing communication.

$ wvdial

If all parameters are correct and everything is working, you should see a success message from wvdial. 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
  • 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.

For that, download and run this script

$ chmod +x 0000routefix
$ ./0000routefix

Now on Ip table should look like this:

$ 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/3G module and wvdial.

System Status

After PPP has been established, the following is the status of the LEDs and GPIOs (For verification)

  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.


Adding a DNS

nano /etc/resolv.conf add following

nameserver 8.8.8.8
nameserver 208.67.222.222

These are public nameservers, and you are free to use any other if they do not work.

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