Enable/Disable Wireless by Terminal Command - Nook Color Q&A, Help & Troubleshooting

Please excuse me for asking this, as the terms needed to search for the information yield the wrong results no matter how many times I try: I'm curious as to what terminal commands are used to enable/disable wireless. Would it be /etc/init.d as with standard linux?

At a low level (and as root)
# ifconfig tiwlan0 down
disconnected my wireless, but Android was unaware - just couldn't connect. Someone may be able to provide a command line approach to the actual android interface which would be better.

I'm not too worried about the android interface--basically, I'm just trying to disable the wireless before I swap between Infrastructure/Ad-Hoc in a tiny script, and then re-enable it, so as to avoid a problem I had earlier where my wireless was utterly trashed somehow by forgetting this step before switching to the Ad-Hoc supplicant. It would also just allow me to put two script-icons on my desktop and let me do one-click swapping between the two. I assume this command would have the same effect as turning the wireless off through the interface, as far as swapping the supplicants goes?

Starfire-1 said:
At a low level (and as root)
# ifconfig tiwlan0 down
disconnected my wireless, but Android was unaware - just couldn't connect. Someone may be able to provide a command line approach to the actual android interface which would be better.
Click to expand...
Click to collapse
Strangely, after trying both ifconfig and netcfg, even as they show "down," the wireless retains it's IP, and Wifi Manager is able to scan for new APs! At the same time, if I try to run Dolphin HD 4.3, I experience a full reboot.

Same problem
Hey. I have a problem similar to the one described in this thread.
I would like to turn enable / disable wifi from commandline (using a bash script). I use the tools terminal emulator and script manager on my rooted Nexus One.
Not the results I get from using standard Linux approaches are:
With wifi turned OFF (used Android gui to do this, ofc):
Code:
$ ifconfig
$ (nothing)
$ ifconfig eth0
eth0 no such device
$ iwconfig
lo no wireless extension
gannet0 no wireless extension
.... (and a lot of other devices, but NO eth0)
$ netcfg
lo up 127.0.0.1 255.0.0.0 0x00000049
......... (and no eth0 here either)
Now turning ON wifi
Code:
$ ifconfig
$ (nothing)
$ iwconfig
lo no wireless extension
gannet0 no wireless extension
....
eth0 IEEE 802.11-DS ESSID:"" Nickname:""
(and a lot more info)
$ ifconfig eth0 down
error: SIOCSIFFLAGS (Permission denied)
$ su
$ ifconfig eth0 down
$ (nothing)
So it looked like the ifconfig eth0 down with super user rights might have worked, but looking in the android menus, wifi is still enabled, so I still have no idea how to turn it on or off in a bash script.
Any help would be nice

It's an old thread, but i was looking for the same and this thread came up 1st in Google.
If it helps someone, i was able to turn wifi on and off via command line using
Code:
svc wifi enable
and
Code:
svc wifi disable
And Android GUI gets noticed

Related

[Android] Run Android without a data plan [CHECKLIST]

