LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   tethering from android phone to slackware (http://www.linuxquestions.org/questions/slackware-14/tethering-from-android-phone-to-slackware-801127/)

metageek 04-09-2010 04:38 PM

tethering from android phone to slackware
 
Hi,

I've just got a nice HTC Desire (ie almost the same model as the Nexus One), and it can work as a modem for accessing the internet. After googling this, I've found out that on debian it works straight without adding any package, just as the pjone is connected. This is not the case on slackware 13... Has anyone got this to work already? What am I missing?

mdek 04-09-2010 10:59 PM

If you're using the "Wired Tether for Root Users" android app, then upon activation and plugging it in, slackware should automagically create a network interface named usb0. You can "activate" it with 'dhclient usb0' and it should work. If you're using Wireless tether, then you need to connect to the phone AP. I'm not sure how Pdanet works as I haven't needed to use it on android.

Alien Bob 04-10-2010 07:13 AM

I have received a HTC Desire yesterday and have had a lot of fun with it already.
When I connect it through the USB cable with my Slackware laptop, the HTC pops up a dialog what I want with that USB connection: power the phone over USB, or make the CF card available as USB storage, or provide USB tethering (they call it "network sharing" - acting as a modem to the Slackware box).

Indeed, a usb0 network device will become available if I choose network sharing and "dhcpcd usb0" was enough to type this message using the phone as a gateway to the internet :-)

Eric

Alien Bob 04-10-2010 07:16 AM

As a side note, I assume that theless liberal telephony market in the US will prevent HTC from offering this easy way to use the phone as a USB network device. There aren't even tethering apps available in the Android Market in US/Canada I heard. So, YMMV.

Eric (again, sent through the Android phone)

metageek 04-11-2010 02:27 AM

must be missing kernel option...
 
Quote:

Originally Posted by Alien Bob (Post 3930867)
Indeed, a usb0 network device will become available if I choose network sharing and "dhcpcd usb0" was enough to type this message using the phone as a gateway to the internet :-)
Eric

Ok, I've tried this also (my plan is with vodafone uk) but no luck with a usb0 network device. I have a custom kernel so most likely I have some crucial option missing. Will look into this and report here.

I'm loving the HTC desire, except the battery life that is not great...

Metageek

metageek 04-11-2010 10:08 AM

modules needed for usb0 with android phone
 
Ok, so I checked with hugesmp kernel and found out which modules are needed so that I could add them to my customized kernel (2.6.32). These are the options needed:
Code:

-> Device Drivers
 -> Network device support (NETDEVICES [=y])
  -> USB Network Adapters
  <M> Multi-purpose USB Networking Framework 
  -M- CDC Ethernet support (smart devices such as cable modems)
  <M> CDC EEM support 
  <M> Host for RNDIS and ActiveSync devices (EXPERIMENTAL)
  <M> Simple USB Network Links (CDC Ethernet subset) (NEW) 

-> Device Drivers
 -> Network device support (NETDEVICES [=y])
  -> Wireless LAN (WLAN [=y])
  -> Wireless LAN (IEEE 802.11) (WLAN_80211 [=y])
    <M>  Wireless RNDIS USB support

with these modules the usb0 network device is added automatically as I select the option for Internet sharing when I plug in the phone. Now I just need to create some rules for udev (or hal) to automatically do a dhcpcd usb0 when this is connected, and it will work fully automatically.

metageek

sub501 05-03-2010 10:36 AM

A simple udev rule which call dhcpcd, paste it in /etc/udev/rules.d/51-htc_desire.rules :

# ---
# Htc Desire USB tethering
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ffe", MODE="0666", RUN+="/sbin/dhcpcd $env{INTERFACE}"
# ---

idVendor 0bb4 is HTC
idProduct is for HTC Desire, replace with your product id in case you have a Legend for example.

Reload udev: "/etc/rc.d/rc.udev reload"

and enjoy.

Alien Bob 05-03-2010 11:05 AM

Quote:

Originally Posted by sub501 (Post 3955756)
A simple udev rule which call dhcpcd, paste it in /etc/udev/rules.d/51-htc_desire.rules :

# ---
# Htc Desire USB tethering
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ffe", MODE="0666", RUN+="/sbin/dhcpcd $env{INTERFACE}"
# ---

idVendor 0bb4 is HTC
idProduct is for HTC Desire, replace with your product id in case you have a Legend for example.

Reload udev: "/etc/rc.d/rc.udev reload"

and enjoy.

Why not also de-configure the interface when you remove the Android phone?
Code:

# ---
# Htc Desire USB tethering
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ffe", MODE="0666", ACTION=="add", RUN+="/sbin/dhcpcd $env{INTERFACE}"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ffe", MODE="0666", ACTION=="remove", RUN+="/sbin/dhcpcd -k $env{INTERFACE}"
# ---

I would also not use a mode of "666". That is too insecure.

Eric

sub501 05-05-2010 12:31 PM

Quote:

Originally Posted by Alien Bob (Post 3955775)
Why not also de-configure the interface when you remove the Android phone?
Code:

# ---
# Htc Desire USB tethering
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ffe", MODE="0666", ACTION=="add", RUN+="/sbin/dhcpcd $env{INTERFACE}"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ffe", MODE="0666", ACTION=="remove", RUN+="/sbin/dhcpcd -k $env{INTERFACE}"
# ---

I would also not use a mode of "666". That is too insecure.

Eric

Yep, Alien Bob is right.


All times are GMT -5. The time now is 11:18 PM.