ADB connection : not recognizing other usb devices

I am trying to work on an Android application using an usb camera device on HiKey.

Up until now, the board did not recognize any usb connection other than Linux root when I connected the board through ADB.
So, I have been using UART adapter to connect the board to my laptop through picocom. An USB camera is recognized in this case only.

The problem is that I need to see Android Logcat and was able to do so, when I was using adb shell. However, in this case, camera device is not recognized as the board is in adb mode.
Whereas, the problem with picocom shell is that it does not show the Logcat and $logcat just shows the dmesg of the board.

What I can think of as solutions to my current situation are these:

  1. Connecting HiKey board through ADB using USB 2.0 (Currently it’s through Micro-USB).
    → Is this possible?
  2. Changing Board configurations (not sure of what I need to change), so HiKey would work both as Master and Gadget at the same time.
    → Does anybody have any ideas on this?

Right now, these are the only things that pops up in my mind. If you can think of other solutions, please write me a reply.

Thank you so much for your help in advance!

The board will only operate in USB host or device mode, not both. This is a hardware limitation of the design. If you still need to use ADB and USB at the same time, you should use ADB in tcpip mode.

Thanks,
Mike

Thanks for your response!

I have tried to use ADB in tcpip mode as you recommended. Then I ran into this dicussion for hikey960.

In this discussion, we are asked to follow these three steps.

  1. Change ADB mode to tcp/ip
    $ adb tcpip 5555
  2. Connect to your device ADB instance (replace with your ip)
    $ adb connect 192.168.1.16
  3. Open a shell
    $ adb shell

I’m not sure if the steps for doing this is exactly the same for HiKey, but I am not sure how to get the ip address of HiKey.
I have flashed an Android image on the board and my HiKey kernel version is 4.9
Could you please provide a guide for this?

Thank you.

Yep the steps are the same. I have been using 'adb shell ip a ls" to find the IP of the hikey board. Maybe that will work for you as well?

Thanks,
Mike

Hello Mike, thank you for confirming the process.

This is what I’m getting and I tried them all including those hex value transformed into ip address.
However, I’m keep getting these sort of messages.
==> unable to connect to 127.0.0.1:5555

I’m still looking for a way to make this work, but couldn’t find a way.
If you know any other way to find the ip address on HiKey, it would great if you could give me a hint or two.

Thank you again for your kind reply,
Wonnie

It looks to me like you don’t actually have an IP assigned. It would be assigned to the wlan0 interface. Did you set up wireless networking in your android settings on the device yet?

Mike

Oh I see. No, it’s not setted up yet.

http://wiki.lemaker.org/HiKey(LeMaker_version):Network
I will set it up with this guideline.

One more thing related to connecting through adb through tcpip.
It is my understanding that I would have to connect the HiKey board to my laptop using ethernet cable.
Or is it possible to get the ethernet connection using usb-to-usb cable?

Thank you so much!

If both your laptop and the hikey board are on the same wireless network you shouldn’t need any cables.

If your laptop isn’t connected to a wireless network you can set it to be an AP and connect to it wirelessly from the hikey board. I’ve never had to do this however so I’m not sure how difficult it is to configure. It would be os specific as well.

Otherwise yes, I believe you can use a USB to Ethernet adapter and an Ethernet cable to connect to your laptop.

Mike

I have wireless network setup for the board and it is in the same wireless network with my laptop. However, I cannot find my board from terminal.

It keeps showing nothing for “adb devices” both as a normal user and as root.
Naturally, I was not able to connect to the board from my laptop through adb.

Even with having a connection using Ethernet cable between HiKey and laptop, the laptop did not find any connected adb devices.
Have you ever faced this kind of problem?

I could connect through tcpip only when the board was connected through micro-USB. Again, in this case, other USB devices were not detected on the board.

Now, I’m wondering if I broke the board somehow and it’s now working…?

I’ve made this work. I simply had to make tcpip connection first with microUSB connected to HiKey board and once adb shell was opened, I disconnected the USB connection between HiKey and my laptop through microUSB on the board.

Thank you @mpanetta for helping me out on this issue with patience!

No problem! I’m glad you got it working :slight_smile:
Mike

I have similar issue. I have the device connected to the same wifi as my laptop. But the second I unplug the USB clable, the adb stop working. The only difference is that on my case I’m on Hikey960…