Difference between revisions of "SW startup guide for VIBE"

From Yantrr Wiki
Jump to: navigation, search
Line 260: Line 260:
 
<pre>$ wvdial</pre>
 
<pre>$ wvdial</pre>
 
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.<br />  
 
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.<br />  
To check the status of wvdial and find out its IP open a new shell and use either of following:  
+
<li>To check the status of wvdial and find out its IP open a new shell and use either of following:</li>
 
:*Run ifconfig and find ppp0 in the list of network connections.
 
:*Run ifconfig and find ppp0 in the list of network connections.
  
Line 268: Line 268:
 
$ ifconfig ppp0
 
$ ifconfig ppp0
 
</pre>
 
</pre>
Check the network statistics for IP and their gateways and check the Iface column for ppp0
+
<li>Check the network statistics for IP and their gateways and check the Iface column for ppp0</li>
 
<pre>
 
<pre>
 
$ netstat -arn
 
$ netstat -arn
Line 278: Line 278:
 
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>
 
</pre>
Read the system messages as
+
<li>Read the system messages as</li>
 
<pre>
 
<pre>
 
$ cat /var/log/messages
 
$ cat /var/log/messages
Line 286: Line 286:
 
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.<br />  
 
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.<br />  
 
'''PPP connection has been established over GPRS using 2G/3G module and wvdial.'''
 
'''PPP connection has been established over GPRS using 2G/3G module and wvdial.'''
 
+
</ol>
 
===System Status===
 
===System Status===
 
After PPP has been established, the following is the status of the LEDs and GPIOs (For verification)  
 
After PPP has been established, the following is the status of the LEDs and GPIOs (For verification)  
Line 310: Line 310:
 
#echo BB-UART4 > /sys/devices/bone_capemgr.9/slots''
 
#echo BB-UART4 > /sys/devices/bone_capemgr.9/slots''
 
</pre>
 
</pre>
You can read the slots or use dmesg to see that UART4 has been enabled.
+
*You can read the slots or use dmesg to see that UART4 has been enabled.
 
<pre>#cat /sys/devices/bone_capemgr.9/slots''</pre>
 
<pre>#cat /sys/devices/bone_capemgr.9/slots''</pre>
 
   
 
   
Output will be like this :
+
*Output will be like this :
 
<pre>
 
<pre>
 
''0: 54:PF---''
 
''0: 54:PF---''
Line 336: Line 336:
 
#cat /dev/ttyO4''
 
#cat /dev/ttyO4''
 
</pre>
 
</pre>
For more information and detailed guide on Time synchronization and GPS Location , please refer to the App note -[[Configuring_for_GPS_Location_and_Time_Synchronization | GPS Location and time synchronization ]]
+
*For more information and detailed guide on Time synchronization and GPS Location , please refer to the App note -[[Configuring_for_GPS_Location_and_Time_Synchronization | GPS Location and time synchronization ]]

Revision as of 11:28, 8 July 2015

Below, we describe how to set up the VIBE and the associated software.

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 the VIBE follow the link to the wiki

  • Way to set up the VIBE
  • 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 VIBE-2G OR VIBE-2G-GPS/TIM OR VIBE-3G OR VIBE-3G-GPS/TIM, please ensure that you have the following :

  1. USB drivers for the modem (21f5:2012) installed in kernel. [for VIBE-3G & VIBE-3G-GPS/TIM]
  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: VIBE _SW_images_and_drivers [Link to VIBE Image ]

Hardware Configurations

Beaglebone section

  • Processor : VIBE uses Ti sitara ARM cortex-A8 AM3352 1 Ghz processor instead of AM3358 series in original beaglebone black. The basic difference is AM3352 does not have a SGX graphic card and also does not contain EtherCAT.
  • USB host ports : VIBE contains 2x USB 2.0 host ports, Type A connector whereas original Beaglebone black only had one. It also has a reconfigured USB port extended to powered hub to eliminate USB device power down issues. However there is no USB client port, so no option of SSH.
  • Battery : VIBE can be powered by any 3.7V Li-ion rechargeable battery which can power the whole board including the HDMI and both the USB host ports by the automatic backup switch over circuit.
  • Ethernet reset : VIBE includes a standalone ethernet reset circuit due to the bug on the ethernet port of original beaglebone black which sometimes resulted in not detection of the ethernet port on reset. The reset can be through GPIO3_21.
  • Under voltage lockout : VIBE contains a watchdog timer which can cause an external reset signal thus getting the board out of UVLO stage which was also a problem in original beaglebone black.
  • Extra UART0 header on the edge of the board for easy handling and convenience.

