Difference between revisions of "SW startup guide for Vayu 3G"
(→Overview) |
(→Seting up the system) |
||
(21 intermediate revisions by 2 users not shown) | |||
Line 41: | Line 41: | ||
− | '''GPIO45 and GPIO60 should be set high at all instances for the GSM/WCDMA modem to be available for use.''' | + | ::*'''GPIO45 and GPIO60 should be set high at all instances for the GSM/WCDMA modem to be available for use.''' |
− | ''' USB drivers for the modem (21f5:2012, 21f5:2009) should be included in the kernel. We provide pre-compiled images with USB drivers included in the kernel. ''' | + | ::*''' USB drivers for the modem (21f5:2012, 21f5:2009) should be included in the kernel. We provide pre-compiled images with USB drivers included in the kernel. ''' |
= Getting started = | = Getting started = | ||
− | === | + | ===Setting up the system=== |
− | + | [[File:Sim.jpg|thumb|200px|right|Sim Card and Antennae]] | |
1. Place a mini sim in the sim card slot and connect a GSM antenna to the SMA connector. | 1. Place a mini sim in the sim card slot and connect a GSM antenna to the SMA connector. | ||
Line 59: | Line 59: | ||
5. 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. | 5. 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 : 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/0/06/Leaflet_for_Vayu_3GHP_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.''' | ::*'''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.''' | ||
+ | |||
+ | <!-- | ||
+ | |||
+ | [[File:Final.jpg|thumb|180px|right|Final connections]] | ||
+ | [[File:check.jpg|thumb|190px|left|Positions of all the parts on the cape]] | ||
+ | [[File:Usb.jpg|thumb|200px|center|USB connections]] | ||
+ | |||
+ | --> | ||
+ | {|style="background:white; border:0px solid dimgray;color:white" border="0" height="230" align="center" valign="bottom" cellpadding=20px cellspacing=5px width="auto" | ||
+ | |||
+ | <!--Start of the details for the top-of-table heading--> | ||
+ | |+style="background:white; color:black"|'''''Hardware setup''''' | ||
+ | |||
+ | <!--Start the first row and add row formats--> | ||
+ | |-align="center" | ||
+ | |||
+ | <!--Start of individual cell details for the first row--> | ||
+ | |[[Image:check.jpg|border|800x350px|none]] | ||
+ | |[[Image:Usb.jpg|border|500x350px|none]] | ||
+ | |[[Image:Final.jpg|border|500x350px|none]] | ||
+ | |||
+ | <!--Start of a second row and add formats--> | ||
+ | |-align="center" valign="top" | ||
+ | |||
+ | <!--Start of individual cell details for the second row--> | ||
+ | |style=" background:white; color:black" width="100"|'''USB ports and power jumper on the cape''' | ||
+ | |style=" background:white; color:black" width="100"|'''USB connections on cape and beaglebone black''' | ||
+ | |style=" background:white; color:black" width="100"|'''Final setup before login''' | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | [[File:Login method.jpg|thumb|right|upright=1.5|Ways to log into the cape]] | ||
After establishing that the power on the cape is proper, log in to the BBB plus cape setup using any of the following method : | After establishing that the power on the cape is proper, log in to the BBB plus cape setup using any of the following method : | ||
Line 68: | Line 102: | ||
''2. Through Ethernet cable.'' | ''2. Through Ethernet cable.'' | ||
+ | |||
+ | |||
+ | |||
Now login by using the SSH command. Make sure to login as root only so that all the special priviledges are available. | Now login by using the SSH command. Make sure to login as root only so that all the special priviledges are available. | ||
Line 104: | Line 141: | ||
::*'''NOTE : In precompiled image, for ease of use these regular commands for use with the GPIOs have been created as functions : ''pinexp, setout, setin, pinread.''''' | ::*'''NOTE : In precompiled image, for ease of use these regular commands for use with the GPIOs have been created as functions : ''pinexp, setout, setin, pinread.''''' | ||
+ | |||
+ | <pre> | ||
+ | pinexp 45 | ||
+ | pinexp 60 | ||
+ | setout 45 high | ||
+ | setout 60 high | ||
+ | </pre> | ||
===Power On Modem=== | ===Power On Modem=== | ||
Line 126: | Line 170: | ||
<pre> | <pre> | ||
lsusb | lsusb | ||
− | |||
Bus 001 Device 002: ID 0424:2412 Standard Microsystems Corp. | Bus 001 Device 002: ID 0424:2412 Standard Microsystems Corp. | ||
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
− | Bus 001 Device | + | Bus 001 Device 034: ID 21f5:2012 |
+ | Bus 001 Device 007: ID 046d:0825 Logitech, Inc. Webcam C270 | ||
</pre> | </pre> | ||
Line 137: | Line 181: | ||
modprobe usbserial vendor=0x21f5 product=0x2012 | modprobe usbserial vendor=0x21f5 product=0x2012 | ||
lsusb | lsusb | ||
− | |||
Bus 001 Device 002: ID 0424:2412 Standard Microsystems Corp. | Bus 001 Device 002: ID 0424:2412 Standard Microsystems Corp. | ||
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
− | Bus 001 Device | + | Bus 001 Device 034: ID 21f5:2012 |
+ | Bus 001 Device 007: ID 046d:0825 Logitech, Inc. Webcam C270 | ||
</pre> | </pre> | ||
::* ''System messages (logs) show what happened when modem was turned on and its drivers were assigned after applying modprobe usbserial. For pre-compiled image, log messages are similar.'' | ::* ''System messages (logs) show what happened when modem was turned on and its drivers were assigned after applying modprobe usbserial. For pre-compiled image, log messages are similar.'' | ||
Line 232: | Line 276: | ||
::*'''Note : Please use hard reset conservatively. Soft reset should be preferred under most conditions.''' | ::*'''Note : Please use hard reset conservatively. Soft reset should be preferred under most conditions.''' | ||
+ | |||
+ | ===VAYU 3GHx-D(ZTE Modem)=== | ||
+ | VAYU 3GHx-D capes have ZTE MG3732 modem. Their functionality is essentially the same with some minor changes. For more information on ZTE MG3732 modem and a quick reference guide [[ZTE_modem | click here]] | ||
===AT Commands Manual=== | ===AT Commands Manual=== | ||
− | The AT Command for the 3G Module can be downloaded from here : [ | + | The AT Command for the 3G Module can be downloaded from here: |
+ | * [[:File:Strongrising_WCDMA_Module_AT_Command.pdf | For -A, -B Modems]] | ||
+ | * [[:File:AT_Command_reference_guide_for_ZTEWelink_WCDMA_Modules_V2.5.pdf | For -D Modems]] | ||
===FAQ=== | ===FAQ=== | ||
Line 271: | Line 320: | ||
Modem = /dev/ttyUSB0 | Modem = /dev/ttyUSB0 | ||
Init1 = ATZ | Init1 = ATZ | ||
− | Init2 = at+cgdcont=1,"ip","APN" | + | Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 |
+ | Init3 = at+cgdcont=1,"ip","APN" | ||
Stupid Mode = 1 | Stupid Mode = 1 | ||
</pre> | </pre> |
Latest revision as of 00:59, 14 March 2017
For a quick guide to starting with the Vayu 3G cape's HW, see Leaflet for 3G cape.
Below, we describe how to set up the 3G capes and the associated software.
Contents
Overview
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-3G-A/Vayu-3GP-A Cape, please ensure that you have the following :
- USB drivers for the modem (21f5:2012) installed in kernel
- PPS drivers enabled in kernel, required if GPS module is present.
- 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 the Power on Modem section properly. An alternative easier approach is to keep the second host port on cape populated with a usb device.
Hardware Configurations
The 3G/WCDMA modem has following interfaces available on the Cape: Leaflet_3G modem
- Mini USB B Device port on Cape (P9): It has to be connected to USB host port on Beaglebone Black.
- SMA connector for GSM/WCDMA antenna(P7): Antenna is connected here.
- 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.
- 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.
- GPIO45 (ON/OFF PIN) : It is the GPIO connected to Power ON/OFF pin of GSM/WCDMA Modem.
- GPIO60 (Hard Reset Pin) : It is the GPIO connected to Reset pin of GSM/WCDMA Modem.
- S1 (ON/OFF switch) : This push button switch is connected to Power ON/OFF pin of GSM/WCDMA modem.
- 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.
- USB drivers for the modem (21f5:2012, 21f5:2009) should be included in the kernel. We provide pre-compiled images with USB drivers included in the kernel.
Getting started
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. Connect the extra usb cable provided with the cape between Host port on Beaglebone Black and miniUSB device port on Cape.
4. To avoid the bug on Beaglebone black with external USB hubs, please connect a USB device (pendrive etc) to extra host port on the cape.
5. 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.
USB ports and power jumper on the cape | USB connections on cape and beaglebone black | Final setup before login |
After establishing that the power on the cape is proper, log in to the BBB plus cape setup using any of the following method :
1. Through USB client.
2. Through Ethernet cable.
Now login by using the SSH command. Make sure to login as root only so that all the special priviledges are available.
1. Through USB client. Use the command :
ssh -l root 192.168.7.2
to login onto the system. Default password is root.
2. Through ethernet cable.
The ip address of the ethernet cable should be known. Use that with the ssh command to esatblish a connection :
ssh -l root $address
Default Username and password is root.
In Yantrr Precompiled images, IP address is 192.168.1.150
After logging into the BBB plus cape system, export and set the GPIO45 and GPIO60 high by using:
cd /sys/class/gpio/ echo 45 > export echo 60 > export cd gpio45 echo “high” > direction cd .. cd gpio60 echo “high” > direction
- NOTE : In precompiled image, for ease of use these regular commands for use with the GPIOs have been created as functions : pinexp, setout, setin, pinread.
pinexp 45 pinexp 60 setout 45 high setout 60 high
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.
cd /sys/class/gpio/ echo 45 > export cd gpio45 echo "high" > direction sleep 4 echo "low" > direction sleep 4 echo "high" > direction
- After some time, LED D4 should start blinking as to indicate modem has turned on. (Note : In some of 3G modules LED functionality is not enabled by the manufacturer, so the LED D4 might not blink)
- Note : In cases where a usb device was not connected to extra host port on cape, please connect the provided USB cable after turning on the modem.
- Check that modem is visible on the USB bus by:
lsusb Bus 001 Device 002: ID 0424:2412 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 034: ID 21f5:2012 Bus 001 Device 007: ID 046d:0825 Logitech, Inc. Webcam C270
- Assigning driver on the USB modem (Not needed if using pre-built images)
modprobe usbserial vendor=0x21f5 product=0x2012 lsusb Bus 001 Device 002: ID 0424:2412 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 034: ID 21f5:2012 Bus 001 Device 007: ID 046d:0825 Logitech, Inc. Webcam C270
- System messages (logs) show what happened when modem was turned on and its drivers were assigned after applying modprobe usbserial. For pre-compiled image, log messages are similar.
dmesg | grep -i usb usb 1-1.1: New USB device found, idVendor=21f5, idProduct=2012 usb 1-1.1: New USB device strings: Mfr=3, Product=2, SerialNumber=4 usb 1-1.1: Product: StrongRising Technologies usb 1-1.1: Manufacturer: Modem usb 1-1.1: SerialNumber: 000000000002 usb 1-1.1: usb_probe_device usb 1-1.1: configuration #1 chosen from 1 choice usb 1-1.1: adding 1-1.1:1.0 (config #1, interface 0) usbserial_generic 1-1.1:1.0: usb_probe_interface usbserial_generic 1-1.1:1.0: usb_probe_interface - got id usbserial_generic 1-1.1:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes. usbserial_generic 1-1.1:1.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver. usbserial_generic 1-1.1:1.0: generic converter detected usb 1-1.1: generic converter now attached to ttyUSB0 usb 1-1.1: adding 1-1.1:1.1 (config #1, interface 1) usbserial_generic 1-1.1:1.1: usb_probe_interface usbserial_generic 1-1.1:1.1: usb_probe_interface - got id usbserial_generic 1-1.1:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes. usbserial_generic 1-1.1:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver. usbserial_generic 1-1.1:1.1: generic converter detected usb 1-1.1: g'''eneric converter now attached to ttyUSB1''' usb 1-1.1: adding 1-1.1:1.2 (config #1, interface 2) usbserial_generic 1-1.1:1.2: usb_probe_interface usbserial_generic 1-1.1:1.2: usb_probe_interface - got id usbserial_generic 1-1.1:1.2: The "generic" usb-serial driver is only for testing and one-off prototypes. usbserial_generic 1-1.1:1.2: Tell linux-usb@vger.kernel.org to add your device to a proper driver. usbserial_generic 1-1.1:1.2: generic converter detected usb 1-1.1: '''generic converter now attached to ttyUSB2'''
- It is recommended to add a proper driver for the modem in kernel. The generic driver is not reliable.
- Note : If the modem is not visible after these steps or any issues are faced while initializing the modem please contact Yantrr Support (support@yantrr.com) with the above log messages (dmesg | grep –I usb or /var/log/syslog).
Understanding the TTYUSB ports on BBB capes
Vayu 3G cape enumerate 3 different usb ports
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2
- ttyUSB0 is data port & command for modem, use this for the WVDIAL conf or PPP
- ttyUSB1 is the diag port for the Firmware upgrade
- ttyUSB2 is the AT CMD port only.
- Note : These ttyUSB ports are only created if proper drivers are present or when “modprobe usbserial” command is issued. Pre compiled images with drivers are available on the Yantrr wiki page.
- Note : Both ttyUSB0 and ttyUSB2 take the AT commands, but ttyUSB0 port is also a Data communications port so for all intended purposes of issuing AT commands use ttyUSB2 port(PCUI port).
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.
cd /sys/class/gpio/ echo 45 > export cd gpio45 echo "high" > direction sleep 4 echo "low" > direction sleep 4 echo "high" > direction
Modem can also be turned off by issuing following AT commands on port /dev/ttyUSB2
AT+ZPWROFF
Soft Resetting the Modem
Steps -
- Power Off the Modem.
- Wait for 1-2s atleast.
- Power on the modem.
Hard resetting the modem
There might arise situations where modem does not seem to be responding to any commands issued on AT commands port or it cannot be turned on/off. In such scenarios, issue hard reset to the modem. It can be done by either toggling Switch S2 for atleast 100ms or pulling GPIO60 low for 1s and then setting it high again.
cd /sys/class/gpio/ cd gpio60 echo "low" > direction sleep 1 echo "high" > direction
- Note : Please use hard reset conservatively. Soft reset should be preferred under most conditions.
VAYU 3GHx-D(ZTE Modem)
VAYU 3GHx-D capes have ZTE MG3732 modem. Their functionality is essentially the same with some minor changes. For more information on ZTE MG3732 modem and a quick reference guide click here
AT Commands Manual
The AT Command for the 3G Module can be downloaded from here:
FAQ
FAQ for this section click here
Data connection procedure using PPP
Notes
- All commands are recommended to executed as root user.
- USB drivers need to be installed in the kernel for the WCDMA modem to work.
- Modem port for Vayu cape is ttyUSB0, use this port for PPPd or Wvdial
- AT Commands port for Vayu cape is ttyUSB2
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/ttyUSB0 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = 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.
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)
- STATUS LED D3 – It is continuously glowing, once the Modem was turned on.
- 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.
- ON/OFF GPIO45 – Its value should be 1.
- RESET GPIO60 – Its value should always be 1.
FAQ
FAQ for this section click here
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
FAQ
FAQ 1: Modem / TTYUSB of modem not detected
Solution 1. Remove the power cord from the board and reconnect it while the USB cable is not connected to the cape. Then you should follow the procedure to turn on the 3G module as follows
- set GPIO 45 to high in output mode
- Then after 3-4s , either press the switch S1 for 4s and then release it or instead of switch you can also recycle the value of GPIO 45 to low then high at intervals of 4s
- and now connect the USB cable.
** Always make sure GPIO 45 is in HIGH state ** cd /sys/class/gpio/ echo 45 > export cd gpio45 echo "high" > direction sleep 4 **Now enable the modem by toggling GPIO 45 *** echo "low" > direction sleep 4 echo "high" > direction sleep 4 ** To disable the Modem, again toggle GPIO45 ** echo "low" > direction sleep 4 echo "high" > direction sleep 4
- Solution 2. Due to hotplug issue in AM335x we can do a workaround, connect a usb device like a pendrive on second host port on cape and then just press the switch S1 for 4s after setting GPIO45 high.
This will most certainly work.
- Solution 3. This solution resets the usbcore of the AM335x and reinitialize it. This has been identified as a last resort workaround, NOTE, this will reset all peripheral on that USB CORE
If the Device is disconnecting as soon as you try to establish connection even when you are sure that 3G module is on, then following should be followed : reset the USB1
echo 0 > /sys/bus/usb/devices/usb1/bConfigurationValue echo 1 > /sys/bus/usb/devices/usb1/bConfigurationValue