title: Talking to modem with AT commands on android
body: <p>I'm trying to talk to samsung galaxy s2 plus and huawei p1 xl (u9200) modem sending AT commands, but can't get any result. I'm sending commands using adb shell and view logs with logcat.</p>
  
  <p>In samsung when i execute cat <code>/proc/tty/drivers</code> i get the following:</p>
  
  <pre><code>/dev/tty             /dev/tty        5       0 system:/dev/tty
  /dev/console         /dev/console    5       1 system:console
  /dev/ptmx            /dev/ptmx       5       2 system
  /dev/vc/0            /dev/vc/0       4       0 system:vtmaster
  
  rfcomm               /dev/rfcomm   216 0-255 serial
  g_serial             /dev/ttyGS    237 0-3 serial
  serial               /dev/ttyS       4 64-67 serial
  pty_slave            /dev/pts      136 0-1048575 pty:slave
  pty_master           /dev/ptm      128 0-1048575 pty:master
  unknown              /dev/tty        4 1-63 console
  </code></pre>
  
  <p>Looks like i should send commands to <code>/dev/ttyGS0</code>,  but it doesn't reply. I've tried the following commands:</p>
  
  <pre><code>echo "AT\r" &gt; /dev/ttyGS0
  echo "ATD12345678900;\r" &gt; /dev/ttyGS0
  </code></pre>
  
  <p>but nothing happens. Actually, i'm not sure that i have to send commands to this file, but others don't reply too.
  I've read <a href="http://forum.xda-developers.com/showthread.php?t=1471241" rel="nofollow">article</a> on XDA-developers, but it didn't help.</p>
  
  <p>With Huawei i know which file i should use, but i can't make data call. I can make regular voice call, but i can't execute <code>AT+CSNS=4</code>. Just doesn't work. Also i have LG P765, which is based on a similar chipset and on LG i can make data call. Can anyone tell me what should i do?</p>
  
  <p>All devices are rooted.</p>