hello gods of herelink
I’ve compiled libusb and usb_modeswicth tools for arm air unit unfortunately /system is read-only and I dont find a way to install it correctly
I try to switch a e3372 modem into eth lan interface mode
I tryied to set all in the same folder but looks not working
Thank’s a lot ! I’ve seen air unit is SU capable but my main question is how to set libusb1.0.so correctly in lib folder (should be in /system/lib64/) is there any other folder where i can put shared lib ?? /data/app_lib or somewhere else ??
in fact my compiled app is working ok on remote unit as soon as I push it on air unit I got this error I think it’s because It could not find libusb in the right folder
OK I finally get it to work by setting the libusb at right place (/system/lib64/)
(still have the linker warning but it gets a bit more verbose )
as result I can get my HUAWEI 4G modem goes to Hlink mode and I well get the eth0 interface
# usb_modeswitch -v 12d1 -p 1f01 -c ./usb_modeswitch.conf
WARNING: linker: /system/bin/usb_modeswitch: unsupported flags DT_FLAGS_1=0x8000001
test
Look for target devices ...
No devices in target mode or class found
Look for default devices ...
product ID matched
Found devices in default mode (1)
Access device 002 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
with class 8
Use endpoints 0x01 (out) and 0x81 (in)
USB description data (for identification)
-------------------------
Manufacturer: HUAWEI_MOBILE
Product: HUAWEI_MOBILE
Serial No.: 0123456789ABCDEF
-------------------------
Using standard Huawei switching message
Looking for active driver ...
OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Read the response to message 1 (CSW) ...
Response reading failed (error -1)
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 12d1:14db
# ifconfig
lmi40 Link encap:UNSPEC
inet addr:192.168.0.10 P-t-P:192.168.0.10 Mask:255.255.255.0
inet6 addr: fe80::44f5:e09e:6ca8:d124/64 Scope: Link
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1550 Metric:1
RX packets:14971 errors:0 dropped:2 overruns:0 frame:0
TX packets:21528 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:834630 TX bytes:1237393
eth0 Link encap:Ethernet HWaddr 00:1e:10:1f:00:00
inet6 addr: fe80::21e:10ff:fe1f:0/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1048 TX bytes:160
vxlan1 Link encap:Ethernet HWaddr 46:18:60:e1:28:7e
inet6 addr: fe80::4418:60ff:fee1:287e/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:2888
br-vxlan Link encap:Ethernet HWaddr b8:8d:f1:ff:34:69
inet addr:192.168.144.10 Bcast:192.168.144.255 Mask:255.255.255.0
inet6 addr: fe80::ba8d:f1ff:feff:3469/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1048 TX bytes:760
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:116380 errors:0 dropped:0 overruns:0 frame:0
TX packets:116380 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:8196912 TX bytes:8196912
br-vxlan:0 Link encap:Ethernet HWaddr b8:8d:f1:ff:34:69
inet addr:192.168.42.10 Bcast:192.168.42.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
driver loading looks ok
status led on modem goes to solid on 4G network every thing looks ok
unfortunately I should get a IPv4 address from CGNAT but I dont … and ping throug eth0 is obviously not working
I think it’s due to default bridging of eth0 into br-vxlan interface config to work with usb to eth converter
is it possible to get rid of that ??
# ping 8.8.8.8
connect: Network is unreachable
# ping -I eth0 8.8.8.8
ping: Warning: source address might be selected on device other than eth0.
PING 8.8.8.8 (8.8.8.8) from 192.168.42.10 eth0: 56(84) bytes of data.
From 192.168.42.10: icmp_seq=1 Destination Host Unreachable
From 192.168.42.10: icmp_seq=2 Destination Host Unreachable
From 192.168.42.10: icmp_seq=3 Destination Host Unreachable
From 192.168.42.10: icmp_seq=4 Destination Host Unreachable
From 192.168.42.10: icmp_seq=5 Destination Host Unreachable
From 192.168.42.10: icmp_seq=6 Destination Host Unreachable
From 192.168.42.10: icmp_seq=7 Destination Host Unreachable
From 192.168.42.10: icmp_seq=8 Destination Host Unreachable
From 192.168.42.10: icmp_seq=9 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
10 packets transmitted, 0 received, +9 errors, 100% packet loss, time 9132ms
pipe 4
I can Have a eth0 not linked to br-vxlan but it start down and even iff I’m turning it up
I get no IPV4
and obviously I have no route passing by eth0
I’m still searching
thank’s for the help
# ping -I eth0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.8.102 eth0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=110 time=35.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=110 time=34.2 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=110 time=32.4 ms
thank’s a lot !!!
I finaly get it to work !!
so for those looking to do same
first : you need correctly libusb.so lib and usb-modswitch tool installed
you can get source and compile it from here https://github.com/joerg65/usb_modeswitch_Android
or simply get it from my previous message
connect your host directly to usb on air unit
authorize write on system partition adb shell "su 0 mount -o rw,remount /system"
then copy libusb.so and usb-modswitch to tmp folder adb push <path to your file on host>/libusb1.0.so /tmp/ adb push <path to your file on host>/usb-modeswitch /tmp/
moves them to correct folder under a shell adb shell
if you are using like me a HUAWEI 3372 4G modem you will need a conf file for usb-modeswitch tool
you can directly write string code it’s up to you ( google is your friend) but I prefer readable conf file
just put the following into a usb-modeswitch.conf file and then push it to tmp and moves it to /etc/ folder
adb shell (gets you into the gcs unit)
adb connect 192.168.0.10
adb -s 192.168.0.10:5555 shell
you will reach a shell on air unit
disable auto bridging of eth0 interface (thank’s a lot @Michael_Oborne I would have never find this one without you)
su
stop usbethx
check your modem is well registered on usb
# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 12d1:1f01
switch the modem into hilink mode (if you are using another modem you should probably use wwan0 mode and it’s a litel bit more confuse to get qmi working)
start dhcpd on eth0 : dhcpcd-6.8.2 eth0 (it will setup route for you)
check your fresh IPv4
check you can ping outside : ping -I eth0 8.8.8.8
I still need to setup a dns correctly if someone can help it looks iptable is empty and seems android dont care about resolve.conf
thank’s for all helps
to set a dns:
I’ve try to add a /syste/etc/resolv.conf
with nameserver 8.8.8.8 inside (I tested 8.8.4.4 and some others found around internet)
I’m still unable to ping 8.8.8.8
but www.google.com is still unknown host