Connect an HTC desire to an ad-hoc network - Desire General

Ok, i found this tutorial.
ott.net/knowledge/htc-desire-adhoc/
Installed apk and trying to terminal adb shell command and getting error
abd: not found
what is wrong?
this terminal i runned from phone not from pc..

You have to run adb from pc. A guide for installing it can be found in my signature.
TouchPaled from Oxygen with Transparent XDA App

I started adb shell and when enter:
insmod /system/lib/modules/bcm4329.ko
I have this error:
insmod: init_module '/system/lib/modules/bcm4329.ko' failed (Operation not permitted)

atlantisu21 said:
I started adb shell and when enter:
insmod /system/lib/modules/bcm4329.ko
I have this error:
insmod: init_module '/system/lib/modules/bcm4329.ko' failed (Operation not permitted)
Click to expand...
Click to collapse
I have spent some time yesterday trying the exact same thing, I didn't succeed.
For your question:
Try using the command "su" before starting insmod.
Also remember to assign execute permissions to iwconfig, else it will not work either!
I probably did something wrong (or it just doesn't work on my ROM (I'm on redux2)) because i couldnt get it to work.
Also the app ad-hoc (follow the links on his page i think) fails for me. Wifi will go to error state and only reboot makes it work again.
If you succeed please tell us how you did it because I'm veeery interested!

Doesn't work with su command...
I trying to change bcm4329.ko permission with root explorer but nothing happening.
Maybe this is the problem?
And where is located iwconfig file?
Can I change file permission from adb shell and how?

Finaly WORKS!!!!!!!!!!!!!!
Because, I cant enable ad hoc on my Desire (I try many ways and nothinhg...),
I found another way to share wifi internet from pc to android phone.
This is my way:
Download VirtualRouter
Download fresh wifi drivers for Windows 7 64bit/32bit
Disable IP6 (if you have Windows 7 64bit)
After install VirtualRouter, reset your PC and VirtualRouter will start with your Windows in system tray.
In Network Connections, enable Microsoft Virtual WiFi Miniport Adapter if disabled.
Go to Local Area Connection (your default internet connection), properties -> sharing and check all box. Select home network connection -> Microsoft Virtual WiFi Miniport Adapter or Wireless Network Connection 2.
Run cmd as admin and type this:
netsh wlan set hostednetwork mode=allow ssid=Test key=password
netsh wlan start hostednetwork
VR automaticly write ssid and key and starting virtual network.
Desire CAN SEE this network, and you CAN CONNECT!
If you have problems go here.

