As a result of some discussion on the Raspberry Pi forums, I decided to make my Pi into a dock of sorts for my HTC Desire.
Rather than using WiFi to connect to the Pi, I ended up using USB so that it doesn’t have to rely on anything external.
First thing I had to do was add this line into /etc/network/interfaces
iface usb0 inet dhcp
This let my HTC Desire assign an IP address to the Pi when I activated USB Tethering.
Second thing was to activate USB tethering itself after I plugged the phone into the USB Dock that I had.
Once the phone was plugged in, and USB tethering activated, the phone got an IP address on the usb0 interface.
Running ifconfig usb0 gave me this –
usb0 Link encap:Ethernet HWaddr ee:21:82:8b:eb:d1
inet addr:192.168.42.144 Bcast:192.168.42.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:616 errors:0 dropped:1 overruns:0 frame:0
TX packets:422 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:220596 (215.4 KiB) TX bytes:58184 (56.8 KiB)
As you can see, it has the IP address of 192.168.42.144 which has been assigned by the Desire.
I have installed a VNC server on the HTC Desire which allowed me to access the screen of the Desire, and also allows me to use my keyboard to do typing on the Desire.
The VNC server I used was called Droid VNC Server. Unfortunately it needs a rooted phone, but I had already rooted my Desire so it was no problem for me.
Once the VNC server was started, I used tightvncviewer on my Pi to access the VNC server on the Desire, and as you can see in the picture above, it’s very viewable.
Responsiveness leaves a bit to be desired, but it’s usable enough as long as you’re not playing games.
Is there any reason why you couldn’t go back the other way? i.e. Run either a VNC client or SSH client on the HTC to connect to the Pi?
No reason at all ! I’ve done it a few times actually
[…] ที่มา http://sirlagz.net/2013/03/02/quickie-turning-the-raspberry-pi-into-a-dock-for-my-htc-desire/ […]
Thanks for this info!
I can use midori to browse, but on terminal, I was getting some problem when I try to update “sudo apt-get update” it seems it is not connected to the internet. Do you encounter such problem?
I never actually used the phone to connect to the Internet, so I’m not too sure. Sorry !
Seems “not” to be working sometimes…
but most of the times it is ok…
I just reboot few times tho..
thanks anyway for the idea!