[Q] External Wi-Fi USB adapter - Nexus 5 Q&A, Help & Troubleshooting

Hello, guys!
I got Nexus 5 running vanilla AOSP Android 4.4.3 compiled by myself. It works like a charm. I would like to use external Wi-Fi USB adapter with my Nexus 5. I've tried to use AWUS036NHA (with Atheros AR92721 chip) and two other models from different vendors. Every time I get the same error.
So, what have I done? I've rebuilt kernel to add support for my devices (in usual Linux way) and added firmwares they need to /vendor/firmware. When I plug AWUS036NHA into my phone I get the following (dmesg):
Code:
<6>[ 1587.856305] usb 1-1: new high-speed USB device number 2 using xhci-hcd
<6>[ 1587.887070] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271
<6>[ 1587.887129] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
<6>[ 1587.887221] usb 1-1: Product: UB91C
<6>[ 1587.887273] usb 1-1: Manufacturer: ATHEROS
<6>[ 1587.887365] usb 1-1: SerialNumber: 12345
<4>[ 1587.887857] usb 1-1: ep 0x1 - rounding interval to 32768 microframes, ep desc says 0 microframes
<4>[ 1587.888693] usb 1-1: ep 0x82 - rounding interval to 32768 microframes, ep desc says 0 microframes
<4>[ 1587.888968] usb 1-1: ep 0x5 - rounding interval to 32768 microframes, ep desc says 0 microframes
<4>[ 1587.889115] usb 1-1: ep 0x6 - rounding interval to 32768 microframes, ep desc says 0 microframes
<6>[ 1587.890044] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
<6>[ 1588.180755] usb 1-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272
<6>[ 1588.416902] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
<6>[ 1588.644279] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
<7>[ 1588.644345] ath: EEPROM regdomain: 0x833a
<7>[ 1588.644351] ath: EEPROM indicates we should expect a country code
<7>[ 1588.644360] ath: doing EEPROM country->regdmn map search
<7>[ 1588.644367] ath: country maps to regdmn code: 0x37
<7>[ 1588.644374] ath: Country alpha2 being used: GB
<7>[ 1588.644379] ath: Regpair used: 0x37
<6>[ 1588.648677] ieee80211 phy3: Atheros AR9271 Rev:1
<7>[ 1588.650804] Registered led device: ath9k_htc-phy3
It seems to me that everything here is ok. But when I try to switch on the adapter (ifconfig wlan1 up) I get an error (dmesg):
Code:
ADDRCONF(NETDEV_UP): wlan1: link is not ready
By the way, "ifconfig" command shows no error, but certainly it doesn't swith my device on.
So, I got the same error with 3 different adapters. I got no idea about possible ways of solving this problem.
Please, share your ideas, I'm really stuck Looking forward for your help. And thanks in advance!

Related

UrukDroid 1.5 and RNDIS dongles, ARCHOS 101 IT

