Thursday, August 30, 2012

Write/Read into Modem /dev

When modem connected there are 7 devices but only the lowest to send AT command (it is verified by ublox engineer)
$ ls /dev/ttyA*
/dev/ttyACM0 /dev/ttyACM1 /dev/ttyACM2 /dev/ttyACM3 /dev/ttyACM4 /dev/ttyACM5 /dev/ttyACM6
$lsusb
tovantran@Satellite:~/workspace/DevMem2/Debug$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 04f2:b008 Chicony Electronics Co., Ltd USB 2.0 Camera
Bus 001 Device 028: ID 1546:1102 U-Blox AG
Bus 002 Device 006: ID 03f0:8207 Hewlett-Packard FHA-3510 2.4GHz Wireless Optical Mobile Mouse

We can send only /dev/ttyACM0 to ttyACM1 just to be sure. Otherwise, a segment faults.

~/workspace/Debug$ dmesg | tail
[189730.256400] cdc_acm 1-2:1.4: This device cannot do calls on its own. It is not a modem.
[189730.256592] cdc_acm 1-2:1.4: ttyACM2: USB ACM device
[189730.258258] cdc_acm 1-2:1.6: This device cannot do calls on its own. It is not a modem.
[189730.258441] cdc_acm 1-2:1.6: ttyACM3: USB ACM device
[189730.260299] cdc_acm 1-2:1.8: This device cannot do calls on its own. It is not a modem.
[189730.260505] cdc_acm 1-2:1.8: ttyACM4: USB ACM device
[189730.262128] cdc_acm 1-2:1.10: This device cannot do calls on its own. It is not a modem.
[189730.262326] cdc_acm 1-2:1.10: ttyACM5: USB ACM device
[189730.264155] cdc_acm 1-2:1.12: This device cannot do calls on its own. It is not a modem.
[189730.264370] cdc_acm 1-2:1.12: ttyACM6: USB ACM device

[180001.228352] ublox[3986]: segfault at 0 ip b74a4090 sp bfd91eb0 error 4 in libc-2.15.so[b7440000+19f000]
[180099.905586] ublox[4010]: segfault at 0 ip b74d5090 sp bfb62880 error 4 in libc-2.15.so[b7471000+19f000]
[180398.947134] ublox[4108]: segfault at 0 ip b74e3090 sp bfc35a60 error 4 in libc-2.15.so[b747f000+19f000]
[180403.812155] ublox[4110]: segfault at 0 ip b74f4090 sp bfdcb780 error 4 in libc-2.15.so[b7490000+19f000]
[184633.997560] ublox1[5188]: segfault at 0 ip b753a028 sp bff8828c error 4 in libc-2.15.so[b74af000+19f000]
[184674.220633] ublox1[5239]: segfault at 0 ip b7593028 sp bfd1183c error 4 in libc-2.15.so[b7508000+19f000]
[184714.869225] ublox[5259]: segfault at 0 ip b7565028 sp bfa779ac error 4 in libc-2.15.so[b74da000+19f000]
[184732.112691] ublox[5271]: segfault at 0 ip b7596028 sp bf9cb81c error 4 in libc-2.15.so[b750b000+19f000]
[184754.141909] ublox[5283]: segfault at 0 ip b7582028 sp bfebe0ac error 4 in libc-2.15.so[b74f7000+19f000]
[184761.357642] ublox1[5294]: segfault at 0 ip b7515028 sp bfae886c error 4 in libc-2.15.so[b748a000+19f000]
[185460.303513] modem[5539]: segfault at 0 ip b766a090 sp bfe1e0e0 error 4 in libc-2.15.so[b7606000+19f000]
Before write to modem need to chmod  to read/write by everyone
tovantran@Satellite:~/Ctest$ sudo chmod 666 /dev/ttyACM0
[sudo] password for tovantran:
tovantran@Satellite:~/Ctest$ ./ublox1
opening modem
modem open
1, ./ublox1, AT
AT
OK
tovantran@Satellite:~/Ctest$

No comments:

Post a Comment