analogdevicesinc / buildroot

Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation. Forked from https://git.busybox.net/buildroot/
Other
38 stars 58 forks source link

board/pluto: Add support for Android USB Tethering #75

Closed r4d10n closed 1 year ago

r4d10n commented 1 year ago

Signed-off-by: Rakesh Peter rakesh@asnaviram.in

mhennerich commented 1 year ago

Can you explain how did you test this? Did you enable any additional kernel drivers?

r4d10n commented 1 year ago

Our test setup for this is as follows: We have a battery controller board, which can power Pluto and also route power along with the D+ and D- pins on the Data connector of Pluto. We have connected these Power + Data pins to a Female Type A connector mounted on the board. The intention is to use the same port for connecting a WiFi dongle (as standalone WiFi SDR) or a normal Type A to Type C cable to Android phone (for USB tethering). Both use cases were tested to work fine. For enabling DHCP on usb1 for assigning IP to Pluto from Android, the above commit needs to be in-place.

Additional kernel drivers had to be enabled for RNDIS and CDC Ether. Please note that this is mostly meant for supporting earlier Android phones without Ethernet tethering / ECM.

mhennerich commented 1 year ago

Hmm - the pluto firmware supports RNDIS, NCM, or ECM since a while now. https://wiki.analog.com/university/tools/pluto/users/customizing?s[]=ncm#changing_the_usb_ethernet_compatibility_mode For none of those I have never seen usb1 to be created. So what exactly is usb1 in your case?

r4d10n commented 1 year ago

Thanks for the merge. Latest ADI firmware does have kernel support for RNDIS. I just mentioned it since you asked specifically.

Here is the supporting use case with screenshots, running on an Android Tab with Termux application - USB tethering enabled, PlutoSDR in RNDIS mode.

ip-nmap-ssh

On top you can see rndis0 ip is assigned in the 192.168.102.x subnet. Nmap is used to discover the DHCP assigned IP of PlutoSDR and ssh to PlutoSDR is working fine.

dmesg Dmesg Output

ifconfig-usb1 ifconfig showing usb1 interface

SDRpp-RNDIS Latest nightly of sdr-pp with PlutoSDR network support can connect via RNDIS and stream samples. ECM mode also tested to work fine. (IP address is different from the earlier screenshots, since it was taken with after a new DHCP assignment).

mhennerich commented 1 year ago

Thanks this makes sense to me now.