Summary (What we've done, what we've tried):
Basically, the aim is to establish an adb protocol via usb between two linux computers by using adb source codes.
Envinronment is Ubuntu 16.0.4. There's android-tools-adbd (adb daemon) package ready for use in the pool with its source available.
There is also a source on this link (adbd) compilable with gcc option -stc=c++14 which is supported in 16.0.4 by default (or gcc 5.2).
We are able to build the package from source or use already-built one successfully by using adb connect (TCP/IP dependent). There's no problem on adb connection via TCP/IP if two computers are connected to the same network.
Unfortunately, we are not able to set a USB connection between two computers with an A to A (both male) cable. ADB gadget isn't working and none of the devices recognize the other. We can't decide whether there's a need for an explicit driver besides ADB gadget.
Question is (REAL question to be answered):
How to set a USB protocol between two linux computers so that adb communication can be done via USB?
Is there any solution for it?
[---EDIT---]
NOTES:
Going further day by day, small issues left. For those who want to be involved; we are following this guide.
(Kernel version 4.4.0-38-generic)
Having problems with running the correct udc (USB Device Controller) driver. After activating ConfigFS by modprobe usb_f_fs
, xdg-adbd
(executable from the source link, adbd) works fine until the if(...)
that detects udc driver. We tried running modprobe musb_hdrc
but didn't see an explicit driver name under /sys/class/udc
.
(27.09.2016)
First, let me point out just couple of things about the guide you said you were following:
it requires (it says so in the very first paragraph) you to understand USB, which is the opposite of trying to set a USB connection between two computers with an A to A (both male) cable and expecting it to work.
Linaro (the organization which published the guide) is known for its work on improving Linux on ARM platform. The guide just does not apply to x86 based PCs.
Other than that you need to understand that USB
is an asymmetric protocol between a USB Host
(master) and a USB Device
(slave). There is just no way around this rule. To be able to connect 2 devices using USB
- one device needs to have a USB controller configured as USB Host
and another needs to have a USB controller configured as USB Device
. The problem with the hardware USB Controllers being used in personal computers (standalone or built-in to Intel PCH) is that they can only work as USB Host
. No software can change that.
All projects and resources you linked to in your question trying to prove that your desired result is possible were developed for platforms different from PC.
If you insist on using PC as a USB Device
- there are very few commercially available USB adapters (mostly USB controller evaluation boards), which use USB controller chips with UDC support. But because of their rarity they are usually pretty expensive (the ones I've seen were being sold for about $200). So if your original intention was to lower your development costs by switching to commodity hardware - this option is not going to help you either.
This is how one of such adapters looks like:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With