Click here

From Yantrr Wiki
Jump to: navigation, search

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.

Instruction to run 2G & 3G cape on any linux distribution (Angstrom, Ubuntu etc)

Note these are the generic instructions and found to be working fine on the Angstrom distribution For GPS precise PPS timing, you need special instructions. Kindly mail support@yantrr.com for help. GPS PPS timing currently fully supported on Debian Wheezy.

Hardware Configurations

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.

Setup the 3G Cape

  • We know due to bug in usbhotplug, we recommend to connect a simple pendrive in the host port during the boot of the device
  • For Angstrom Distribution that comes from BBB support page, load the image and power on the module
  • Install the cape, make use USB is connected beaglebone black to the cape

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)
  • Now, attach usb cable between mini USB port (#16 on leaflet) of cape and host port of Beaglebone Black. Alternatively, if the USB host on cape is also populated,then the USB cable can be kept intact before Board was booted up.

Assign the driver to the USB port

  • 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 007: ID 21f5:2012
  • 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 007: ID 21f5:2012
  • System messages show what happened after applying modprobe usbserial
dmesg | grep -i usb
[  139.549532] usbcore: registered new interface driver usbserial
[  139.549615] usbcore: registered new interface driver usbserial_generic
[  139.549683] usbserial: USB Serial support registered for generic
[  139.549731] usbserial_generic 1-1.1:1.0: usb_probe_interface
[  139.549748] usbserial_generic 1-1.1:1.0: usb_probe_interface - got id
[  139.549777] usbserial_generic 1-1.1:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  139.549790] usbserial_generic 1-1.1:1.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  139.549800] usbserial_generic 1-1.1:1.0: generic converter detected
[  139.550195] usb 1-1.1: generic converter now attached to ttyUSB0
[  139.550314] usbserial_generic 1-1.1:1.1: usb_probe_interface
[  139.550329] usbserial_generic 1-1.1:1.1: usb_probe_interface - got id
[  139.550349] usbserial_generic 1-1.1:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  139.550361] usbserial_generic 1-1.1:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  139.550372] usbserial_generic 1-1.1:1.1: generic converter detected
[  139.555278] usb 1-1.1: generic converter now attached to ttyUSB1
[  139.555426] usbserial_generic 1-1.1:1.2: usb_probe_interface
[  139.555442] usbserial_generic 1-1.1:1.2: usb_probe_interface - got id
[  139.555467] usbserial_generic 1-1.1:1.2: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  139.555480] usbserial_generic 1-1.1:1.2: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  139.555491] usbserial_generic 1-1.1:1.2: generic converter detected
[  139.557244] usb 1-1.1: generic converter now attached to ttyUSB2


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 for Ethernet over usb on modem
  • ttyUSB1 is the diag port for the Firmware upgrate
  • ttyUSB2 is the AT CMD port, use this for the WVDIAL conf

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 "low" > direction
sleep 4
echo "high" > direction
sleep 4
echo "low" > direction

Soft Resetting the Modem

Steps -

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

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 or ttyUSB2, use this port for AT Commands

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