The C Source, Patches and (shudder!) Bugs
Post Reply
bkerler
Posts: 2
Joined: 19 Feb 2014, 13:06

Patch for supporting Samsung Android USB Modem / here: SGS3

Post by bkerler » 19 Feb 2014, 13:29

Hi,

as I had severe issues getting the Samsung Android Modem (/dev/ttyACM0) on the Samsung Galaxy S3 GT-I9300 running, here is why :

Loading the device in linux, it normally defaults to configuration 0 or 1, which will
only support mtp configuration, but not cdc_acm support. This needs switching to configuration 2.

I tried with usb_modeswitch -v04e8 -p6860 -u2 which obviously failed saying that the default configuration is already selected, which confused me a bit. After debugging the source code, I was quickly able to detect what's wrong : the current configuration is detected as 2, although 0/1 is active in fact. I needed to patch the wrong configuration detection in order to enable switching, see attached file
patch.txt
Patch for usb_modeswitch.c
(1.1 KiB) Downloaded 1191 times
, to be patched against the version 2.1.0.

After that, the rest was easy :
first adding the following config to /etc/usb_modeswitch.d/04e8:6860 :

Code: Select all

DefaultVendor=  0x04e8
DefaultProduct= 0x6860

TargetVendor=   0x04e8
TargetProduct=  0x6860

Configuration=2

and adding the following line to /lib/udev/rules.d/40-usb_modeswitch.rules :

Code: Select all

# Samsung Android
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", RUN+="usb_modeswitch '%b/%k'"
After that, if not already running, do a modprobe cdc_acm and then plug the Samsung Android Device.

To test, use a terminal program of your choice, use as device /dev/ttyACM0 and send "AT+DEVCONFIG?", you should get some device information as answer. Kies protocol should then be also running fine as well.

Hope this will help all other as well struggeling with the modem.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Re: Patch for supporting Samsung Android USB Modem / here: S

Post by Josh » 21 Feb 2014, 13:52

Thanks for the suggestion!

Funny thing is that I'm working on a new release which has the whole configuration query replaced by "libusb_get_configuration". The old function is a left-over from the libusb0 dependency.

The new function is much better as it does not need to ask the device - the value is stored in the device structure already.

bkerler
Posts: 2
Joined: 19 Feb 2014, 13:06

Re: Patch for supporting Samsung Android USB Modem / here: S

Post by bkerler » 21 Feb 2014, 22:34

I will be happy to test, as I'm already actively using libusb1 :D

Post Reply