Hey Gang,
I currently do not have a data plan and won't get one until I switch from Sprint to Verizon. (accounts expire soon)
This is what I want to do with my Vogue:
Setup SD card with EXT2 partitions [CHECK]
Correctly install/run a SenseUI/Hero build [CHECK]
Convert my WM contacts to Android contacts offline [CHECK]
Install APK's offline [CHECK]
Use the internet connection through my PC via USB cable (while running android) [PENDING]
Install a "camera software" APK so i can use the camera [PENDING]
Enjoy the hell out of Android and all the possibilities for the Vogue! [CHECK]
Any and all help checking off my list is much appreciated!
~Syn
The camera already works out of the box. and Talk to enatefox about internet via USB connection.
Install a "camera software" APK so i can use the camera [PENDING]
I am currently using "Pro Paint Camera that came with this Hero/SenseUI build.
I can take pictures but not video. Also, none of the lighting effects work so every picture is very yellowish.
True.... the camera does work, but it is not really usable without adjustment.
I'm in the same situation right now. I want to use android but I'm afraid I wont be able to use internet to access the market (unlike WM/ActiveSync).
The camera issue is something that I can deal with, but I think that it would be nice if someone could make an activesync-like program that can share internet.
Only difference is that I'm on verizon right now, and might consider switching to sprint!
synaptyc said:
Install a "camera software" APK so i can use the camera [PENDING]
I am currently using "Pro Paint Camera that came with this Hero/SenseUI build.
I can take pictures but not video. Also, none of the lighting effects work so every picture is very yellowish.
True.... the camera does work, but it is not really usable without adjustment.
Click to expand...
Click to collapse
I forget exactly when that build came out, but I can assure you that the build I'm using now has a camcorder and camera app outside of Paint Pro Camera.
FWIW, I'm using the Droid donut ion build by Zenulator.
Also, from what I know, internet through USB only allows you to browse the web, and the marketplace doesn't work. There might be some changes in the future, however.
Yes. with Cupcake / Donut the camera/camcorder seem to work with the default applications. They still don't have filters or effects to correct lighting.
... still looking for that app.
Link9228 said:
I forget exactly when that build came out, but I can assure you that the build I'm using now has a camcorder and camera app outside of Paint Pro Camera.
FWIW, I'm using the Droid donut ion build by Zenulator.
Also, from what I know, internet through USB only allows you to browse the web, and the marketplace doesn't work. There might be some changes in the future, however.
Click to expand...
Click to collapse
How would one go about getting Internet via USB? I have searched endlessly (or so I thought). Thanks.
gascan555 said:
How would one go about getting Internet via USB? I have searched endlessly (or so I thought). Thanks.
Click to expand...
Click to collapse
I've been trying to do this too!
gascan555 said:
How would one go about getting Internet via USB? I have searched endlessly (or so I thought). Thanks.
Click to expand...
Click to collapse
I have also been trying to figure this out... but getting Internet via bluetooth rather than USB. So kind of like the bluetooth tethering that is possible right now with Android, but in REVERSE! So Internet-> PC-> Bluetooth-> Android.
USB Internet (at this point) can be very problematic. It can cause your phone to hard freeze out of the blue. I haven't spent a lot of time troubleshooting it since it's hard to figure out what went wrong when I'm forced to reset.
Credit to DimaFern for getting me anywhere near having this working. I just messed with it a little. This is reverse tethering because you are not getting the connection from the phone. So the USB Tethering option is not related in this situation.
Here's my howto
I have not tried this without a Linux host. I believe you can forward traffic with ICS but I don't know what is involved there.
My gateway is .37, my laptop is .107 and the phone gets it's IP from the laptop:
On laptop:
echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward
On Android:
ip addr add 192.168.37.100/24 dev usb0
ifconfig usb0 up
## This is the IP for my laptop:
route add default gw 192.168.37.107
setprop net.dns1 192.168.37.107
cat /proc/net/route
Click to expand...
Click to collapse
The last line is not needed-- it's to show you that it's routing traffic. You won't be able to ping IPs from the command line and somehow Market doesn't think you're online but SAM Market, Browser, etc. do work. It's nice because you are not taxing the RAM of the phone for connectivity so it runs much quicker... unless it hard freezes on you.
i use tetherbot to tether my phone now that it's running android full time. basically install tetherbot and start the socks proxy server on port 1080 then.
Code:
adb forward tcp:1080 tcp:1080
from your computer and set up firefox to connect manually to the proxy.
http://www.google.com/url?sa=t&sour...tLoX-20q2czcpvdhw&sig2=YLuIUO1a9NqdzdKn2NhO5Q
http://www.google.com/url?sa=t&sour...D0n7yQtvLGRfy1GXg&sig2=OMS2j6DiIEHenOugM9VbSg
zenulator said:
http://www.google.com/url?sa=t&sour...D0n7yQtvLGRfy1GXg&sig2=OMS2j6DiIEHenOugM9VbSg
Click to expand...
Click to collapse
WOW..... this second link leads to a beautiful website.
10 levels of gay for poor "kevin" of 'kevin♥Amanda' but still a nice looking site
Geez.... he didn't even get his name capitalized in the header picture
/on_topic: I'll try Tetherbot.
(is there a way to use Tetherbot with Google Chrome? I haven't used Firefox in ages)
zenulator said:
i use tetherbot to tether my phone now that it's running android full time. basically install tetherbot and start the socks proxy server on port 1080 then.
Code:
adb forward tcp:1080 tcp:1080
from your computer and set up firefox to connect manually to the proxy.
http://www.google.com/url?sa=t&sour...tLoX-20q2czcpvdhw&sig2=YLuIUO1a9NqdzdKn2NhO5Q
http://www.google.com/url?sa=t&sour...D0n7yQtvLGRfy1GXg&sig2=OMS2j6DiIEHenOugM9VbSg
Click to expand...
Click to collapse
I'm sorry, but isn't Tetherbot used to share your phone's internet connection with your computer?
I think we are trying to be able to "reverse tether" and not tether.
enatefox (and others)...
I would love to see how this reverse-tethering can work. I know its very complicated and buggy right now, but if you do any more work on it you should create a thread showing how in layman's terms. I have dual-boots on both my computers into Ubuntu 9.10, I know what the terminal is and sudo and some basic commands, but when you type your commands with little explanation I get lost. They could use some clarification [ such as 1) open terminal 2) type these commands. ] And please explain terminal in Android. What apk do I need? I probably have it already but just need to install it. Thanks for any help. I don't have data since my line costs $10 a month (family plan) and data would be $26 a month. I just started reverse-tethering with WM6.5.1 and its really cool.
There aren't any other steps you just run what I posted and change "192.168.37.107" to what your desktop's IP is and "192.168.37.100" to "192.168.xxx.100" where "xxx" is the subnet of your LAN-- matching the 3rd set of numbers of your desktop's IP.
You can run these commands over ADB, which is required to do this. Here's a guide on how to set it up.
Here is what I came up with trying to do the same thing with bluetooth instead :
http://forum.xda-developers.com/showpost.php?p=4404512&postcount=9
I was missing your "ip addr..." command to add the forwarding network, this should help, I will give it a try.
I also came to the conclusion that I needed a way to fake that either the wifi or the data connection was up. Maybe this can be done by issuing a "setprop" command forcing the status to being "up"?
enatefox said:
There aren't any other steps you just run what I posted and change "192.168.37.107" to what your desktop's IP is and "192.168.37.100" to "192.168.xxx.100" where "xxx" is the subnet of your LAN-- matching the 3rd set of numbers of your desktop's IP.
You can run these commands over ADB, which is required to do this. Here's a guide on how to set it up.
Click to expand...
Click to collapse
UGH I'm stuck right now. I'm using Ubuntu 9.10, and when I type in terminal "sudo /etc/init.d/udev restart" I get some error message telling me to do it a different way. So even after restarting the computer, it does not recognize any command for adb. I already did the export PATH to the androidsdk/tools folder and adb is in there, but I cannot get it to open. Any ideas?
Got it to see adb. I forgot to put /home/drkow19 in front of the path...
edit: Has anyone successfully used ADB with zen's 2.0.1? I'm trying right now but it shows no devices connected. In the 50-android.rules file I have 0bb4 instead of 18d1 like enatefox said to. Also, on the Dream forums the file they use is 51-android.rules, whats the diff?
0bb4 and 18d1 are determined in the source code. Different versions can change so whichever is shown, use. The 50 and 51 are indicators for timing. Maybe I have this backwards but 51 should start later than 50 and can address issues with it not being recognized or more precisely, overrode with another operation. I set mine to 51.
Okay I deleted 50 and used 51-android.rules. What is the line about "define vendor id" does that need to be in the 51 file?
I can say adb start-server but no devices... They say you need to sudo adb start-server but when I try that I get "sudo: adb: command not found" How do you add the adb PATH so it works under sudo as well?

Reverse Bluetooth-PAN Tethering how to enable? Like XOOM and Transformer, Please!

How can i enable Bluetooth-PAN Tethering for internet access?
Like Xoom and Transformer?
I dont see the connect to internet under the profile.
Am I the only one interested in Bluetooth reverse tethering?
It is way better then using WiFi, Battery last a lot longer on both your phone and tablet, I dont get why Acer does not just enable this! what do they have to lose on it.
Please anyone that knows how to Make roms, can you make a patch to enable this on all roms? it looks like all we really need i just the profile.
cyberma007 said:
Am I the only one interested in Bluetooth reverse tethering? ...
Click to expand...
Click to collapse
Nope, there are alot of people interested, that's why there are around four current threads going about it. No joy yet.
So I did some digging and it looks like google uses http://www.bluez.org/ for their Bluetooth tethering, I am not a program, but all source code and apps are in there, can someone please make a package if possible?
Thanks
Reverse tethering needs work to integrate it better with android..
From the linux side if you run as root (at the command line or in a shell script):
Code:
pand --connect XX:XX:XX:XX:XX:XX
sleep 3
dhcpcd bnep0
setprop net.dns1 8.8.8.8
will connect you to the paired device with ID: XX:XX:XX:XX:XX:XX
(You can probably find the ID for the paired device by name by running as root:
`cat /data/misc/bluetoothd/??:*/names`)
In a post of mine on google plus referring to tethering the Icona A500 through the new pan feature in the HTC Dream ezGingerbread rom I mention a problem I'm having with this however:
This will properly set up networking; and allow basic networking tasks such as browsing the web work.. however any sync tasks will still believe the device is offline thus sync updates and market downloads will not happen.
* FYI the sleep command is really only for automation; dhcpcd will fail if pand is still connecting;
i tried it i get permission denied when i try to execute pand commands
and yes i am su #
i think it has to do with the new ROM 3.2 from 501, because even in adb when i do shell i get access denied.
cyberma007 said:
i tried it i get permission denied when i try to execute pand commands
and yes i am su #
i think it has to do with the new ROM 3.2 from 501, because even in adb when i do shell i get access denied.
Click to expand...
Click to collapse
check /system/bin if the binary exists (I'm still on 3.1).. if not you may need a copy from somewhere
i gave up on the original rom and replace my rom with PRIMEE_AcerIconia-p9-5a.zip
i lose the rear camera, but i dont use it anyway
I have the same problem.
In the other ROMs, I can pair a bluetooth device like my iPhone 4, configure this device pressing settings button and in a section called profiles must be appear "internet".
How can I solve it?
Sorry for my bad english.
I Install nook bluetooth tether.
it works well, you need to pair first and then add widget and activate.
the app was writen for gingerbread so widget acts up, you can activate, but if you try to deactivate you need to go to setting\application and stop the app.
here is the app
https://market.android.com/details?id=earlmagnus.nctether
About BT PAN
In custom rom PRIMEE based on Asus Transformer 8.6.5.6 with my mobile SE W660i Bluetooth PAN works fine.
Yes it does but rear camera stops working

[webOS] [GUIDE] Connect to an Ad-Hoc Network

This guide is assuming you're already in dev mode with Preware installed with all the feeds added. This guide was compiled from several different comments on precentral and PDANET. I've also added my own for deleting a stored wifi profile.
1. Disconnect any current wifi connections and delete all stored Wifi profiles: Navigate to Settings > Wifi > Stored Profiles, Swipe/drag stored profile to right or the left and select delete. Keep the Wifi turned on.
2. Configure your wifi hotspot on your phone to have all lower case ssid with no encryption/password.
3. Launch Preware and find and install Xecutah. This should automatically install xserver and xterm.
4. Launch Xecutah. Start Xserver. Navigate back to Xecutah and Start Xterm. Now go back to the Xserver window. You should now have a green command prompt.
5. In Xterm/Xserver input the following commands:
5a. iwconfig eth0 mode ad-hoc essid WIFINAME
5b. dhclient eth0
5c. echo nameserver 8.8.8.8 >> /etc/resolv.conf
5d. echo nameserver 8.8.4.4 >> /etc/resolv.conf
6. Launch browser and enjoy!
This does not allow the wifi utility to see any ad-hoc networks but just a direct connection to your hotspot.
Hopefully someone makes a script/patch to make it much easier to connect to an ad-hoc network each time.
If your having issues try these commands prior to step 5a:
modprobe ar6000
ifconfig eth0 up
thaddyusmaximus said:
...
2. Configure your wifi hotspot on your phone to have all lower case ssid with no encryption/password.
5. In Xterm/Xserver input the following commands:
5a. iwconfig eth0 mode ad-hoc essid WIFINAME
5b. dhclient eth0
5c. echo nameserver 8.8.8.8 >> /etc/resolv.conf
5d. echo nameserver 8.8.4.4 >> /etc/resolv.conf
Click to expand...
Click to collapse
2)* Using a wifi without encryption is suicidal.
5)* actually the only thing you do with those command is to up the TP network card in ad-hoc mode...nothing to do with connecting to an ad-hoc network, i mean the hotspot is supposed to be a phone or other adhoc only material, not the touchpad.
thaddyusmaximus said:
This guide is assuming you're already in dev mode with Preware installed with all the feeds added. This guide was compiled from several different comments on precentral and PDANET. I've also added my own for deleting a stored wifi profile.
1. Disconnect any current wifi connections and delete all stored Wifi profiles: Navigate to Settings > Wifi > Stored Profiles, Swipe/drag stored profile to right or the left and select delete. Keep the Wifi turned on.
2. Configure your wifi hotspot on your phone to have all lower case ssid with no encryption/password.
3. Launch Preware and find and install Xecutah. This should automatically install xserver and xterm.
4. Launch Xecutah. Start Xserver. Navigate back to Xecutah and Start Xterm. Now go back to the Xserver window. You should now have a green command prompt.
5. In Xterm/Xserver input the following commands:
5a. iwconfig eth0 mode ad-hoc essid WIFINAME
5b. dhclient eth0
5c. echo nameserver 8.8.8.8 >> /etc/resolv.conf
5d. echo nameserver 8.8.4.4 >> /etc/resolv.conf
6. Launch browser and enjoy!
This does not allow the wifi utility to see any ad-hoc networks but just a direct connection to your hotspot.
Hopefully someone makes a script/patch to make it much easier to connect to an ad-hoc network each time.
Click to expand...
Click to collapse
Dude 5C and 5d solved my issue with hotspot on n900 through mobile hotspot and joikuspot both!!!!! Thanks a bunch!
---------- Post added at 05:45 AM ---------- Previous post was at 05:37 AM ----------
ttf said:
2)* Using a wifi without encryption is suicidal.
5)* actually the only thing you do with those command is to up the TP network card in ad-hoc mode...nothing to do with connecting to an ad-hoc network, i mean the hotspot is supposed to be a phone or other adhoc only material, not the touchpad.
Click to expand...
Click to collapse
sigh... actually the only purpose of your post is to ***** about technicalities. Author posted a working solution and you come here and tell him that the title of his thread might not be properly worded... you sir are a GIT...
gill_za said:
Dude 5C and 5d solved my issue with hotspot on n900 through mobile hotspot and joikuspot both!!!!! Thanks a bunch!
---------- Post added at 05:45 AM ---------- Previous post was at 05:37 AM ----------
sigh... actually the only purpose of your post is to ***** about technicalities. Author posted a working solution and you come here and tell him that the title of his thread might not be properly worded... you sir are a GIT...
Click to expand...
Click to collapse
I "*****" about nothing...but you certainly do, i just pointed a fact. 5* are just google DNS btw... .
I suggest you to keep that kind of comment in your pocket... yes the title is wrong and yes "technicalities" matter with that kind of subject.
ttf said:
2)* Using a wifi without encryption is suicidal.
5)* actually the only thing you do with those command is to up the TP network card in ad-hoc mode...nothing to do with connecting to an ad-hoc network, i mean the hotspot is supposed to be a phone or other adhoc only material, not the touchpad.
Click to expand...
Click to collapse
I tried with encryption but could not get it to work. I get I/O errors on the Touchpad when doing the first command with a key. Unless you can figure out how to get encryption working then I will update the post with encryption. I'm not too worried not using any encryption because I can view phone who's connected on my phone. My phone also makes a sound when someone connects to my phone.
The title stays. The Touchpad connects to the ad-hoc network and that is the point of this thread.
thanks!
Do I have to open xecutah and type in the commands each time I want to connect to a ad-hoc network? Even is its the same network?
thaddyusmaximus said:
I tried with encryption but could not get it to work. I get I/O errors on the Touchpad when doing the first command with a key. Unless you can figure out how to get encryption working then I will update the post with encryption. I'm not too worried not using any encryption because I can view phone who's connected on my phone. My phone also makes a sound when someone connects to my phone.
The title stays. The Touchpad connects to the ad-hoc network and that is the point of this thread.
Click to expand...
Click to collapse
Ok fair enough, if you want to use it without encryption, but keep in mind that all traffic will be visible to the all surrounding (password, cookies, etc). A attacker can listen it without a direct visible acces to your link, just by listening (promicious mode). So your choice .
About the touchpad now, the whole point/problem is that it only see Infrastructure/master mode hotspot (maybe an iptables rules, pairing acl, or directly supplicant problem, haven't had the time to figured it out right now).
So if you can see your wifi phone or AP, it's only because it act like a real "AP" hotspot, not an "ad-hoc" hotspot.
To help you to understand what 5* mean let me traduct it:
5. In Xterm/Xserver input the following commands:
5a. iwconfig eth0 mode ad-hoc essid WIFINAME -> on the TP, start the network card (wifi) as an ad-hoc access point with the visible name "WIFINAME"
5b. dhclient eth0 -> Start the TP DNS client (not server or use dhcpd) to listen and work on the device eth0 (wifi card).
5c. echo nameserver 8.8.8.8 -> /etc/resolv.conf -> Add/Push the Google DNS adress 8.8.8.8 to the resolv.conf
5d. echo nameserver 8.8.4.4 >> /etc/resolv.conf ->Add/Push the Google DNS adress 8.8.4.4 to the resolv.conf
* So what you're doing with those lines, is to prepare the TP to act as the ad-hoc access point, as the internet gateway for some other devices: a better title should be: "Start the TP as an ad-hoc access point".
Click to expand...
Click to collapse
So as you can see in your howto there is nothing that help the Touchpad to see/found/resolve the ad-hoc detection of a third party device. If you can see your hotspot that's a good news, but it's all third party hardware related (n900 or whatever).
foshozee said:
Do I have to open xecutah and type in the commands each time I want to connect to a ad-hoc network? Even is its the same network?
Click to expand...
Click to collapse
Unfortunately Yes.
Done all of the above and xterm makes it look as if everything is ok but when trying to surf, just get the no internet connection pop-up. Using Joikuspot on N8 if anyone else has any ideas. Please help me to retire my iPad!!!
Have you deleted the wifi stored profiles on the touchpad? I had the same issue on the using the n8 until I deleted the wifi profiles.
Want to speed things up?
condense:
thaddyusmaximus said:
5a. iwconfig eth0 mode ad-hoc essid WIFINAME
5b. dhclient eth0
5c. echo nameserver 8.8.8.8 >> /etc/resolv.conf
5d. echo nameserver 8.8.4.4 >> /etc/resolv.conf
Click to expand...
Click to collapse
to:
Code:
iwconfig eth0 mode ad-hoc essid WIFINAME;dhclient eth0;echo nameserver 8.8.8.8 >> /etc/resolv.conf;echo nameserver 8.8.4.4 >> /etc/resolv.conf;
1. In xterm execute :
Code:
vi wifi.sh
2. Manually type above blob of text on one line
3. To save and exit: hold down "t", select "þ" character, then choose "[", type ":wq", press enter (you will return to prompt)
4. Chmod by running: "chmod +x wifi.sh", press enter
you're done. Now every time you load xterm and want to connect to same wifi just type:
Code:
./wifi.sh
Code:
Error: No internet connection.
ahh I get it now...your touchpad doesn't "think" it has internet when it really does. This poses several issues. We need a preware patch that tricks the touchpad into thinking it has WiFi. If we could run this from xterm that would also make life easier.
Just used nitrag's condensed code with my HTC Hero and "Wireless Tether for Root Users". Worked perfectly. I had access control enabled and it worked without a problem. Of course after watching a few episodes of Hak5 I wouldn't do any logging in on this connection but otherwise it works very well in a pinch.
Plus you guys have just proved that the hardware is capable of it and the software will allow it. It's just a case of writing a gui for all the users who aren't comfortable in a terminal.
andymck said:
Done all of the above and xterm makes it look as if everything is ok but when trying to surf, just get the no internet connection pop-up. Using Joikuspot on N8 if anyone else has any ideas. Please help me to retire my iPad!!!
Click to expand...
Click to collapse
Try these commands prior to step 5a.
modprobe ar6000
ifconfig eth0 up
4. Launch Xecutah. Start Xserver. Navigate back to Xecutah and Start Xterm. Now go back to the Xserver window. You should now have a green command prompt.
Having some problem here, hope can have guide and assistance from all expert. after i launced Xecutah, i need to minimise Xecutah right?
2. so that i can launch Xserver. after that i need to go back to Xecutah and click Start Xterm right?
3. after i click, whole panel turn grey and after few second, one page appear where i can key in something. up to this stage, am i correct?
4. i don see green command prompt at Xserver, please help
5. the only place i can key in something is at Xterm, but again i face some problem. After i key in (iwconfig eth0 mode ad-hoc essid WIFINAME) - and press enter, nth happen. is this step correct?
6. after step 5, i continue to key in (dhclient eth0)
7. after step 6, many thing appear in the page, am i correct at this stage?
8. after step 7, i can type certain key such as ( (>>)
please help.
i tried to use alternative, where at Xterm, i key in (vi wifi.sh)
same thing happen, i can type ( (>>) and etc
please help.....
appreciate
5. In Xterm/Xserver input the following commands:
5a. iwconfig eth0 mode ad-hoc essid WIFINAME
5b. dhclient eth0
5c. echo nameserver 8.8.8.8 >> /etc/resolv.conf
5d. echo nameserver 8.8.4.4 >> /etc/resolv.conf
4. Launch Xecutah. Start Xserver. Navigate back to Xecutah and Start Xterm. Now go back to the Xserver window. You should now have a green command prompt.
Having some problem here, hope can have guide and assistance from all expert. after i launced Xecutah, i need to minimise Xecutah right? Yes
2. so that i can launch Xserver. after that i need to go back to Xecutah and click Start Xterm right? Yes
3. after i click, whole panel turn grey and after few second, one page appear where i can key in something. up to this stage, am i correct? Yes, it depends on how xterm is configured. I have mine set as green text.
4. i don see green command prompt at Xserver, please help. As long as you can input commands. Doesn't matter what color it is.
5. the only place i can key in something is at Xterm, but again i face some problem. After i key in (iwconfig eth0 mode ad-hoc essid WIFINAME) - and press enter, nth happen. is this step correct? Yes.
6. after step 5, i continue to key in (dhclient eth0). Yes, make sure to delete any wireless profiles in the wifi manager.
7. after step 6, many thing appear in the page, am i correct at this stage? yes should be connected to your phone at this point. You should be able to see text if successful or not. Check your phone to see if any devices are connected to it.
8. after step 7, i can type certain key such as ( (>>) [/COLOR]
please help.
i tried to use alternative, where at Xterm, i key in (vi wifi.sh)
same thing happen, i can type ( (>>) and etc
please help.....
appreciate
5. In Xterm/Xserver input the following commands:
5a. iwconfig eth0 mode ad-hoc essid WIFINAME
5b. dhclient eth0
5c. echo nameserver 8.8.8.8 >> /etc/resolv.conf
5d. echo nameserver 8.8.4.4 >> /etc/resolv.conf
Ok, I thought I knew what an ad-hoc network was but maybe not...
I connect my TP to my Evo 4G hotspot with no problems whatsoever... isn't that adhoc? --- Or did I just get lucky and everything happens to work on mine?
blakjak220 said:
Ok, I thought I knew what an ad-hoc network was but maybe not...
I connect my TP to my Evo 4G hotspot with no problems whatsoever... isn't that adhoc? --- Or did I just get lucky and everything happens to work on mine?
Click to expand...
Click to collapse
I was wondering the same thing... works for me and to the best of my knowledge, our hardware (EVO 4G) only supports ad-hoc, not infrastructure mode.
Any ideas?
Any progress on this? This workaround works but it's annoying to delete wifi profiles each time and enter the commands... Thanks!
Ok so I got my sensation to be read by the touchpad without having to do all that command line stuff. I used the newest WiFi tether. The only things I did was change the ssid to all lowercase with no spaces and then checked enable routing fix in the settings. The touchpad recognized the phone and was able to browse the internets.
Sent from my HTC Sensation 4G using xda premium

[GUIDE] [WIP]How to get a mini bluetooth keyboard to work with FireTV box

I bought a Favi FE02BT-BL mini bluetooth remote and no matter what I did, I couldn't get it to connect through the settings.apk even thou people with the FireTV Stick are able to connect.
This took me to the command line to try a few things so this is as far as I could get.
Fist lets connect to the FTV and enter su
adb connect x.x.x.x
adb shell
$ su
Next we're going to remount the system as rw and download some files to the system
# mount -o remount,rw /system
# cd /system/xbin
# wget http://androidobex.googlecode.com/files/hciconfig
# wget http://androidobex.googlecode.com/files/hcitool
# wget http://androidobex.googlecode.com/files/hidd
# chmod 777 hciconfig
# chmod 777 hcitool
# chmod 777 hidd
# cd /
# mount -o remount,ro /system
Now we can run some commands
# hciconfig
hci0: Type: UART
BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 1021:8 SCO
UP RUNNING PSCAN INQUIRY
RX bytes:41121 acl:373 sco:0 events:1628 errors:0
TX bytes:14569 acl:401 sco:0 commands:666 errors:0
# hcitool dev
Devices:
hci0 xx:xx:xx:xx:xx:xx
On the FireTV go to the settings.apk and go to the bluetooth menu and hit scan
Set your remote to discoverable
# hcitool scan
Scanning
11:11:11:11:11:11 Bluetooth FAVI
#hidd --connect 11:11:11:11:11:11
The light in your keyboard should stop blinking and the keyboard should be connected
THE BAD:
- Mouse pad doesn't work
- Connection is lost when keyboard enters sleep
- Does not reconnect automatically
Any one with better knowledge of Android can probably get this to work 100% so any help would be appreciated.
I was also searching for a way to use my iPazzport Bluetooth keyboard with my Fire TV box, and after several dead ends I finally figured out a working solution! Unfortunately this requires root, but both the keyboard and integrated touchpad seem to function perfectly, and so far it has had no problems reconnecting after waking from sleep. This may also be useful for other Bluetooth devices that will accept a PIN of "0000".
For reference, my Fire TV box is running rbox's pre-rooted 51.1.4.0 ROM and I'm using an iPazzport KP-810-10BTT keyboard.
The first step is to sideload the Settings APK mentioned in several other threads on this forum. Open the app and go to the Bluetooth section. Put your keyboard into pairing mode, press "Scan for Devices" and ensure that it shows up in the list of available devices. Select your keyboard from the list to begin pairing and then press cancel when you see the prompt to enter a PIN.
Connect to your Fire TV using adb, open a shell and run this command:
Code:
logcat -d | grep BTConnectionReceiver
You should see several lines that include "BluetoothDevice: address=<XX:XX:XX:XX:XX:XX>, alias=null, name=<keyboard name>". The XX:XX:XX:XX:XX:XX part is the Bluetooth address of your keyboard. Make note of the first half of this address, you will need it for the next step. For example, the first half of my keyboard's address is 54:46:6B.
Next, in your adb shell, type:
Code:
su
echo FixedPinZerosKeyboardBlacklist=XX:XX:XX > /data/misc/bluetooth/dynamic_auto_pairing.conf
Replace XX:XX:XX with the first half of your device's Bluetooth address. Make sure to use uppercase letters if the address contains any. You can use multiple addresses by separating them with a comma, like this: XX:XX:XX,XX:XX:XX
Now reboot your Fire TV, go back into the sideloaded Settings app and select Bluetooth. Make sure your keyboard is in pairing mode and press "Scan for Devices". Select your keyboard from the list and when you see "Pairing..." under its name, quickly type four zeros (0000) on your Bluetooth keyboard and press "enter". It should now successfully pair and begin working right away. Enjoy!
If the settings app gives you a PIN to type on your keyboard instead, then something went wrong and you should make sure that you followed all the directions carefully and used the right Bluetooth address, using all uppercase letters.
essdee said:
Code:
su
echo FixedPinZerosKeyboardBlacklist=XX:XX:XX > /data/misc/bluetooth/dynamic_auto_pairing.conf
Click to expand...
Click to collapse
Thank you, that worked perfectly with the exception that "logcat" wasn't returning any values so I had to use the "hcitool scan" command from my post.
Weird, I got a bunch of messages in logcat when I tried it on my box, but only after I tried pairing at least once. I also have busybox installed, so that might make a difference too. Glad someone else found the info useful though.
essdee said:
Weird, I got a bunch of messages in logcat when I tried it on my box, but only after I tried pairing at least once. I also have busybox installed, so that might make a difference too. Glad someone else found the info useful though.
Click to expand...
Click to collapse
I have busybox installed as well and I think the reason I don't get anything back is maybe the process name after grep is incorrect.
If I type
Code:
logcat -d | grep Bluetooth
I get a bunch of messages but not with BTConnectionReceiver
essdee said:
The first step is to sideload the Settings APK mentioned in several other threads on this forum.
Click to expand...
Click to collapse
Where can we get this Settings.APK?
Neo3D said:
Where can we get this Settings.APK?
Click to expand...
Click to collapse
Take a look at this thread:
http://forum.xda-developers.com/showthread.php?t=2714494
Hi All,
This seems to be exactly what I need, but I just purchased my AFT and have not been successful in root it. Is there another way of getting this to work (other than obviously purchasing another mini keyboard)?
Thanks,
Jose
josep01972 said:
Hi All,
This seems to be exactly what I need, but I just purchased my AFT and have not been successful in root it. Is there another way of getting this to work (other than obviously purchasing another mini keyboard)?
Thanks,
Jose
Click to expand...
Click to collapse
I don't know of anyway to do it without root.
Why are you unable to root? Did you update the box?
Try to return it and get a new one but this time go to http://www.aftvnews.com/start/ before you plug in the box.
lightning413 said:
I don't know of anyway to do it without root.
Why are you unable to root? Did you update the box?
Try to return it and get a new one but this time go to ... before you plug in the box.
Click to expand...
Click to collapse
It is my understanding that firmare versions past 1/1/15 can no longer be rooted. At least not yet. I looked at the version I have and it does not show up as one of the "rootable" versions.
josep01972 said:
It is my understanding that firmare versions past 1/1/15 can no longer be rooted. At least not yet. I looked at the version I have and it does not show up as one of the "rootable" versions.
Click to expand...
Click to collapse
I bought one a couple of weeks a from Staples and it was rootable.
lightning413 said:
I bought one a couple of weeks a from Staples and it was rootable.
Click to expand...
Click to collapse
I guess no such luck with me... Any other ideas?
lightning413 said:
I bought one a couple of weeks a from Staples and it was rootable.
Click to expand...
Click to collapse
No such luck for me. Any other ideas?
Thanks,
Jose
josep01972 said:
No such luck for me. Any other ideas?
Thanks,
Jose
Click to expand...
Click to collapse
The only one I can think of is to get a FireTV Stick instead of the FireTV.
Eventhou the Stick can't be rooted, they can connect the bluetooth keyboards through the settings.apk app without any issues.
lightning413 said:
The only one I can think of is to get a FireTV Stick instead of the FireTV.
Eventhou the Stick can't be rooted, they can connect the bluetooth keyboards through the settings.apk app without any issues.
Click to expand...
Click to collapse
Thanks for your answer. Has anyone figured out why that is? Is Settings.apk at fault, or does it call some faulty routine that takes over?
Regards,
Jose
I have a bluetooth accessorie kb for my old galaxy 7510 tab. Wonder if I can use for my fire tv?
josep01972 said:
Thanks for your answer. Has anyone figured out why that is? Is Settings.apk at fault, or does it call some faulty routine that takes over?
Regards,
Jose
Click to expand...
Click to collapse
I've spent some time digging around in the Bluetooth configuration files for both the box and the stick, and here's my theory. Although the box and stick run mostly the same software, due to major hardware differences they each use a different Bluetooth stack.
For whatever reason Amazon thought it would be easier/better to use BlueZ with the Fire TV box version even though by default Android 4.2+ comes with BlueDroid(which is what the stick appears to use). It looks like Amazon made BlueZ work well enough for their accessories, but since none of them use a PIN, that part of Bluetooth pairing never got fixed.
essdee said:
The first step is to sideload the Settings APK mentioned in several other threads on this forum. Open the app and go to the Bluetooth section. Put your keyboard into pairing mode, press "Scan for Devices" and ensure that it shows up in the list of available devices. Select your keyboard from the list to begin pairing and then press cancel when you see the prompt to enter a PIN.
Connect to your Fire TV using adb, open a shell and run this command:
Code:
su
echo FixedPinZerosKeyboardBlacklist=54:46:6B > /data/misc/bluetooth/dynamic_auto_pairing.conf
Now reboot your Fire TV, go back into the sideloaded Settings app and select Bluetooth. Make sure your keyboard is in pairing mode and press "Scan for Devices". Select your keyboard from the list and when you see "Pairing..." under its name, quickly type four zeros (0000) on your Bluetooth keyboard and press "enter". It should now successfully pair and begin working right away. Enjoy!
Click to expand...
Click to collapse
This just worked perfectly for me and the FAVI FE02BT-BL. I used the FireTV-Bluetooth-Settings.apk from here http://forum.xda-developers.com/showpost.php?p=58092814&postcount=54
Using this just saved me from returning this device to Amazon! Even the touchpad works. I was just about to return this for the RF version, but now this frees up the USB port for other uses.
post #2 worked perfect for me. I was able to get the bluetooth address off the back of my keyboard and didn't have to run the logcat commands etc. Took literally <1 minute to install the settings.apk and run command, a reboot and <1 minute to pair the keyboard.
Touchpad and keyboard work for me.
Using the Logitech PlayStation 3 Cordless MediaBoard Pro.

Can't set BAUD rate for USB-Serial device

I have an RK3066-based generic 2-DIN Android head unit (see here). I've managed to install a rooted image on it (Yay!).
I want to connect it to a vehicle CAN bus, and I'm trying with an ELM327-based USB to OBD2 adaptor (which includes CAN as one of its protocols).
When I plug it into Ubuntu desktop, I get a "/dev/ttyUSB0". I can access it with Putty terminal and send commands as per the ELM documentation. For primitive access from the command line, I can do this (just to see whether it works at a basic level, without any terminal program):
Code:
sudo stty -F /dev/ttyUSB0 speed 38400
sudo cat /dev/ttyUSB0
And in another terminal:
Code:
sudo sh -c "echo "\r\n">/dev/ttyUSB0"
This produces "> ?" in the first terminal, in line with the expected prompt from the device. Good!
However, I can't get it to work on my Android device.
When plugged in, dmesg reports a Prolific USB-Serial device found and added to /dev/ttyUSB0.
"ls /dev/ttyUSB0" shows that it exists and is owned by "radio".
"stty -F /dev/ttyUSB0 speed" shows the speed is set to 9600 (this is also the default on Ubuntu desktop, and if not changed, the above test doesn't work).
However, I can't change the speed, and the test of sending a character to the decide doesn't work.
I've tried changing the permissions of the serial device (see this post) but it didn't help. I also tried changing to 'radio' with "su radio" but that also didn't work.
Whenever I try "stty -F /dev/ttyUSB0 speed 38400" I get either:
stty: /dev/ttyUSB0: cannot perform all requested operations
Or:
stty: /dev/ttyUSB0: cannot perform all requested operations: No such file or directory
I also tried with a couple of terminal programs including the "Serial Port API sample" app. The device never responds, and I think it is for the same reason (the baud rate isn't set to 38400). Note I can select the baud rate in these programs but I don't think it is actually set - stty still reports 9600.
I feel like I am very close to at least talking to the ELM327 but I am missing something. The Torque app claims to have found the OBD2 adaptor, but I can't actually connect it to a vehicle right now so I don't know if it actually works. In any case I need to access it from my own app.
Wondering if anyone knows the answer to this problem... I can write my own app to access /dev/ttyUSB0 (in theory...) but don't want to waste my time if it's hopeless!
Similar Problem
Hi There --- I'm interested in doing a similar thing to what you're doing...communicating with a usb serial device via the command line in android --- I'm wondering if there's any way to do that without rooting the phone. Like you, I can do it successfully on an ubuntu desktop. I'm specifically trying to do this, you can read about it below.
Thanks and Cheers!
Big Picture: I've attached an arduino uno to an android phone via the micro-usb connection on the phone. My goal is to SSH into the phone over its network or internet connection and then run commands from terminal such as this:
echo -n "h" > /dev/ttyACM0
where h is the character actually sent to the arduino and /dev/ttyACM0 is the hypothetical arduino device as it appears in the linux /dev folder.
Unfortunately i'm stuck and i'm wondering if it's because i need a rooted device in order for this to work.
What I've succeeded in doing so far:
-I successfully sent commands to the arduino uno as above (echo -n "h" > /dev/ttyACM0) using a desktop ubuntu 14.04 linux machine
-I can successfully SSH into the android phone via Putty on a windows computer, while also using the SSHDroid host app from google play on the phone itself. but I cannot access the /dev folder...well, I've looked around using an app that claimed it could show all root accessible files and folders (smart kit 360 on google play) and there were no tty items in the /dev folder. I got an app called "list usb devices" and it gave some other path for the device that was /sys ...but it said i didn't have permission to access that.
-I can successfully send individual character commands from the phone to the arduino uno using another google play app called "DroidTerm" ...similar to the old windows hyperterminal program.
So I've verified that all the individual pieces of this puzzle should work each in a particular context. However, when I try to SSH into the phone and then run the command "echo -n "h" > /dev/ttyACM0"
it throws an error regarding permissions, though I'm surprised it didn't throw an error regarding the existence of /dev/ttyACM0, given the missing tty files i mentioned earlier..I was hoping they were just hidden (if this is the device name "file" on one linux machine, will it be the same on a different linux machine (since android is technically linux?)? I was hoping it would be.
Ideas, known solutions, and alternatives are very welcome!
Alternatives I've tried instead of SSH:
remote control the android device with rc software and control the app droidterm.
I tried that, and it's quite expensive in terms of bandwidth (i don't need to send the whole screen constantly), doesn't allow multi-tasking applications on the phone which i need (yes, I know that android nougat supports multi-tasking but my phone is old and won't load it without serious intervention at the level of rooting that I'd rather not do), and has several other issues that will be problematic.

Categories

Resources