SW startup guide for Vayu 3G

From Yantrr Wiki
Revision as of 21:29, 11 March 2014 by Admin (Talk | contribs) (Overview for using Vayu-3G-A/Vayu-3GP-A Cape)

Jump to: navigation, search

Overview

Data connection is established based on PPP protocols. Here, we have provided instructions for wvdial, but you can use any other dialup software supported in debian.

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 is properly configured.

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. Sample wvdial.conf file for AT&T and T-Mobile USA

[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

Please refer to Software startup Guide for VAYU GPS