Project

General

Profile

XMMProtocolInterfaces » History » Version 24

Denis 'GNUtoo' Carikli, 01/04/2021 11:31 PM

1 1 Denis 'GNUtoo' Carikli
h1. XMMProtocolInterfaces
2
3 5 Denis 'GNUtoo' Carikli
{{>toc}}
4
5 10 Denis 'GNUtoo' Carikli
h2. usb_sel
6 3 Denis 'GNUtoo' Carikli
7 21 Denis 'GNUtoo' Carikli
h3. HOWTO enable the modem usb interface
8 3 Denis 'GNUtoo' Carikli
9 21 Denis 'GNUtoo' Carikli
The modem also has an USB port that can be routed to the smartphone/tablet USB port.
10 1 Denis 'GNUtoo' Carikli
11 21 Denis 'GNUtoo' Carikli
To do that you first need to get a root shell in the device as the commands need to be executed as root.
12
13 10 Denis 'GNUtoo' Carikli
Once this is done you need to switch the USB connector to the modem USB. This can be done with the following command:
14 1 Denis 'GNUtoo' Carikli
<pre>
15 10 Denis 'GNUtoo' Carikli
echo MODEM > /sys/devices/virtual/sec/switch/usb_sel
16 1 Denis 'GNUtoo' Carikli
</pre>
17
18 10 Denis 'GNUtoo' Carikli
Then nothing will happen, you will still be able to login through adb.
19 1 Denis 'GNUtoo' Carikli
20 10 Denis 'GNUtoo' Carikli
To make the device switch to the modem USB you then need to unplug and replug the USB cable between your computer and the device.
21
22
At this point, if the modem was booted, you'll see a new USB device appearing.
23
Some serial ports will also appear.
24
25
Tested on Replicant 6.0 0004 RC3
26
27 22 Denis 'GNUtoo' Carikli
| Device   | Distribution           | Modem status | USB ids (lsusb from laptop)   | tty                          |
28 1 Denis 'GNUtoo' Carikli
| GT-I9100 | Replicant 6.0 0004 RC3 | Off          | None                          | N/A                          |
29
| GT-I9100 | Replicant 6.0 0004 RC3 | Booted       | 1519:0020 Comneon HSIC Device | /dev/ttyACM0 -> /dev/ttyACM6 |
30
| GT-I9300 | Replicant 6.0 0004 RC3 | Booted       | 1519:0020 Comneon HSIC Device | /dev/ttyACM0 -> /dev/ttyACM6 |
31 21 Denis 'GNUtoo' Carikli
32
When running lsusb on the SOC on the Replicant 11 kernel on a GT-I9300, we also see @1519:0020 Comneon HSIC Device@ once the modem is booted. Once powered on and before booting, the USB ids seen in lsusb with that kernel are these ones: @058b:0041 Infineon Technologies Flash Loader utility@ instead.
33
34
As the modem isn't visible either when not powered on, we need to look if it's possible to boot the modem from a laptop for instance.
35 10 Denis 'GNUtoo' Carikli
36 11 Denis 'GNUtoo' Carikli
h3. Protocols
37 12 Denis 'GNUtoo' Carikli
38 20 Denis 'GNUtoo' Carikli
|_. Device |_. State      |_. UART       |_. Protocol                                      |
39
| GT-I9100 | modem booted | /dev/ttyACM0 | AT: [[GTI9100ModemTTYACM0]]                     |
40
| GT-I9100 | modem booted | /dev/ttyACM1 | Compatible with xgoldmon                        |
41
| GT-I9300 | modem booted | /dev/ttyACM0 | AT: [[GTI9300ModemTTYACM0]]                     |
42
| GT-I9100 | modem booted | /dev/ttyACM1 | Xgoldmon waits for messages but nothing arrives |
43 3 Denis 'GNUtoo' Carikli
44 19 Denis 'GNUtoo' Carikli
h3. Xgoldmon
45 1 Denis 'GNUtoo' Carikli
46 23 Denis 'GNUtoo' Carikli
description: Xgoldmon is a software that can get some cellular protocol traces from some Samsung phones using the samsung-ipc protocol.
47
git: https://github.com/2b-as/xgoldmon.git
48
49 4 Denis 'GNUtoo' Carikli
Xgoldmon seem to display things on the GT-I9100:
50 1 Denis 'GNUtoo' Carikli
<pre>
51
# ./xgoldmon -vvvv -i localhost -t s2 -l /dev/ttyACM1
52
LOG:>>[HIGH]oembatt.c,310,[DISP] Thermistor : measured_value=1630666778<<
53
LOG:>>[HIGH]oembatt.c,137,[DISP] oem_set_batt_level : 4220<<
54 9 Denis 'GNUtoo' Carikli
LOG:>>[HIGH]oembatt.c,236,[DISP] BATT : measured_value_mv=4220, AvgBattVal_mv=4007, battery_level=5<<
55
LOG:>>[LOW]oemdisplay.c,363,no change -> rssi:4, bat:5<<
56
LOG:>>[HIGH]oembatt.c,310,[DISP] Thermistor : measured_value=1630666779<<
57
LOG:>>[HIGH]oembatt.c,137,[DISP] oem_set_batt_level : 4225<<
58
LOG:>>[HIGH]oembatt.c,236,[DISP] BATT : measured_value_mv=4225, AvgBattVal_mv=4026, battery_level=5<<
59
LOG:>>[LOW]oemdisplay.c,363,no change -> rssi:4, bat:5<<
60 1 Denis 'GNUtoo' Carikli
LOG:>>[HIGH]oembatt.c,310,[DISP] Thermistor : measured_value=1630666778<<
61
LOG:>>[HIGH]oembatt.c,137,[DISP] oem_set_batt_level : 4220<<
62
LOG:>>[HIGH]oembatt.c,236,[DISP] BATT : measured_value_mv=4220, AvgBattVal_mv=4055, battery_level=5<<
63
LOG:>>[LOW]oemdisplay.c,363,no change -> rssi:4, bat:5<<
64
</pre>
65
66
And when calling an (inexisting/invalid) number, the frames appear in Wireshark.
67 19 Denis 'GNUtoo' Carikli
68
However on the GT-I9300 it waits for messages that never arrive.
69
And on the GT-I9100 there seem to be very few messages.
70
71
So maybe AT+TRACE=1 enables tracing but doesn't set the tracing verbosity.
72 24 Denis 'GNUtoo' Carikli
73
h2. Links
74
75
* https://forum.xda-developers.com/t/info-r-d-i9300-uart-and-nvdata-guide.2928854/ Some GT-I9300 non-standard AT command documentation