atlantisu21 said:
Finaly WORKS!!!!!!!!!!!!!!
Because, I cant enable ad hoc on my Desire (I try many ways and nothinhg...),
I found another way to share wifi internet from pc to android phone.
[
Click to expand...
Click to collapse
I work in the same way (with connectify)>
Too bad you couldn't get ad-hoc to work, i would like to have that solution, it is more elegant.

Related

How to get internet on your phone via USB

You may also call this reversed USB tether.
This might come in handy if you're near a computer (Win XP/Win7) and there's no Wifi to connect to etc..
So after some research and trying I've found some information on how to do this.
Requirements:
* Android 2.2 (or an older version with a root tethering app)
* ADB from Android SDK, or a rooted Android 2.2 with terminal in root mode
STEP 1:
Install USB drivers from Android SDK.
STEP 2:
Connect USB cable and activate USB Tethering.
You should see a new network interface. (On XP you might need to install the RNDIS driver manually, see below)
If you're also missing RNDIS driver on Win7, look here.
Win XP manual driver install Android USB Ethernet/RNDIS: (You can skip this if you're on Win 7)
1. Download the following configuration file inside the *.zip attached to this post (tetherxp.inf) to your Windows XP computer.
2. Use the USB cable that came with your phone to connect your phone to your computer.
3. On the Android phone, press Home > Menu > Settings to open the Settings application.
4. Press Wireless & networks > Tethering & portable hotspot.
5. Check USB tethering.
6. When Windows XP’s New Hardware Wizard opens, select No, not at this time and click Next.
7. Select Install from a list or specific location and click Next.
8. Click Browse to browse to the directory where you installed the configuration file you downloaded in Step 1 and click Next. Windows XP uses the configuration file to configure itself to support USB tethering with the Android phone. (This might take a while)
9. When Windows XP finishes installing the software for Android USB Ethernet/RNDIS, click Finish.
STEP 3:
Bridge the 2 network interfaces.
STEP 4:
Setup usb0 interface of your phone. You have to options:
1. From your computer, execute:
./adb shell netcfg usb0 dhcp
2. Or in a root terminal on your phone, type:
su
netcfg usb0 dhcp
You should now be able to connect to Internet on your phone using your computer's Internet connection.
Try to do a ping www.google.com to be sure.
STEP 5:
To shut down the reverse-tethering, first unbridge interfaces on your computer:
sudo ifconfig eth0 down
sudo ifconfig usb0 down
sudo ifconfig br0 down
sudo brctl delbr br0
sudo ifconfig eth0 up
sudo dhclient eth0
Then on your phone, uncheck the USB Tethering option.
Quote...
It is working now. After setting up ICS type in console emulator on your phone:
ifconfig usb1 192.168.2.2 netmask 255.255.255.0 up
route add default gw 192.168.2.1 dev usb0
iptables -F
iptables -F -t nat
setprop net.dns1 8.8.8.8
setprop "net.gprs.http-proxy" ""
Click to expand...
Click to collapse
Hope this helps some one who wants this to the right direction.
And maybe we're able to create an app to do this all automated.
Known issues but does not apply to all users:
1. Internet in browser application does not work.
2. Can't ping domain name.
For a little more info check out the sources, this includes the Linux version too.
Sources: Google android, Mycila
Nice info
Going to post a link on the hero forum where someone was wanting to do this. I wonder if this will work on a froyo hero too...
it would be cool if one of the devs could write a small app to switch this on n off great find tho shoemeistah
Thank you for the guide, It worked fine. There are several things not working though:
- can't download apps from market, they stuck on "downloading"
- my google account don't sync
- other apps don't update themselves. For example my twitter app won't show any new tweets until I open it and manually press "refresh"
I searched for this long time ago, even created a thread about it awhile back, didnt have luck like you did though
I gave up on it eventually, it would be nice to make an app out of it.
mind asking how did you confirm the net to be working on browser? by pinging google.com?
since i saw the last line you put "Internet in browser application does not work."
You can do that in the terminal
[U][B] Internet connection on your Android phone via your PC [/B][/U]
I think I found the best solution. Check it out connectify.me
I wanted to use my PC wired internet & I was astonished that this wasn't available in my HTC Desire & 1st Android device!. I looked over the net, I found many options but most asked for a rooted device! I didn't want to root my brand new Desire.
Connectify is an easy to use software router for Windows 7 computers. After downloading and installing the lightweight application, Connectify utilizes your computers' built in Wi-Fi card to wirelessly share any available Internet connection: a cable modem, a cellular card, or even another Wi-Fi network. Other Wi-Fi enabled devices including laptops, smart phones, music players, and gaming systems can see and join your Connectify hotspot just like any other Wi-Fi access point and are kept safe and secure by password-protected WPA2 Encryption.
I tried it & it's working perfectly for me .. It's a free app.
-----------
Phone: HTC Desire (SIM Free)
Type: Desire
Build: HTC Desire 2.2, 2.10 (kernel: htc 2.6.32.15)
Baseband: 5.09.05.30
Network: UMTS auto (EGY)
By me it didn't work. Using OpenDesire with Froyo 2.2
So I made it work, by edititng the .inf file.
Here the file for USB\VID_0BB4&PID_0C02.
For all which still have a problem(USB TETHERING ON DEVICE MUST BE ACTIVE, ALSO THE IDs DIFFERS BETWEEN CONNECTED WITH ADB OR NOT), go into the device manager -> open the device -> goto tab details -> choose device id
look at it, you see somewhere vid_XXXX and further pid_XXXX
open my file -> goto line 31 -> change vid_YYYY and pid_YYYY with what you see in your device dialog. the same you do on line 35. be careful with 0 or o.
Regards
Ralph
I am also using connectify, easy to install, set it up, connect with Desire, anything works fine.
Thanks GhostOfTheNet.
chrismast said:
I am also using connectify, easy to install, set it up, connect with Desire, anything works fine.
Click to expand...
Click to collapse
I appreciate the recommendations for other solutions.
But as you can see this thread is for a internet solution at places where is no Wifi available.
So please keep it on topic, thanks!
browser & webviews
Any idea why browser won't work?
I'm interested in testing against internal sites (of course no WAP here.. cuz they be scared i guess).. both Browser and embedded webviews.
connectify great program.works fine
its a default feature in hd roms but that doesnt work in all programs
Connectify doesn't work correctly with my Galaxy 5. It keeps connected for a short time then disconnects and then, connects again, connect, disconnect...
Does anyone know how to fix it?
Thanks Man
plz make a video tutroial of this
its difficult to under stand
does it actualy work?? anyone tried this and actualy worked??? just a simple yes or no.
thanks
small proble plz solve it
hi
I have a small problem in it when my device is not in usb tethering mode
i can see it in my adb devices
as soon as is start usbtethering it say no device found
plz help me
thanks a lot !!!
realy nice guide! Thanks!

Got Ad-hoc wifi working on my Xoom! (binaries inside)

I've managed to build a version of wpa_supplicant that has ad-hoc enabled, by forward porting the patch in this thread:
http://forum.xda-developers.com/showthread.php?t=754961
After building and a couple of tests, it works.
To install, you need a rooted Xoom, of course, and just push the file to system/bin/wpa_supplicant.
Because zipfiles don't store permission, you have to make it executable as well.
Code:
adb remount
adb push system/bin/wpa_supplicant /system/bin/wpa_supplicant
adb shell chmod 755 /system/bin/wpa_supplicant
I also had to change the permissions on /data/misc/wifi/wpa_supplicant.conf for some reason:
Code:
adb shell chown system.wifi /data/misc/wifi/wpa_supplicant.conf
Then reboot, and try it!
It works with my Nokia N8 with JoikuSpot; I can't tether it any other way as the N8 doesn't support the PAN Bluetooth profile, and Android doesn't support DUN.
Don't forget to backup your files, and I am not liable, etc, etc.
The code I used is here:
https://github.com/kelvie/android-wpa_supplicant
Ok heres what happened to me..
I was able to push the first file and when I input the adb shell code it said the device was not connected I am rooted and had no problems rooting or access shell before
So I got a little cocky and thought that the port 5037 that adb communicates with was blocked so I typed adb tcpip 5036 to see if I could get shell access on that port well now when I type adb remount it immediately tells me error: device not found....help!
Got myself stuck without wifi (error)
Thanks for developing such a great app. If i m not wrong i think its working with all 3G carriers.
You can also turn your Motorola Xoom tablets to WiFi hotspot without rooting by enabling setting which are given here http://goo.gl/mgwdn
Also my xoom has been in debug mode and now all of a sudden I noticed that its not entering debug mode when connected there used to a little icon come up and not anymore it acts like nothing yet i can access it on my computer by going my computer and I see Xoom
Ok I got debugging mode back and xoom is plugged in now my problem is when the daemon server starts in adb shell it starts on port 5038
So when I try to copy "adb shell chmod +x /system/bin/wpa_supplicant" it still says device not found and thats if I copy and paste it exactly if I type adb shell it gives me the # Symbol then i put it "chmod +x /system/bin/wpa_supplicant" and it says bad mode
One good thing is I can now type /remount again so what I am doing wrong still stuck without wifi ;\
Ok I've tried everything except reflash my devices I've literally only been able to do step 1 which leaves me with no wifi because i cannot execute the shell commands so please a little help it's been a long night messing with this appreciate your time and I'd love to get this working!
kelvie said:
I've managed to build a version of wpa_supplicant that has ad-hoc enabled, by forward porting the patch in this thread:
http://forum.xda-developers.com/showthread.php?t=754961
After building and a couple of tests, it works.
To install, you need a rooted Xoom, of course, and just push the file to system/bin/wpa_supplicant.
Because zipfiles don't store permission, you have to make it executable as well.
Code:
adb remount
adb push system/bin/wpa_supplicant /system/bin/wpa_supplicant
adb shell chmod +x /system/bin/wpa_supplicant
I also had to change the permissions on /data/misc/wifi/wpa_supplicant.conf for some reason:
Code:
adb shell chown system.wifi /data/misc/wifi/wpa_supplicant.conf
Then reboot, and try it!
It works with my Nokia N8 with JoikuSpot; I can't tether it any other way as the N8 doesn't support the PAN Bluetooth profile, and Android doesn't support DUN.
Don't forget to backup your files, and I am not liable, etc, etc.
The code I used is here:
https://github.com/kelvie/android-wpa_supplicant
Click to expand...
Click to collapse
Ok...I tried this and got the same "bad mode" error at the
"adb shell chmod +x /system/bin/wpa_supplicant" stage.
So, I instead did "adb shell chmod 700 /system/bin/wpa_supplicant" and that was successful, so I finished the steps listed and can see my cell on my Xoom. I have a Windows Mobile 6.5 cell and my Xoom can NOW see my ad-hoc network. Thanks a lot Kelvie.
If not for the SDCard update from BRD, I think this thread would be getting alot more attention.
Not to be too mistrusting, but I am hesitant about loading this on my Xoom when it is posted by a new user with only one post.
Fusius said:
Ok...I tried this and got the same "bad mode" error at the
"adb shell chmod +x /system/bin/wpa_supplicant" stage.
So, I instead did "adb shell chmod 700 /system/bin/wpa_supplicant" and that was successful, so I finished the steps listed and can see my cell on my Xoom. I have a Windows Mobile 6.5 cell and my Xoom can NOW see my ad-hoc network. Thanks a lot Kelvie.
Click to expand...
Click to collapse
Hey that worked instantly love you!
PengLord said:
If not for the SDCard update from BRD, I think this thread would be getting alot more attention.
Not to be too mistrusting, but I am hesitant about loading this on my Xoom when it is posted by a new user with only one post.
Click to expand...
Click to collapse
I completely understand where you're coming from; but check my github repo, and google for me, I do leave a small internet trail...
I (mostly used to, don't do much anymore but answer the odd email) maintain an open source project (Basket for KDE), and try to participate in open source communities as much as I can.
I just did this to tether my Xoom Wifi to my phone, as I had no other way to get internet on the go.
Nice work. I tried to do this myself last week but ran into trouble just getting wpa_supplicant from the Android git to compile (with or without the changes)
First off, wow man thank you so much. I've been playing with this for a while and I've tried a number of different wpa supplicant files but they failed to initiate a scan of wireless networks. I just tried this one and it works great. I wanted to explain a different way to install it however for the people having ADB issues.
First you want to turn off your wifi. I have used the ADB method a couple of times but I find it easier to use Root explorer. Save the file to your Xoom, Copy it using root explorer, navigate to the system/bin folder and click mount R/W then paste the file into the folder replacing the original (make sure to make a backup!) then long hold on the file and view permissions, check all the boxes in the first two columns and the first 2 in the last column. (chmod 775) You can then restart your wifi and enjoy ad-hoc networks (no reboot needed.)
I've done this a couple of times and it works great. Thanks again.
First off, thanks a ton to the OP for getting this working!
Also, thanks to mr_wrong_0 for the root explorer directions. Not that I'm incapable of using the command prompt, it was just easier to do it this way.
mr_wrong_0 said:
First off, wow man thank you so much. I've been playing with this for a while and I've tried a number of different wpa supplicant files but they failed to initiate a scan of wireless networks. I just tried this one and it works great. I wanted to explain a different way to install it however for the people having ADB issues.
First you want to turn off your wifi. I have used the ADB method a couple of times but I find it easier to use Root explorer. Save the file to your Xoom, Copy it using root explorer, navigate to the system/bin folder and click mount R/W then paste the file into the folder replacing the original (make sure to make a backup!) then long hold on the file and view permissions, check all the boxes in the first two columns and the first 2 in the last column. (chmod 775) You can then restart your wifi and enjoy ad-hoc networks (no reboot needed.)
I've done this a couple of times and it works great. Thanks again.
Click to expand...
Click to collapse
Thanks so much for this! No issues at all. Wifi Xoom is tethered to my HTC Hero now.
Congrats on a killer mod! We are making progress nice and steady.
Installed, works great.
Thank you.
Great, thanks for your hard word.
I do have a question for those how have done this hack. I currently have an old iPhone 3g with tetherme installed and use Bluetooth tethering to give my Xoom (wifi only) internet access. This works great for me.
Is there are speed/battery life advantage to using wifi tethering instead?
Cheers
I don't know for sure. From what I understand wifi is potentially faster than bluetooth, but it can vary from device to device. I have noticed that my Epic seems to stay cooler and use less battery when broadcasting an Ad-hoc network vs broadcasting in infrastructure mode (using wifi tether 3.0.) But I've never been able to get my phone to tether with bluetooth so I don't know about battery life. One advantage of connecting over wifi is file sharing via apps like wifi file explorer. I have used that a lot to transfer files between my Xoom and my phone as well as the computer.
Noob question
Hello all,
Thank you very much for the patch.
I would like to try it out, but before that, I need to make sure of one thing;
If I root my Xoom, will I still be getting future updates from Motorola for the device if there is one? Or once I root it, is it impossible for me to update them from the manufacturer?
Thank you!
Thanks so much to the OP! I've been waiting for a reason to root my wifi Xoom. SDCard access was tempting, but I think this is the thing that pushes me over the edge!!
Thanks!!

Tethering issue

I'm trying to tether my Evo with my HP netbook that's currently running Blackbuntu which is a pen test distro based on Ubuntu 10.10 and using Wicd as my network manager. With the default network manager usb tethering worked "out of the box" but unfortunately I was unable to use WiFi with it which forced me to use Wicd. In order for Wicd to function properly I had to fully remove the original network manager. Now I can't figure out how to configure Wicd to work with tethering. Somewhere I read all I have to do is change the wired interface in Wicd from eth0 to usb0, or something along those lines, so I tried ifconfig to verify and nothing showed up other than eth0, lo, and wlan0 - the 3 that always show up. I can't seem to find the tethering tutorial I read before to double-check it. Any help/ideas would be great.
EDIT: I figured it out on my own. I just had a brain fart for a bit. For anyone wondering how to do it, here's how:
On your Evo open a terminal and do the following.
su
busybox ifconfig
Write down the IP address given.
Connect your phone to your Linux box and start USB Tethering.
On the Linux box open a terminal and type:
sudo ifconfig usb0 up
Open Wicd, click preferences, and change the wired interface to usb0. You may have to set DNS1 to the IP you copied earlier.
Sent from my PC36100 using XDA App

[Q] adb over bluetooth

Any one know how to use adb over bluetooth in this device ??
I tried 'pand' command from terminal and this doesn't work.
impossible...
try this, for linux pc.
http://fomori.org/blog/blog/2011/12/05/android-adb-over-bluetooth/
nfs1mw said:
try this, for linux pc.
http://fomori.org/blog/blog/2011/12/05/android-adb-over-bluetooth/
Click to expand...
Click to collapse
I already tried this but didn't work
pand gave some error "Failed to open control socket: Address family not supported.........."
then I thought this error may be due to lack of bluetooth module.so I compiled "bluetooth.ko" and loaded.
then the error disappeared but the thing didn't worked..
I think my bluetooth device is not detected by the module because '/sys/class/bluetooth' directory was empty
So still now i am seeking for a solution....
harish2704 said:
I already tried this but didn't work
pand gave some error "Failed to open control socket: Address family not supported.........."
then I thought this error may be due to lack of bluetooth module.so I compiled "bluetooth.ko" and loaded.
then the error disappeared but the thing didn't worked..
I think my bluetooth device is not detected by the module because '/sys/class/bluetooth' directory was empty
So still now i am seeking for a solution....
Click to expand...
Click to collapse
Well it actually is not impossible. I already had it working.
But your phone shouldn't have any issues with BLUETOOTH PAN profile. If having any issues maybe don't expect this to work. And it need not have mobile internet for both phone or PC. Its just phone-to-pc direct connection, no need for internet access point. Lets think there is no mobile internet enabled for the below HOW-to.
Ok here u go. Pair your phone and PC. Initiate BT PAN connection from PC to phone (right click on bluetooth device and select connect-via-access-point). This creates a local connection. Now u need to know local IP address on phone side. Install terminal emulator application and issue the command "netcfg" which lists all connections active. Note the IP address of the connection bnep0 (say ww.xx.yy.zz)
Now open your PC Command prompt and type the command
adb connect ww.xx.yy.zz:5555
it says connected. Enjoy.
Same goes for wireless connection through LOCAL WIFI (WLAN) without internet access point.
Lets think mobile internet is off.
Turn on the portable Wifi Hotspot on the android device and make ur PC to connect to that hotspot. Note down the local ip address of the connection. Then open pc command prompt and type same command as above
adb connect ww.xx.yy.zz:5555
connected . enjoy.
IMPORTANT: First of all u need to enable ADB OVER NETWORK option in phone. This option is present in latest roms like cm7.2 or cm9 or ics roms. If this option is not available u need to find terminal alternatives for this.
Noob here.
Is there any detail guide to do this ???

The Connection refused problem with transplantation of wifi

I write a android program to control wifi with java code.The app catch the necessary informations like 'ssid' or 'password',and send them to the 'wpa' to start the wifi network.There are some native methods to achieve functional,and the app call them with JNI.
At first,when calling the wifi_start_supplicant(in wifi.c) method there are some logs show " Cannot set RW to "/data/misc/wifi/wpa_supplicant.conf': Permission denied '.First I just give the wpa_supplicant.conf 777 permission,but the error was still happened.Then I all the folder on the Path 777 permission,the error disappeared after that.
But there's another error came: Failed to start supplicant daemon. No such file or directory.Then I search the source code of android 4.0.1.r1,and find that there's a code segment(in wifi.c):pi = __system_property_find(SUPP_PROP_NAME);and the SUPP_PROP_NAME is " init.svc.wpa_supplicant ".I found the init.svc.wpa_supplicant is a service,so I use the adb shell to set it "running" with command "setprop init.svc.wpa_supplicant 'running'"before I run the program.After this step the error was disappear.
But there's a new error came,logs show: Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": Connection refused.And I find some ways to solve this problem on the link:
blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android. html
I follow all the steps on this link,except so change about the wifi.c,because compiled the wifi.c will get a libhardware_legacy.so,and this so file will crash my phone while it push into /system/lib.
I try both android private socket and unix standard socket to connect to supplicant,but all I try just had a same result: Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": Connection refused
In this step I make sure the wap_supplicant and dhcpcd were starting from init.rc with the interface of wlan0,and setprop the wifi.interface as "wlan0".I had seen the file in /proc/net/dev,and I sure the wlan0 is mark on the file(dev).
Above is all my work and procedure with my transplantation of wifi,the problem of"Unable to open connection to supplicant .... Connection refused " is still confused me,is there some ways can solve that?
Thanks a lot anyway!
Any updates
Hi, were you able to find the cause of this problem. I am facing the similar issue now.
Thanks

Categories

Resources