Ave,
I just had sad attempt to plug dongle with RNDIS to Archos 101 (UrukDroid 1.5). The id for RNDIS "side" of dongle is idVendor=0525, idProduct=a4a2. Archos constantly connects/disconnects dongle and doesn't creates any network interface, while the other "side" of dongle (4G jfyi) lighted as connected. The dongle itself is functional - tested on Windows 7 and OS X 10.6.8 where it's recoginsed properly (RNDIS Ethernet).
Some dmesg dump
Code:
usb 2-1: new high speed USB device using musb_hdrc and address 8
usb 2-1: skipped 3 descriptors after interface
usb 2-1: default language 0x0409
usb 2-1: New USB device found, idVendor=0525, idProduct=a4a2
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: RNDIS/Ethernet Gadget
usb 2-1: Manufacturer: Linux 2.6.23-uc1/vincent7-udc
usb 2-1: uevent
usb 2-1: usb_probe_device
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: adding 2-1:1.0 (config #1, interface 0)
usb 2-1:1.0: uevent
usb 2-1: adding 2-1:1.1 (config #1, interface 1)
usb 2-1:1.1: uevent
drivers/usb/core/inode.c: creating file '008'
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1 enable change, status 00000503
musb_stage2_irq 801: unhandled DISCONNECT transition (a_wait_bcon)
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
usb 2-1: USB disconnect, address 8
usb 2-1: unregistering device
usb 2-1: usb_disable_device nuking all URBs
usb 2-1: unregistering interface 2-1:1.0
usb 2-1:1.0: uevent
usb 2-1: unregistering interface 2-1:1.1
usb 2-1:1.1: uevent
usb 2-1: uevent
hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
usb 2-1: new high speed USB device using musb_hdrc and address 9
usb 2-1: default language 0x0409
usb 2-1: New USB device found, idVendor=0525, idProduct=a4a5
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: File-backed Storage Gadget
usb 2-1: Manufacturer: Linux 2.6.23-uc1 with vincent7-udc
usb 2-1: SerialNumber: 3238204E6F76
usb 2-1: uevent
usb 2-1: usb_probe_device
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: adding 2-1:1.0 (config #1, interface 0)
usb 2-1:1.0: uevent
usb-storage 2-1:1.0: usb_probe_interface
usb-storage 2-1:1.0: usb_probe_interface - got id
devdb: devpath usb-musb_hdrc-1 not found
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 9
usb-storage: waiting for device to settle before scanning
drivers/usb/core/inode.c: creating file '009'
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1 enable change, status 00000503
scsi 3:0:0:0: Direct-Access Linux File-Stor Gadget 0300 PQ: 0 ANSI: 2
sd 3:0:0:0: [sda] 4096 512-byte hardware sectors: (2.09 MB/2.00 MiB)
sd 3:0:0:0: [sda] Write Protect is on
sd 3:0:0:0: [sda] Mode Sense: 0f 00 80 00
sd 3:0:0:0: [sda] Assuming drive cache: write through
sd 3:0:0:0: [sda] 4096 512-byte hardware sectors: (2.09 MB/2.00 MiB)
sd 3:0:0:0: [sda] Write Protect is on
sd 3:0:0:0: [sda] Mode Sense: 0f 00 80 00
sd 3:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 3:0:0:0: [sda] Attached SCSI removable disk
usb-storage: device scan complete
Configure McBSP for 1 phase
Configure McBSP TX FIFO threshold to 1260
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0100, change 0001, 12 Mb/s
usb 2-1: USB disconnect, address 9
usb 2-1: unregistering device
usb 2-1: usb_disable_device nuking all URBs
usb 2-1: unregistering interface 2-1:1.0
usb 2-1:1.0: uevent
usb 2-1: uevent
hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x100
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
usb 2-1: new high speed USB device using musb_hdrc and address 10
usb 2-1: default language 0x0409
usb 2-1: New USB device found, idVendor=0525, idProduct=a4a5
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: File-backed Storage Gadget
usb 2-1: Manufacturer: Linux 2.6.23-uc1 with vincent7-udc
usb 2-1: SerialNumber: 3238204E6F76
usb 2-1: uevent
usb 2-1: usb_probe_device
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: adding 2-1:1.0 (config #1, interface 0)
usb 2-1:1.0: uevent
usb-storage 2-1:1.0: usb_probe_interface
usb-storage 2-1:1.0: usb_probe_interface - got id
devdb: devpath usb-musb_hdrc-1 not found
scsi4 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 10
usb-storage: waiting for device to settle before scanning
drivers/usb/core/inode.c: creating file '010'
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1 enable change, status 00000503
FAT: Directory bread(block 32) failed
...
FAT: Directory bread(block 63) failed
scsi 3:0:0:0: rejecting I/O to dead device
musb_stage2_irq 801: unhandled DISCONNECT transition (a_wait_bcon)
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
usb 2-1: USB disconnect, address 10
usb 2-1: unregistering device
usb 2-1: usb_disable_device nuking all URBs
usb 2-1: unregistering interface 2-1:1.0
usb 2-1:1.0: uevent
usb 2-1: uevent
hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
usb 2-1: new high speed USB device using musb_hdrc and address 11
usb 2-1: skipped 4 descriptors after interface
usb 2-1: default language 0x0409
usb 2-1: New USB device found, idVendor=1076, idProduct=7708
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=10
usb 2-1: Product: RNDIS/Ethernet Gadget
usb 2-1: Manufacturer: Linux 2.6.23-uc1/vincent7-udc
usb 2-1: SerialNumber: 00000001
usb 2-1: uevent
usb 2-1: usb_probe_device
usb 2-1: configuration #2 chosen from 1 choice
usb 2-1: adding 2-1:2.0 (config #2, interface 0)
usb 2-1:2.0: uevent
usb 2-1: adding 2-1:2.1 (config #2, interface 1)
usb 2-1:2.1: uevent
drivers/usb/core/inode.c: creating file '011'
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1 enable change, status 00000503
Configure McBSP for 1 phase
Configure McBSP TX FIFO threshold to 1260
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0100, change 0001, 12 Mb/s
usb 2-1: USB disconnect, address 11
usb 2-1: unregistering device
usb 2-1: usb_disable_device nuking all URBs
usb 2-1: unregistering interface 2-1:2.0
usb 2-1:2.0: uevent
usb 2-1: unregistering interface 2-1:2.1
usb 2-1:2.1: uevent
usb 2-1: uevent
hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x100
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
usb 2-1: new high speed USB device using musb_hdrc and address 12
usb 2-1: skipped 3 descriptors after interface
usb 2-1: default language 0x0409
usb 2-1: New USB device found, idVendor=0525, idProduct=a4a2
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: RNDIS/Ethernet Gadget
usb 2-1: Manufacturer: Linux 2.6.23-uc1/vincent7-udc
usb 2-1: uevent
usb 2-1: usb_probe_device
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: adding 2-1:1.0 (config #1, interface 0)
usb 2-1:1.0: uevent
usb 2-1: adding 2-1:1.1 (config #1, interface 1)
usb 2-1:1.1: uevent
drivers/usb/core/inode.c: creating file '012'
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1 enable change, status 00000503
musb_stage2_irq 801: unhandled DISCONNECT transition (a_wait_bcon)
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
usb 2-1: USB disconnect, address 12
usb 2-1: unregistering device
usb 2-1: usb_disable_device nuking all URBs
usb 2-1: unregistering interface 2-1:1.0
usb 2-1:1.0: uevent
usb 2-1: unregistering interface 2-1:1.1
usb 2-1:1.1: uevent
usb 2-1: uevent
hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
usb 2-1: new high speed USB device using musb_hdrc and address 13
usb 2-1: default language 0x0409
usb 2-1: New USB device found, idVendor=0525, idProduct=a4a5
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: File-backed Storage Gadget
usb 2-1: Manufacturer: Linux 2.6.23-uc1 with vincent7-udc
usb 2-1: SerialNumber: 3238204E6F76
usb 2-1: uevent
usb 2-1: usb_probe_device
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: adding 2-1:1.0 (config #1, interface 0)
usb 2-1:1.0: uevent
usb-storage 2-1:1.0: usb_probe_interface
usb-storage 2-1:1.0: usb_probe_interface - got id
devdb: devpath usb-musb_hdrc-1 not found
scsi5 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 13
usb-storage: waiting for device to settle before scanning
drivers/usb/core/inode.c: creating file '013'
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 2-0:1.0: port 1 enable change, status 00000503
scsi 5:0:0:0: Direct-Access Linux File-Stor Gadget 0300 PQ: 0 ANSI: 2
sd 5:0:0:0: [sda] 4096 512-byte hardware sectors: (2.09 MB/2.00 MiB)
sd 5:0:0:0: [sda] Write Protect is on
sd 5:0:0:0: [sda] Mode Sense: 0f 00 80 00
sd 5:0:0:0: [sda] Assuming drive cache: write through
sd 5:0:0:0: [sda] 4096 512-byte hardware sectors: (2.09 MB/2.00 MiB)
sd 5:0:0:0: [sda] Write Protect is on
sd 5:0:0:0: [sda] Mode Sense: 0f 00 80 00
sd 5:0:0:0: [sda] Assuming drive cache: write through sda: sda1
sd 5:0:0:0: [sda] Attached SCSI removable disk
usb-storage: device scan complete
Interesting thing - UrukDroid reports some "File-backed Storage Gadget" and even mounts is for a short while than disconnects anyway. But on Win7 and OS X no storage mounted.

[Q] DVB-T dongle through OTG on eos 2

Just flashed eos 2 upgrading from a 4.0.3 nightly
(UK Wifi-Only XOOM with ClockWork)
I got a question for you: I tryied to attach a DVB-T dongle, through an OTG
cable, without any expectation.. in dmesg there are references to USB devices,
but all related to the USB hub:
Code:
[14033.728916] cpcap-otg cpcap-otg: SUSPEND --> HOST[14033.734381] tegra-ehci tegra-ehci.0: Tegra EHCI Host Controller
[14033.735207] tegra-ehci tegra-ehci.0: new USB bus registered, assigned bus number 2
[14033.814996] tegra-ehci tegra-ehci.0: irq 52, io mem 0xc5000000
[14033.837508] tegra-ehci tegra-ehci.0: USB 2.0 started, EHCI 1.00
[14033.837722] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[14033.837814] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[14033.837966] usb usb2: Product: Tegra EHCI Host Controller
[14033.838050] usb usb2: Manufacturer: Linux 2.6.39.4-Tiamat-3.0.15-gpuoc-00001-gde1b8c2 ehci_hcd
[14033.838202] usb usb2: SerialNumber: tegra-ehci.0
[14033.840005] hub 2-0:1.0: USB hub found
[14033.840108] hub 2-0:1.0: 1 port detected
There is no mention of the attached device, but it seems that the kernel
recognizes some USB activity. The cable is working (I tryied it with several
USB keys) and the DVB-T dongle too. Here's the dmesg log of a linux
machine (ubuntu) when I attach the device:
Code:
[ 58.029317] usb 1-1: new high-speed USB device number 2 using ehci_hcd
[ 58.807095] IR NEC protocol handler initialized
[ 58.908150] IR RC5(x) protocol handler initialized
[ 58.974855] dib0700: loaded with support for 21 different device-types
[ 58.983660] IR RC6 protocol handler initialized
[ 59.003086] dvb-usb: found a 'Compro Videomate U500' in warm state.
[ 59.003229] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 59.006471] DVB: registering new adapter (Compro Videomate U500)
[ 59.089976] IR JVC protocol handler initialized
[ 59.103600] IR Sony protocol handler initialized
[ 59.116159] IR MCE Keyboard/mouse protocol handler initialized
[ 59.141967] lirc_dev: IR Remote Control driver registered, major 250
[ 59.144610] IR LIRC bridge handler initialized
[ 59.658663] DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
[ 59.742154] MT2060: successfully identified (IF1 = 1220)
[ 60.688569] Registered IR keymap rc-dib0700-rc5
[ 60.689296] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:0b.0/usb1/1-1/rc/rc0/input6
[ 60.689778] rc0: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:0b.0/usb1/1-1/rc/rc0
[ 60.710720] dvb-usb: schedule remote query interval to 50 msecs.
[ 60.710725] dvb-usb: Compro Videomate U500 successfully initialized and connected.
[ 60.712443] usbcore: registered new interface driver dvb_usb_dib0700
I would like to recompile the proper driver for tiamat kernel 3.0.15,
if possibile, but is an OTG cable enough to support this device ?
thanks guys ! :-D
(maybe this is not the right thread, feel free to move my post !)

[Q] Official ICS - support for USB OTG?

Hi there,
I know that some of you were able to connect peripheral devices to their phones.
Has anyone of you tested this with the ICS stock kernel? When looking at /proc/config.gz it seems to me that all things neccessary for USB OTG are contained in the kernel.
Did you always use a special "OTG cable" or were you able to force the controller into host mode?
I'm playing with several USB hubs at the moment but I'm stuck.
Have a nice day,
Markus
You need Y-cable for getting the VBUS to both phone and hub.
Well, I removed a diode from my hub and put a label on it saying "do not connect to computer" .
Now, as soon as I connect my phone to the hub's upstream port, it starts charging. But still dmesg doesn't say anything about a switch to host mode .
Check ID pin value on the cable you're using. You're most likely using the standard A-to-microB cable, meant for device. You need A-to-microA, or just hack your cable and tie ID pin low in the microB plug, turning it into microA.
Now I made sure I'm using the right cable, but still it doesn't work.
This has to do with the stock kernel. If you look at "arch/arm/mach-msm/board-saga.c", line 3168, it says "USB_PERIPHERAL". If you change this to "USB_OTG" and compile it using the default config file, the kernel still won't recognize a OTG cable. But you can mount debugfs: "mount -t debugfs none /sys/kernel/debug" and look at "/sys/kernel/debug/msm_otg/mode". This file contains "none", if no cable is plugged in, or "peripheral" else. If you try to overwrite it with "echo host > mode", something happens according to dmesg:
[USB] msm_otg_mode_write: host
[USBH] msm_otg_sm_work: state:b_peripheral bit:0x00000002
[USB] OTG_STATE_B_PERIPHERAL state
[USBH] gadget off
[USB] OTG runtime idle
[USB] OTG runtime suspend
[USBH] msm_otg_suspend
[USBH] USB in low power mode
[USBH] msm_otg_sm_work: state:b_idle bit:0x00000002
[USB] OTG runtime resume
[USBH] msm_otg_resume
[USBH] USB exited from low power mode
[USB] OTG_STATE_B_IDLE state
[USBH] b_sess_vld
[USBH] gadget on
[USB] CI13XXX_CONTROLLER_RESET_EVENT received
[USBH] send connect type 0
[TP]cable change to 0
[TP]ts->status change to 0
[USB] suspend
[CABLE] usb_status_notifier_func: cable_type = 0
[CABLE] send_cable_connect_notify: cable_type = 0
Click to expand...
Click to collapse
It seems like something is immediately switching back to "peripheral", probably it's got to do with the "carkit driver":
[CABLE] phy_id_detect: usb ID pin = 0
config_saga_usb_id_gpios 145 output high
[USBH] carkit_phy_reset
[USBH] phy_reset: success
[USBH] ulpi: write 0x06 to 0x36
[USBH] ulpi: write 0x0c to 0x31
[USBH] ulpi: write 0x31 to 0x32
[USBH] ulpi: write 0x01 to 0x0d
[USBH] ulpi: write 0x01 to 0x10
[USBH] =============htc_get_accessory_state otgsc = 0x202e20
config_saga_usb_id_gpios 145 input none pull
[CABLE] phy_id_detect: type = 1
[CABLE] cradle inserted
[CABLE] cable_detect_handler ID pin 0, type 1
Click to expand...
Click to collapse
The file "drivers/usb/otg/msm_otg.c" has been adjusted by HTC and I'm afraid you'd have to revert these changes to make host mode work. Unfortunately, I don't think I have enough knowledge about this to do it myself. But probably this is interesting to some of you who are working on custom ICS kernels .
Hello,
Did you manage to make it work with ICS?
Thank you.
Well, no. And currently I've got neither the time nor the knowledge to I'm afraid. But it was possible in Android 2.3.5 by using a kernel hack. As far as I know amidabuddha is playing around with this, too, but wasn't successful yet as we were not able to get the source code of the modified kernel.
Finally, I did it! :victory: ... At least partially.
Code:
<6>[ 1117.578247] [USB] msm_otg_mode_write: host
<6>[ 1117.578735] [USBH] msm_otg_sm_work: state:b_peripheral bit:0x00000002
<6>[ 1117.579437] [USB] OTG_STATE_B_PERIPHERAL state
<6>[ 1117.579833] [USBH] send connect type 0
<6>[ 1117.580169] [TP]cable change to 0
<6>[ 1117.582244] [TP]ts->status change to 0
<7>[ 1117.582702] [USBH] gadget off
<6>[ 1117.583679] [USBH] msm_otg_sm_work: state:b_idle bit:0x00000002
<6>[ 1117.584350] [USB] OTG_STATE_B_IDLE state
<6>[ 1117.584716] [USBH] !id || id_a
<7>[ 1117.585083] [USBH] host on
<6>[ 1117.585754] msm_hsusb_host msm_hsusb_host.0: Qualcomm On-Chip EHCI Host Controller
<6>[ 1117.586242] msm_hsusb_host msm_hsusb_host.0: new USB bus registered, assigned bus number 1
<6>[ 1117.591003] [CABLE] usb_status_notifier_func: cable_type = 0
<7>[ 1117.591400] [CABLE] send_cable_connect_notify: cable_type = 0
<6>[ 1117.592071] [BATT] peripheral_cable_update(0) from_owe=0
<6>[ 1117.592468] [BATT] Update SMEM: cable type 0 at 1111762850068 (2013-01-13 14:46:15.556571647 UTC)
<6>[ 1117.606140] [BATT] ID=2, level=86, vol=4063, temp=256, batt_current=84, chg_src=0, chg_en=1, full_bat=1600000, over_vchg=0, smem_vbus=1 at 1111776216768 (2013-01-13 14:46:15.570213004 UTC)
<6>[ 1117.611083] msm_hsusb_host msm_hsusb_host.0: irq 60, io mem 0xa3600000
<6>[ 1117.630737] msm_hsusb_host msm_hsusb_host.0: USB 2.0 started, EHCI 1.00
<6>[ 1117.632110] hub 1-0:1.0: USB hub found
<6>[ 1117.632324] hub 1-0:1.0: 1 port detected
<6>[ 1117.950714] usb 1-1: new high speed USB device number 2 using msm_hsusb_host
<6>[ 1118.120849] hub 1-1:1.0: USB hub found
<6>[ 1118.121124] hub 1-1:1.0: 4 ports detected
<6>[ 1136.541107] usb 1-1.2: new low speed USB device number 3 using msm_hsusb_host
<6>[ 1136.701995] input: BTC USB Multimedia Keyboard as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input7
<6>[ 1136.705749] using input dev BTC USB Multimedia Keyboard for key reset
<6>[ 1136.706481] keychord: using input dev BTC USB Multimedia Keyboard for fevent
<6>[ 1136.707763] generic-usb 0003:046E:52CF.0001: input: USB HID v1.10 Keyboard [BTC USB Multimedia Keyboard] on usb-msm_hsusb_host.0-1.2/input0
<6>[ 1136.817230] input: BTC USB Multimedia Keyboard as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.2/1-1.2:1.1/input/input8
<6>[ 1136.825622] using input dev BTC USB Multimedia Keyboard for key reset
<6>[ 1136.825836] keychord: using input dev BTC USB Multimedia Keyboard for fevent
<6>[ 1136.835693] generic-usb 0003:046E:52CF.0002: input: USB HID v1.10 Device [BTC USB Multimedia Keyboard] on usb-msm_hsusb_host.0-1.2/input1
<6>[ 1161.881195] usb 1-1.3: new low speed USB device number 4 using msm_hsusb_host
<6>[ 1162.014099] input: Logitech USB-PS/2 Optical Mouse as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input9
<6>[ 1162.020507] generic-usb 0003:046D:C01E.0003: input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-msm_hsusb_host.0-1.3/input0
At the moment, you have to switch between peripheral mode and host mode manually, as I explained in my post above. When switching to host mode, the phone stops charging, so this isn't really OTG now.
Patching is much easier than we thought, as all necessary code already exists in the stock source code. HTC just seems to have "forgotten" one line...
I'll append a patch for HTC's ICS stock source code and the .config file I used.
Using the patch and the kernel config I appended OTG mode finally works as it should. The phone switches between peripheral mode and host mode automatically depending on the cable's ID pin and starts charging even when in host mode. It is possible now to connect usb hid devices as well as usb sticks, card readers and so on, I even tried remote triggering a Canon DSLR using "Remote Release".
The appended kernel config file is based on saga_defconfig, the only changes I made are those necessary for OTG. It should still be possible to connect the phone to a car kit or a desktop dock, although I can't test that.
Wow. I worked on this thing for three days and got it working a couple hours ago. And now I find out that you made the the same thing. I patched exactly the same lines. What a coincidence
So your phone starts charging in host mode, too? A few seconds after you plugged in the otg cable?
There's still something wrong I'm afraid:
Code:
<6>[ 1061.087646] [USBH] !id
<6>[ 1061.087738] [USBH] Avail curr from USB = 0
<6>[ 1061.284545] [BATT][tps65200] Set VDPM back to original V: regh 0x03=83
<7>[ 1063.090393] [K] __msm_rpc_read: prog = 0x30100000, procedure = 1, type = 0, xid = 18
<6>[ 1063.090698] [BATT] M2A_RPC: set_charging: 0 at 1057797432594 (2013-01-18 22:12:40.474011248 UTC)
<6>[ 1063.091400] [BATT][tps65200] Switch charger OFF
Although the LED lights up the charger is switched off. You can see that either in the kernel log or in Settings -> Power. There it says "discharging" for me.
There is not even ACA support for the "CI_45NM_INTEGRATED_PHY" as I expected in the first place, so I think we must find a way to force it into ac charging mode when the id pin is grounded. "drivers/usb/otg/msm_otg.c" should be the right place to start...
Hi guys.
I have pulled the request by astro757 and combined it with some more entries from the defconfig by engelmarkus that *could* eventually make the storage host operational. See here. There are some differences in your patches.
Has anyone of you tried that? I do not have a cable to test it and before release I would like to be sure that it is working. Credits will be given to you both of course.
Btw engelmarkus, I see you defconfig is from CM. Am I right?
amidabuddha said:
Has anyone of you tried that?
Click to expand...
Click to collapse
Well, I downloaded your repository and compiled it. HID devices do not work:
...
<3>[ 479.265350] generic-usb 0003:046E:52CF.0002: can't reset device, msm_hsusb_host.0-1.3/input1, status -71
<3>[ 479.272186] generic-usb 0003:046E:52CF.0001: can't reset device, msm_hsusb_host.0-1.3/input0, status -71
...
Click to expand...
Click to collapse
This sounds almost like https://bugzilla.novell.com/show_bug.cgi?id=734754 .
EDIT:
HID devices do work, but you have to plug them in before you power the hub. HID devices plugged in afterwards are not recognized at all. I think there was some change in the patches between 3.0.16 and 3.0.59 that is responsible for this weird behaviour.
amidabuddha said:
Btw engelmarkus, I see you defconfig is from CM. Am I right?
Click to expand...
Click to collapse
I got my saga_defconfig from "saga-ics-crc-3.0.16-62a67df" and made a few changes. I never looked into the CM sources.
Hey, I was wondering what you changed in msm_otg.c. I'm trying to do similar with a Nexus 4 right now, and have modified msm_otg.c for crude support with /sys/kernel/debug/msm_otg/mode (thanks CaptainMuon), but on unplug of the otg cable, mode gets locked to "none" until the device is rebooted. There's also no auto-switching between host and peripheral when an otg cable/device is inserted (externally powered y-cable).
Thanks for any help
Hi,
ziddey said:
Hey, I was wondering what you changed in msm_otg.c.
Click to expand...
Click to collapse
We didn't change this file at all.
Here you can see all the changes that were necessary: https://github.com/amidabuddha/saga-ics-crc-3.0.16/commit/8f04057be6eda67b40eb1bf3354294138f9c2d24
Markus

Problem with charging my phone

My phone doesnt charge when connected to a wall charger, but will charge when connected to anything else through USB. I have tried several different wall adapters and USB cables. Im currently charging my phone via my computer or Xbox 360. Can someone please help me solve this problem.
Did you try another wall charger?
Sent from my SGH-T959V using xda app-developers app
Yes I tried several
Which ROM and kernel? Will your wall charger successfully charge other devices?
Posted from my SGS4G, thanks to Team Acid development
Yes it does charge other devices
It would help to have some kernel messages when you are plugging and unplugging a "good" charger, as well as the one that fails. When you ahve a chance, would you:
Plug your phone into a known good charger
Wait half a minute
Unplug your phone from the charger
Run in a terminal window (*not* adb over USB) # dmesg > /sdcard/good-charger.dmesg
Plug your phone into the bad wall charger
Wait half a minute
Unplug your phone from the charger
Run in a terminal window # dmesg > /sdcard/bad-charger.dmesg
There shouldn't be any personal information in those files, but I'd check them first to make sure.
Once you have those two files, if you would upload them to pastebin or the like, then post the URLs here.
If you don't already have a terminal emulator, I like https://play.google.com/store/apps/details?id=jackpal.androidterm
Good charger - http://pastebin.com/wnJ6b7j3
Bad charger - http://pastebin.com/x7RiKEeX
What I am looking for:
The first battery-status line at boot. Everything up to here is "normal" booting, where you system is trying to figure out what kind of hardware you have, how to "hook it up" and starting up the basic things. This line gets emitted when the charger circuit gets connected to the kernel and starts running. The magic incantation is from drivers/power/s5pc110_battery.c
<4>[ 122.453341] [BAT] CHR(1) CAS(1) CHS(1) DCR(0) ACP(2) BAT(99,0,0) TE(36) HE(1) VO(4168) ED(40) RC(0) CC(869) VF(603) LO(0)
* CHR -- Charger state
* CAS -- Cable status; CABLE_TYPE_NONE - 0, CABLE_TYPE_USB - 1, CABLE_TYPE_AC - 2
* CHS -- Charging status
* DCR -- Discharge reason
* ACP -- "esafe" (haven't looked into this one)
* BAT -- Battery level
* TE -- Temp, in deg. C
* HE -- Health
* VO -- Voltage, mV
* ED -- "event dev state" /* Battery charging in using a Event which consume lots of current */
* RC -- is recharging
* CC -- charge current (really current into the phone/chip, not the battery charging current, from what I can tell)
* VF -- /* Battery VF ADC value */ (no guess yet without a better datasheet on the chip)
The signature of you plugging in a USB cable:
Code:
<6>[ 595.059133] android_usb gadget: USB udc 0,1 lock
<7>[ 595.059150] s5pv210_lock_dvfs_high_level : lock with token(7) level(9) current(0)
<4>[ 595.063011] [otg_clock_enable] clk_enable(otg_clock) OK.
<4>[ 595.326017] [BAT] cable maxim_USB_connect~~~
<6>[ 595.326070] [TSP] (set_tsp_for_ta_detect) state = [1]
<6>[ 595.326082] [TSP] (set_tsp_for_ta_detect_exec) state = [1]
<4>[ 595.330665] [BAT] cable maxim_USB_connect~~~
<4>[ 595.332227] [BAT] CHR(1) CAS(1) CHS(1) DCR(0) ACP(2) BAT(99,0,0) TE(36) HE(1) VO(4062) ED(0) RC(0) CC(767) VF(590) LO(0)
<6>[ 595.428568] android_usb gadget: high speed config #1: android
<4>[ 595.828263] [BAT] cable maxim_USB_connect~~~
This looks good -- CHR=1, charging; CAS=1, USB; CC=767, 767 mA going into your phone
The signature of you plugging in a charger:
Code:
<4>[ 2081.071285] [BAT] cable maxim_not USB,TA _connect~~~ value =[0x40]
<6>[ 2081.071306] [TSP] (set_tsp_for_ta_detect) state = [1]
<6>[ 2081.071318] [TSP] (set_tsp_for_ta_detect_exec) state = [1]
<4>[ 2081.075739] [BAT] cable maxim_TA_connect~~~
<4>[ 2081.077302] [BAT] CHR(1) CAS(2) CHS(1) DCR(0) ACP(2) BAT(95,0,0) TE(35) HE(1) VO(4021) ED(0) RC(0) CC(869) VF(589) LO(0)
<4>[ 2081.573131] [BAT] cable maxim_TA_connect~~~
<6>[ 2081.573156] [TSP] (set_tsp_for_ta_detect) state = [1]
<6>[ 2081.573168] [TSP] (set_tsp_for_ta_detect_exec) state = [1]
<6>[ 2088.027317] [TSP] (set_tsp_for_ta_detect) state = [0]
<6>[ 2088.027334] [TSP] (set_tsp_for_ta_detect_exec) state = [0]
<4>[ 2088.039044] [BAT] CHR(0) CAS(0) CHS(3) DCR(0) ACP(2) BAT(95,0,0) TE(35) HE(1) VO(4101) ED(0) RC(0) CC(869) VF(590) LO(0)
<6>[ 2088.528641] [TSP] (set_tsp_for_ta_detect) state = [0]
<6>[ 2088.528656] [TSP] (set_tsp_for_ta_detect_exec) state = [0]
<6>[ 2091.622419] fsa9480 7-0025: dev1: 0x40, dev2: 0x0
<4>[ 2091.928089] [BAT] cable maxim_TA_connect~~~
<6>[ 2091.928111] [TSP] (set_tsp_for_ta_detect) state = [1]
<6>[ 2091.928121] [TSP] (set_tsp_for_ta_detect_exec) state = [1]
<4>[ 2091.932629] [BAT] cable maxim_TA_connect~~~
<4>[ 2091.961592] [BAT] CHR(1) CAS(2) CHS(1) DCR(0) ACP(2) BAT(95,0,0) TE(35) HE(1) VO(3983) ED(0) RC(0) CC(869) VF(591) LO(0)
<4>[ 2092.432471] [BAT] cable maxim_TA_connect~~~
<6>[ 2092.432493] [TSP] (set_tsp_for_ta_detect) state = [1]
<6>[ 2092.432503] [TSP] (set_tsp_for_ta_detect_exec) state = [1]
<6>[ 2096.440595] fsa9480 7-0025: dev1: 0x0, dev2: 0x0
<6>[ 2096.955019] [TSP] (set_tsp_for_ta_detect) state = [0]
<6>[ 2096.955041] [TSP] (set_tsp_for_ta_detect_exec) state = [0]
<4>[ 2096.976554] [BAT] CHR(0) CAS(0) CHS(3) DCR(0) ACP(2) BAT(95,0,0) TE(35) HE(1) VO(3997) ED(0) RC(0) CC(869) VF(592) LO(0)
It looks like it starts to successfully charge, then is disconnected. It tries again, then disconnects again.
The phone is trying to draw up to 1000 mA from an AC charger. 869 mA is close, but I am thinking that the wall charger may not be able to supply enough current for the smart phone. On the charger's side, probably in nearly illegible writing, you should see something like "Output: 5V, 500 mA" or "Output: 5V, 1000 mA" or "Output: 5V, 1.0 A" -- the first is probably going to cause problems, the last two should be "strong enough."

[Q] Minix Neo x7 USB<->Serial adapter issue

Hello,
I have an issue I can't resolve by myself. I would like to use Prolific pl2303 usb<->serial adapter. I can't make it work. I see /dev/ttyUSB0 but it doesn't work as serial port. In dmesg I see:
<6>[ 1844.751839] usb 2-1.4.5: new full speed USB device number 10 using usb20_host
<6>[ 1844.853186] usb 2-1.4.5: New USB device found, idVendor=067b, idProduct=2303
<6>[ 1844.853292] usb 2-1.4.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>[ 1844.853395] usb 2-1.4.5: Product: USB-Serial Controller C
<6>[ 1844.853462] usb 2-1.4.5: Manufacturer: Prolific Technology Inc.
<6>[ 1844.855524] option 2-1.4.5:1.0: GSM modem (1-port) converter detected
<6>[ 1844.856420] usb 2-1.4.5: GSM modem (1-port) converter now attached to ttyUSB0
Obviously it should be handled by pl2303.ko, but it seems it's not so.
How to make pl2303.ko handle the device?
Thanx in advance.

Categories

Resources