Modem section

  • 2G modem : The 2G modem is connected via UART and is on UART1 of the VIBE board. The modem can be turned on/off with the help of GPIO45. In order to turn on the modem, the GPIO45 should be high. The state of the modem can be seen with the help of D14 LED. D15 Led shows the network status. The antennae needed for the modem is GSM antennae with GSC connector on the side of the modem. The 2G modem enumerates two different ports ttyO0 and ttyO1. All the “AT command” set can be accessed on ttyO1 port with the baud rate of 115200.
  • 3G modem : The 3G modem is connected via USB1 host port. The modem can be turned on/off with the help of GPIO45. In order to turn on the modem, the GPIO45 should be high. It has an on board antennae and the GSC connector antennae can be attached to it. The 3G modem enumerates 3 different ports ttyUSB0 , ttyUSB1 and ttyUSB2. The “AT command” can be accessed on /dev/ttyUSB2 with the baud rate of 115200.
  • GPS modem : The state(on/off) of the GPS modem can be seen with the 3.3 V D17 Led and the D16 Led is the GPS fix Led. When the Module has acquired GPS fix, this LED D16 starts blinking at 1s OFF/1s ON. the 1 pps/Hz output can be accessed from GPIO0_27. GPIO50 is used for resetting the GPS modem and it should be pulled high all the time. GSC connector is available and the GPS antennae can be attached through it. The NMEA0183 Ver. 3.01 ASCII can be accessed on the ttyO4 port at a baud rate of 19200.


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. Ensuring that the power jumper on the VIBE is in its place, power up the setup using a 5V DC adapter(min 2.5A) to barrel jack.
  3. After powering the VIBE, log into it by any of the following option :
a. Through USB Client
b. Through Ethernet Cable
Now login by using the SSH command. Make sure to login as root only so that all the special privileges are available.
A. Through USB client.
Use the command :
ssh -l root 192.168.7.2
to login onto the system. Default password is root.
B. Through Ethernet cable.
The IP address of Ethernet interface of VIBE should be known for this option. Use that IP address with the ssh command to establish a connection
ssh -l root $IP_address
Default Username and password is root.
In Yantrr Precompiled images, IP address is 192.168.1.150
  1. After logging into the VIBE system, export and set the GPIO45 and GPIO60 high by using:
  2. 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.

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 TTYO ports on VIBE-2G

The 2G modem on VIBE-2G OR VIBE-2G-GPS/TIM board is connected via UART1.
VIBE-2G enumerate 2 different ports:

/dev/ttyO0  /dev/ttyO1

All the “AT Command” set can be accessed on ttyO1 port with the baud rate of 115200. 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.

Understanding the TTYUSB ports on VIBE-3G

The 3G modem on VIBE-3G OR VIBE-3G-GPS/TIM board is connected via USB1 host port.
VIBE-3G 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 -

  1. Power Off the Modem.
  2. Wait for 1-2s at least.
  3. 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 at least 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.

AT Commands Manual

The AT Command for the 3G Module can be downloaded from here : WCDMA AT Commands Manual

Data connection procedure using PPP

Notes

  • All commands are recommended to executed as root user.
  • UART1(dev/ttyO1) should be enabled in the kernel of VIBE-2G, VIBE-2G-GPS/TIM by applying its device tree overlay from /lib/firmware directory
  • USB drivers need to be installed in the kernel of VIBE-3G,VIBE-3G-GPS/TIM for the WCDMA modem to work.
  • Modem port for VIBE-3G is ttyUSB0, use this port for PPPd or Wvdial
  • AT Commands port for VIBE-3G is ttyUSB2

Wvdial Configuration for Debian Wheezy

  1. Download and install Wvdial
  2. apt-get install wvdial
  3. For VIBE-2G and VIBE-2G-GPS/TIM
  4. 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 files for some service providers are given HERE

    [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 any difficulties.

  5. For VIBE-3G and VIBE-3G-GPS/TIM
  6. 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 files for some service providers are given HERE

    [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
    

    Consult your network provider for exact details in case you are facing any difficulties.

  7. After editing wvdial.conf, save and exit, now run wvdial for establishing communication.
  8. $ 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.

  9. 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
    
  10. Check the network statistics for IP and their gateways and check the Iface column for ppp0
  11. $ 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
    
  12. Read the system messages as
  13. $ 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)

  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. ON/OFF GPIO45 – Its value should be 1.
  4. 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 name servers, and you are free to use any other if they do not work.

Using GPS module with Debian Wheezy

To read the NMEA messages from the GPS Module of VIBE :

  • 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''
  • 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''