Related
I have successfully used reverse USB tethering on a flipout. This method should be portable to other devices running the motorola android multi-device driver with usb0.
If you are comparing to any windows drivers, say that installed from the driver installer MSI when connecting a flipout and maybe other devices in 'portal' mode, the (windows) driver will be motousbnet. On linux, the driver is cdc_subset. However, this driver does not know how to bind to the motorola
1. Figure out the usb vendor id, product id, and interface class, interface subclass, and interface protocol of the networking interface. On the flipout, this is named the 'motorola networking interface'. On my device, it has these ids: 0x22b8, 0x41da, 0x02, 0x0a, 0x01. You can find these ids via exploring /sys/bus/usb on a linux system, or with the lsusb utility.
2. patch your cdc_subset driver to support the USB id and interface of the above device. You will need to inspect via lsusb or sysfs to setup a 'product' and 'driver info' structure in cdc_subset.c to select the correct interface and endpoints. The pertinent parts of my cdc_subset.c are as follows:
Code:
add to products
{
// Moto flipout usb
USB_DEVICE_AND_INTERFACE_INFO (0x22b8, 0x41da, 0x02, 0x0a, 0x01),
.driver_info = (unsigned long) &motousb_info,
},
add near other driver_infos:
static const struct driver_info motousb_info = {
.description = "Motorola USB endpoint",
.check_connect = always_connected,
.in=0x84, .out=0x03,
};
3. Doing such a mod and compiling yourself a new cdc_subset.ko, and installing that, will yield a usb driver that can talk to usb0 on your flipout. At this point, you just have to configure networking. I setup proxyarp on my LAN and usb0 interfaces, and set up some manual addresses and routes. Other options could be to add usb0 to a bridge, or do routing and DHCP, or routing + nat + DHCP. You'll probably need to netcfg rmnet0 down and setprop net.dns1 and net.rmnet0.dns1 your ips manually. Make sure you save your old dns. I'm not sure if that gets restored from carrier when you turn rmnet back on.
4. after all that, you should be online.
5. EDIT: all compiling and module installation steps noted above happen on the host PC, if that wasn't clear.
Work to follow:
use SL4A to automate usb0 bringup
interface with APNDroid to soft-down the 3g instead of nuking it the hard way. killing the radio process will get you back online, but thats effectively the same as resetting the baseband, so you'll need to re-unlock your SIM etc.
Thanks man! This is awesome. It worked on my Motorola Defy (same parameters) under Ubunutu.
Hi,
I thing this is what i am looking for, enable a motorola device (defy) to be a usb0 device with ubuntu so you can have an IP, and ssh easly with your droid (using vlc remote with usb cable). I realy appreciate this native feature with my old htc.
where is the cdc_subset.c ?
tkx
balek said:
Hi,
I thing this is what i am looking for, enable a motorola device (defy) to be a usb0 device with ubuntu so you can have an IP, and ssh easly with your droid (using vlc remote with usb cable). I realy appreciate this native feature with my old htc.
where is the cdc_subset.c ?
tkx
Click to expand...
Click to collapse
It's in the kernel source. -- You'll have to download the linux or kernel source package that matches the kernel you run on your ubuntu machine, modify your cdc_subset driver, rebuild it, and install it.
Learning things like the kernel build system and how to install a kernel module are exercises for the reader.
Good job! I'll try it once i get my Ubuntu installation up and running again ^_^
Defy and Debian USB network works partially...
Hello. The idea was good...
My config is:
- on one side: a Defy (CM7 1.0-RC1 Nightly build 2037, Gingerbread 2.3.4)
- on the other side: a Linux Debian (Squeeze , kernel 3.0.0-1-686-pae)
I patched the cdc_subset driver as proposed. I saw a little difference on the endpoints: lsusb -v reports 0x83 for 'in' endpoint and 0x2 (bulk) or 0x3 (interrupt) for 'out' endpoint. I tried all combinations and only 0x83/0x2 give a working ping between hosts. => Are the initial endpoints working (0x84/0x3) ?
See attached file for the complete listing, search 'SDX' to see where I patched.
When I plug the USB cable, the usb0 interface is brought up on linux automatically and that's perfect.
With a simple network configuration, ping works on both hosts.
.
So everything seems right.
I then tried to transfer a huge 100MB file to see the performance:
- scp from linux to defy => OK, ~5MB/s
- scp from defy to linux => FAILURE after a few MB transfered
In the second test, the connection is completely frozen and I see errors on both interfaces (ifconfig usb0, error packets). I repeated the test multiple times with alternate network configs, without wifi etc., and I could never transfer the file completely.
Can someone confirm me:
- that the transfer is working for him in both ways with huge files
- what is reported by "lsusb -v -d 22b8:41da" to see if my endpoints for a Defy are correct
I'm not sure, but maybe cdc_subset is not the right driver to patch ?
Or simply it's a bug in scp or sshd on Defy ! I should try with something else like ftp or http...
I keep working on this topic...Thx for any clue !
sdxmob said:
Hello. The idea was good...
My config is:
- on one side: a Defy (CM7 1.0-RC1 Nightly build 2037, Gingerbread 2.3.4)
- on the other side: a Linux Debian (Squeeze , kernel 3.0.0-1-686-pae)
I patched the cdc_subset driver as proposed. I saw a little difference on the endpoints: lsusb -v reports 0x83 for 'in' endpoint and 0x2 (bulk) or 0x3 (interrupt) for 'out' endpoint. I tried all combinations and only 0x83/0x2 give a working ping between hosts. => Are the initial endpoints working (0x84/0x3) ?
See attached file for the complete listing, search 'SDX' to see where I patched.
When I plug the USB cable, the usb0 interface is brought up on linux automatically and that's perfect.
With a simple network configuration, ping works on both hosts.
.
So everything seems right.
I then tried to transfer a huge 100MB file to see the performance:
- scp from linux to defy => OK, ~5MB/s
- scp from defy to linux => FAILURE after a few MB transfered
In the second test, the connection is completely frozen and I see errors on both interfaces (ifconfig usb0, error packets). I repeated the test multiple times with alternate network configs, without wifi etc., and I could never transfer the file completely.
Can someone confirm me:
- that the transfer is working for him in both ways with huge files
- what is reported by "lsusb -v -d 22b8:41da" to see if my endpoints for a Defy are correct
I'm not sure, but maybe cdc_subset is not the right driver to patch ?
Or simply it's a bug in scp or sshd on Defy ! I should try with something else like ftp or http...
I keep working on this topic...Thx for any clue !
Click to expand...
Click to collapse
Any news with defy ?
I have successfully installed the PL2303 module as outlined in this thread:
http://forum.xda-developers.com/showthread.php?t=1058713
But am now at a loss...what now? On my laptop, PuTTY / TeraTerm / SecureCRT all have an option for serial connections but so far, I haven not found one for Android. I have tried PocketCloud and Connectbot so far, but neither give an option for serial / com port / whatever (on my tablet, my Tripp-Lite U209-000-R USB to DB9 serial adapter appears to be ttyUSB0).
My question is how to I use the USB to serial adapter? Is there an app that will permit me to select this device? For instance, Connectbot allows a choice of SSH, Telnet, or local (this being a local terminal connection) but requires that I supply [email protected] but not [email protected] (or something). Ideas?
Thanks
I was to B&N today, read few books in store (on nook)
Came home, tried to connect:
adb unable to connect...
run dropbear - unable to ssh
rebooted nook via terminal
adb unable to connect...
Scratched head…
rebooted nook again via terminal
adb unable to connect...
Did basic adb troubleshooting:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb unable to connect...
stop adbd
adbd &
adb unable to connect...
netstat
showed listening (with adbd running)
127.0.0.1:5037
0.0.0.0:5555
rebooted nook via terminal
rebooted PC…
adb unable to connect...
put noogie SD, reboot, check uRamdisk – same size & timestamp
removed noogie, off/on - connected right away!
I’m puzzled…
I saw few times, after 2-3 days of reading adb is unable to connect, but reboot fixed it always.
What was different this time?
“Cold reboot”?
I spend like 30min and feel like an idiot right now…
I was unable to connect over the usb port as well. Without too long investigation I've used adbwireless app on NT and was able to connect.
You might want to refresh server
adb kill-server
adb start-server
then connect using your NT ip address:5555 and you should be done.
In my case, I think, there are too many conflicting drivers installed and NT is not being recognized when connected.
Good luck
Adapt0r said:
I was unable to connect over the usb port as well. Without too long investigation I've used adbwireless app on NT and was able to connect.
You might want to refresh server
adb kill-server
adb start-server
then connect using your NT ip address:5555 and you should be done.
In my case, I think, there are too many conflicting drivers installed and NT is not being recognized when connected.
Good luck
Click to expand...
Click to collapse
I did it as well before every adb connect, thought it not worth to mention.
Naturally, "rebooting PC" should reboot adb server too, right?
But it didn't help either...
If you see this issue again, just try toggling ADB Wireless On/Off and it should reset anything on the devices side. Also I've noticed that sometimes and completely random from what I can tell "USB Debugging" will get unchecked, which will mess with ADB access via USB.
Disabling/Enabling ADBwireless sometimes may help.
Maybe a stupid question: Do you have a firewall running on your pc?
digiflash said:
Disabling/Enabling ADBwireless sometimes may help.
Click to expand...
Click to collapse
won't it be the same as below or it does more?
Code:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
digiflash said:
Maybe a stupid question: Do you have a firewall running on your pc?
Click to expand...
Click to collapse
Always
I did check it too. It was nothing worth to mention.
abd attempted to connect - got nothing back (timeout)
on NST adbd was listening, I was able to access gmail.
I can ssh neither, and dropbear was listening too.
Looks, in fact, like firewall on NST was blocking all incoming connection.
That's why I wrote "Scratched head…" - which means I checked pretty much everything.
Could somebody explain, what is the major difference for NST between:
reboot (hot reboot) & shutdown/start (cold reboot)
Or more precisely for the latter:
insert noogie SD/reboot/remove noogie SD/turn off/turn on
ApokrifX said:
insert noogie SD/reboot/remove noogie SD/turn off/turn on
Click to expand...
Click to collapse
Cannot connect today at all. Cold reboot doesn’t help anymore...
Did some more tests (including ADBwireless):
I cannot ping [nook IP] from my computer
I can ping [nook IP] from router.
From PC
>telnet [nook IP] 5555
Connecting To [nook IP]...Could not open connection to the host, on port 5555: Connect failed
From router:
telnet [nook IP] 5555
Connection didn’t timeout (i.e. it does connect!)
Again, looks like something on Nook blocking connections from all IP, except from default gateway (i.e. router)
Question: Does rooting process unblock connections from other IPs?
About Disabling/Enabling ADBwireless:
Before running ADBwireless
netstat
127.0.0.1:5037
0.0.0.0:5555
netstat -tapn doesn’t work
stop adbd
both above disappear from netstat
start adbd
both show up
run ADBwireless
get message: ADBwireless is off
pushed button, message changed to: adb connect [nook IP]:5555
(adb connct didn’t work)
Switch to terminal,
netstat
127.0.0.1:5037
I.e. no more: 0.0.0.0:5555
Subsequent "stop adbd"/"start adbd" changes nothing:
netstat
127.0.0.1:5037
I was wondering what ADBwireless supposed to do then?
Could somebody check from his nook what netstat shows, please?
Nook can connect to internet (gmail, market) + netstat shows all outgoing connections…
What else can I try?
I guess, I can switch to adb usb…
It might be helpful if you tell what OS you are running on your PC and what did you do with NT. If we can reproduce your case then we can troubleshoot it otherwise you will hear useless guesses and speculations.
I like NT as a reader and nothing else. Web and games are looking awful on it.
Adapt0r said:
It might be helpful if you tell what OS you are running on your PC and what did you do with NT. If we can reproduce your case then we can troubleshoot it otherwise you will hear useless guesses and speculations.
I like NT as a reader and nothing else. Web and games are looking awful on it.
Click to expand...
Click to collapse
One box is XP with Outpost firewall (abd set to full trust).
Another win7 (FW policy – allow outgoing connections + few exceptions).
I’m Win developer/admin and Linux(CentOs) admin.
I’m complete noob when it comes to Linux non-shell related programming.
Router runs DD-WRT.
As of now I switched to uRamdisk_1_1_rooted_usb.
When I run dropbear, I see it listening on 22, but cannot ssh still.
That’s all I guess…
Could you do one test for me please?
If your NST runs uRamdisk_1_1_rooted_wifi:
Could you ping you NST from you box
If not - could you do same from your router/AP?
1. I don't have uRamdisk_1_1_rooted_wifi on my NT and can't test it.
2. adbWireless works on my Win 7 and Mac the same way. Both comps have firewalls running and both are on the same network. I can connect and ping NT.
Just for clarification I will describe how it works on my setup:
- I start adbWireless on NT,
- it asks for root permission if it for the first time and I grant it
- then shows fat button on the screen and says adbWireless is off
- I push the button
- it says adbWireless is on, from your computer run
adb connect 192.168.15.112:5555
At this point I can ping IP address and run adb shell.
I've rooted NT for purposes of software testing and customization. I did it twice with older and newer Nooter and did not find any noticeable differences.
Let me know if you want some other tests or info.
Adapt0r said:
I can connect and ping NT.
…
At this point I can ping IP address and run adb shell.
Click to expand...
Click to collapse
To clarify (trying to get a setup as simple as possible):
We connected NST to our home wireless network and it gets IP.
We didn’t touch adbWireless yet!
Now do two tests, please:
1. From NST we ping gateway or "another device on same network", (providing it let us).
2. From "another device on same network", ping NST.
What do you get?
I thought, adbWireless just configure adbd for IP connection (as opposite for USB one) and starts it - nothing else.
If #1 works, but not #2,
and #2 starts working after you “hit adbWireless button”, than adbWireless does more then I wrote above…
Sorry, I didn't have time to do your test at home. I'll try today.
I think you are correct, adbWireless does configuration of connection by executing something like this:
Turning On:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
Turning Off wifi and start listening on usb
setprop service.adb.tcp.port -1
stop adbd
start adbd
Cheers!
Edit:
Ping NST_ip_address from PC works fine.
Since I don't have terminal installed I could not test reverse pinging.
Ouch…
Just figured out:
1: I press “big red button” in adbWireless.
2: I push back button
And it pushed adbWireless into background.
If it’s the same as turning it (adbWireless) off,
it’s possible, that adbWireless reset adbd service to use USB.
Thus there is nothing listening on 5555 when I run netstat in terminal on NST.
Who’s with me?
Should be east to test:
press “big red button” in adbWireless.
I push back button
try to connect
ApokrifX said:
Ouch…
Click to expand...
Click to collapse
Updated router firmware - I can ping nook and ADB over wireless works too.
Not sure thought, if it was wireless channel problem.
I've read somewhere, some NST firmwares doesn't work on high channels or certain combined modes - like works on A+B, but not A+G
Apparently, NST firmware 1.1.2 was targeted to solve some of these issues.
PROBLEM SOLVED.
I didn't have the proper folder for the adb.exe.
-----
I have a similar problem: I recently rooted my nook simple touch with touchnooter 2.1.31, and all seems well but I can't connect to the adb wireless. IP is 192.168.0.6:5555 according to adb; I can ping from my Win XP computer if I use 192.168.0.6, but not if I add the 5555, but I just can't connect to the ereader. Wireless connections seem fine otherwise. I've tried shutting off and one the wireless adb.
I'm a complete beginner in this. On the reader, the screen has this:
"from your computer run: adb connect 192.168.0.6:5555"
This suggests that I can't simply use a firefox browser to connect? I tried using the windows cmd box, but windows indicates it doesn't know what 'adb' is. Then I found a website about adbwireless: http://theunlockr.com/2011/04/12/how-to-connect-to-your-android-device-through-adb-wirelessly/
and installed Adroid SDK Tools as indicated. When I use the cmd window, go to the proper sdk tools subfolder, and type 'adb connect 192.168.0.6:5555', windows still insists it doesn't recognize 'adb'
Please help!
try adb.exe
Meter 13,
Thanks for the reply. I added a pre-script to my op. I had created a bat file to move to the proper folder but had realized that the adb.exe had been moved to the platform-tools subfolder from its old location in the tools folder. Once I realized this, all worked well - connected to my nook, and used adb to install an apk file.
Bob
Just a note:
Ping isn't the usual TCP/UDP stuff, so there are no (port) numbers on the end.
ping 192.168.1.27
ADB uses TCP and a port number but it usually defaults to 5555
adb connect 192.168.1.27
adb connect 192.168.1.27:5555
You can also telnet to check if you can connect to the nook via TCP and port 5555
telnet 192.168.1.27 5555
(Note: If this works it will tell you that you are connected, but you can't do anything because ADB is a binary protocol.)
I had the same problem, turns out the correct drivers weren't installed. Ive downloaded HTC sync from HTC.com. I installed it and removed HTC sync afterwards. The drivers should stay there. Now reconnect your phone and try "adb devices" Before ADB wouldn't recognize my device but now it does. Tried to "adb backup -all" again, and it worked instantly.
Maybe this solves the problem?
You could try going back to a stock /boot partition.
I run my nstg rooted with the addition of about 8 files (su, xbin, busybox in system, adb wireless in /data plus a launcher) when I first root.
with the nstg, at least, I don't actually need the modified kernels - adb connects from my computers to the nstg, I simply don't have a root shell when I first connect.
This is fixed by doing an
su
once I'm in
Might be worth trying a restore of just partion 1 from your backup?
Hi everybody,
Like video said, I'm noob !
I come from french and surely I'm not the better englishman of france, but I need you and I try to resolv my problem :=)
I have iconia a500, and go with it in holidays.
In my room, only RJ45 for internet, not WiFi... And my lady NEED internet ^^
That's why I try to use this device.
But, when I try to use it... It doesn't works :=/
I've seen that with taboonay it can works but it's rom for 3.2 and I am in 4.03...
Here my configuraiton :
CWM-based Recovery v5.5.0.X(thor2002rorev1.7)
Flexreaper 5.1
I use Trendnet TUE2-ET100 for network adaptator.
Have we one rom who can help me plz ?
I wait your help if it's possible.
Thank you.
Hi,
Nobody can help me ?
It would be probably better to just buy simplest access point out there and use it as a bridge between ethernet cable and wifi . You don't even need router functionality if the tablet will be the only device used. Just buy AP, configure it and just connect the cable to the RJ45 socket and voila.
You will probably need to connect AP to the PC with a cable to configure it but you need to do this only once. You need to configure the wifi name and security (preferably WPA2 PSK).
Hi,
Thank you for you answer !
Can we resolv problem without AP ?
The reason it's that we go to hotel and I bagage is full... xD
With USB analyser software (or application), I can see one information about my LAN adaptator... But it doesn't works when I try to use it.
I don't know if one other kernel can help me or if it's with other custom ROM...
Thank you very much for your help and your solution !
But if we have other possibility it's ok for moi :=)
Merci ;=)
Try the following:
Reboot the tablet (do not connect ethernet adapter yet)
In the terminal emulator display run dmesg (you can dump it with dmesg > /sdcard/dmesg1.txt for comparison)
Connect adapter
Run dmesg again and check for differences at the end (dump it with dmesg > /sdcard/dmesg2.txt and then compare both files).
This will tell if the kernel itself is recognizing the device properly as a networking device. If it doesn't then you need different kernel or kernel module for the current one for this device.
If the device is recognized and the proper kernel module is loaded and still no connectivity then one of the following can be true:
The device doesn't send request to acquire IP from DHCP (dhcp client in the rom not configured to support other devices than the built-in ones).
The device receives the IP, but the routing is not being set so the connection is not set as a default route.
The Android itself doesn't recognize the new interface and apps cannot start the connection using Android API (OS thinks it is offline).
Unfortunatelly I don't know much about how the networking on the application level works in Android and I don't have any USB ethernet adapter to do some tesing myself. I would need to ask some friends if they have one.
Very thanks to your help and sorry for this.
Below results dmesg after plug usb adapter.
Usb 1-1: new high speed usb device number 2 using tegra-ehci
Usb...: new usb device found, idVendor=0b95, idProduct=2,
Usb... : new usb device strings: mfr=1, product=2, serialnumber=3
Usb... : product: ax88772
Usb... : manufacturer: asix elec. Corp.
Usb... : seriaonumber xxxxxx
We can see that android see usb device.
But, when i made <ifconfig>, i can see only the wlan0 interface, no eth0 or other...
Maybe i have to mount it ?
Thanks for your help.
No, you don't mount network devices .
It seems that the tablet is not loading any kernel module for this device. I've done some searching and this device requires usbnet and asix modules to be loaded. I have checked if I have those module in my a500 (running CM9) and I don't have any of them.
I think that you would need to build your own kernel with proper modules to gain support for this adapter.
OMG xD
Build my own kernel
ok ok, let's go, I have already help my father to build house, I can did it !
...
Is it difficult to build kernel ? ^^
Are there any tutoriel for this ? or I need help of xda's members ?
Like other post, thank you for your interest and your help.
Sorry to make you spend time on my case
I'm sorry but my knowledge about compiling kernels is limited to PC Linux. I've never crosscompiled kernels for ARM architecture. It shouldn't be that hard. I think that you will need the Android SDK to do that. Search the dev forum.
I've been thinking about the module itself and you probably don't even need to compile whole kernel. You just need the kernel header files for the kernel you are using and you can probably compile the module alone and then just copy it to device. But you need to ask someone that is more knowledgable in this area than me.
hello, have you managed to build module for ICS or jellybean?
i have the same USB LAN adapter (i'm french too ^^)
Hope to have a positive reply!!!
thanks
s5 ethernet question
If i were to buy an ethernet adapter would, wired ethernet work with this phone? i cant find anything online about the s5
dhk1267 said:
If i were to buy an ethernet adapter would, wired ethernet work with this phone? i cant find anything online about the s5
Click to expand...
Click to collapse
YES, some USB->LAN adapters made by ASIX (for example ASIX AX88772B) are working if you have a kernel with an ASIX kernel module (for example boeffla kernel + boeffla config v2 app in order to enable the module).
If you can access/ping websites only by internet IP-addresses but not domain-name you need dnsproxy2. I guess this is not needed anymore with a recent boeffla kernel.
Further requirements:
- Android 4.4.4 (Cyanogenmod 11) or lower (CM 12 or 12.1 does not work, see comment below)
- Ethernet-2.XX.apk in order to switch between wlan0 and eth0
- xposed framework for the following xposed modules:
- HACK CONNECTIVITY SERVICE 1.4 or Fake Wifi Connection xposed framework module if you have an app that insists of an wlan0 interface
good luck and success!
COMMENT relating to ethernet incompatibility of CM12 and CM12.1
Until CM11 (Android 4.4.4) I could use my eth0 interface as normal user for everything.
BUT since CM12 I have the following problem:
BUG/missing permissions? eth0 (USB->LAN) interface only usable as root user in terminal since CM12
When I try to ping my router ping 192.168.1.1 or any internet IP I get a android connect network is unreachable.
The only IP-adrress I can ping as normal user is my own IP-adress of the eth0 interface (for expample 192.168.1.XX).
After login as root with the su command in the terminal I can ping the router IP and every internet IP.
Even disabling the iptables filters/firewall did not help.
When I switch to the wlan0 interface I can ping everything with my normal user and the internet connection is available for every app.
Just wanted to bump this thread to see if anyone else knows of a way doing this withOUT going to CM11 or lower?
I'd really like to stay on lollipop.
Alternatively, do we think an AOSP Marshmallow ROM with boeffla's kernel might also do the trick?
Thanks, and cheers.
Following commands in the Terminal Emulator resolved this issue for me. I am using Galaxy S4 with Android 5.0.1 (Lollipop) with BobJGear OTG Ethernet (ASIX AX88772A Chipset). The commands needs to be run every time when switching from Wifi to Ethernet.
Code:
su
netcfg eth0 dhcp
ip rule add from all lookup main pref 99
ndc resolver setnetdns eth0 "" 8.8.8.8 8.8.4.4
exit
Then I can ping to my router and external websites in the Terminal Emulator without using superuser (SU). The Internet also works with LAN on my Smartphone. I do have to enable "Hack Connectivity Service".
Before using above "ip rule" commands, I could only ping using Superuser.
Also previously it was not recognizing website names while pinging. the "ndc resolver" command resolved that issue.