I have a cheap/generic bluetooth keyboard-case that works perfectly in WebOS, but I can't get it to work with CM9! Is there a bluetooth patch or something that I need?
When in the bluetooth menu on CM9 (alpha 2) it says "connected". Also, it is checked off as an "input device" but still nothing when I try to type.
fredmc2020 said:
I have a cheap/generic bluetooth keyboard-case that works perfectly in WebOS, but I can't get it to work with CM9! Is there a bluetooth patch or something that I need?
When in the bluetooth menu on CM9 (alpha 2) it says "connected". Also, it is checked off as an "input device" but still nothing when I try to type.
Click to expand...
Click to collapse
Check the CM9 thread and see if it mentions any Bluetooth incompatibility.
I'll see if I can get your any info on that.
Sent from my MIUI Evo 3D
There is a difference in the way you connect using Android than the way you do with webOS. webOS shows you a "key" and you type the key on the BT keyboard. But in Android, you first generate a key using the TP's onscreen keyboard and then repeat the key using the BT keyboard. You can use any key combination on the TP for a key. "1234" or "8888" are just two examples.
lewmur said:
There is a difference in the way you connect using Android than the way you do with webOS. webOS shows you a "key" and you type the key on the BT keyboard. But in Android, you first generate a key using the TP's onscreen keyboard and then repeat the key using the BT keyboard. You can use any key combination on the TP for a key. "1234" or "8888" are just two examples.
Click to expand...
Click to collapse
My keyboard does connect to the touchpad on CM9 (it says "connected" after I put in the key on the keyboard), however it does not register any button presses. In other words, I am connected but cannot type.
I have even uninstalled CM9 and re-installed from scratch. Still nothing.
I have been sitting here trying to figure this one out too... no luck. I am however trying to use the slim keyboard from my iMac (and magic mouse). Both connect as input devices (they show up as a keyboard and a mouse) but neither of them DO anything in any app or home.
Did anyone end up resolving this issue because it is the exact problem I have now as well?
juzz18 said:
Did anyone end up resolving this issue because it is the exact problem I have now as well?
Click to expand...
Click to collapse
There is a app called Bluetooth Keyboard on the market that should do the trick
Have you tried pairing via terminal?
Sent from my Galaxy Nexus using Tapatalk 2
fredmc2020 said:
I have a cheap/generic bluetooth keyboard-case that works perfectly in WebOS, but I can't get it to work with CM9! Is there a bluetooth patch or something that I need?
When in the bluetooth menu on CM9 (alpha 2) it says "connected". Also, it is checked off as an "input device" but still nothing when I try to type.
Click to expand...
Click to collapse
Up....i have the same problem....
cryomike said:
Up....i have the same problem....
Click to expand...
Click to collapse
this is the part where someone else has this problem. Booted into webOS just to type this. :/
I have this case and I have no troubles connecting with CM9, running the 07/20 nightly. I have found that if I pair it in WebOS, it won't connect properly when I reboot to CM9, but if I tell CM9 to forget it, then turn the keyboard off and back on, I can press the connect button on the keyboard and re-pair it, and it will work properly.
The case fits nice and snug, too, once I slit the bottom of it slightly for a bit more give...it's designed for an iPad, so the Touchpad needs just a hair more space.
you can manually add the hciconfig, hcitool, and hidd binaries to your system/xbin/ directory.
move all three of these binaries to the directory
chmod them to 4755
then you should be able to run the tools from the terminal
pair the keyboard to the touchpad with whatever pin, probably 0000 or 1234 or whatever.
it will probably say paired but not connected
then run hciconfig and it should show you the mac addy of your bluetooth adapter and list the device as hci0
then run hcitool scan
that will show you the mac addy of the keyboard
once you have that then you can connect to it with hidd --connect [macaddyofkeyboard]
verify youre connected properly then by hidd con
that will show you your bluetooth connection to the keyboard and ebverything should work like normal.
you can make a script to connect faster in the future also.
if you want to see more options for these tools you can always hciconfig --help hcitool --help hidd --help
how exactly do i run these?
Vnge said:
how exactly do i run these?
Click to expand...
Click to collapse
you can run them from any terminal emulator, if you create a script you can easily just execute the script each time instead of runnin the tools from the terminal.
Does chmod need a directory or something like that after? I'm going to attempt to write a script for it
Vnge said:
Does chmod need a directory or something like that after? I'm going to attempt to write a script for it
Click to expand...
Click to collapse
ok so maybe i didnt explain it like i should have, im sorry.
dont worry about the script unitl after yove gotten everything working.
so first off make sure bluetooth is on in android settings and pair the keyboard to it
copy the all three bluetooth tools into the touchpads /system/xbin/ folder you can use a file manager that has root permissions like esfile explorer or root filebrowser.
once the files are there then you need to change the permissions of those files. so open a terminal on the touchpad and
$ su
# chmod 4755 /system/xbin/hciconfig
# chmod 4755 /system/xbin/hcitool
# chmod 4755 /system/xbin/hidd
you only need to do that once you dont have to make a script to do that everytime
the rest happens in the terminal or in the script that you make.you will type
# hciconfig
# hcitool dev
# hcitool scan
(when you typw hcitool scan it should show you the keyboard device and mac address)
# hidd --connect (keyboardmacaddress)
# hcitool con (should show the keyboard connected)
that should do the trick aand you should be able to start using he keyboard after that
if youre still haveing trouble give me your keyboards bluetooth mac address and ill write up the script for you.
For me the issue is not that the keyboard is not connecting, but rather that it is not being used as an input device. I tried your instructions and succesfully connected my keyboard, but there was still no input. If I use an app such as bluekeyboard JP that works. Anyone have any ideas?
Sent from my cm_tenderloin using xda premium
How come you guys have to do all that complicated-looking stuff, but I don't? Not complaining (or bragging), just genuinely curious.
haxin said:
ok so maybe i didnt explain it like i should have, im sorry.
dont worry about the script unitl after yove gotten everything working.
so first off make sure bluetooth is on in android settings and pair the keyboard to it
copy the all three bluetooth tools into the touchpads /system/xbin/ folder you can use a file manager that has root permissions like esfile explorer or root filebrowser.
once the files are there then you need to change the permissions of those files. so open a terminal on the touchpad and
$ su
# chmod 4755 /system/xbin/hciconfig
# chmod 4755 /system/xbin/hcitool
# chmod 4755 /system/xbin/hidd
you only need to do that once you dont have to make a script to do that everytime
the rest happens in the terminal or in the script that you make.you will type
# hciconfig
# hcitool dev
# hcitool scan
(when you typw hcitool scan it should show you the keyboard device and mac address)
# hidd --connect (keyboardmacaddress)
# hcitool con (should show the keyboard connected)
that should do the trick aand you should be able to start using he keyboard after that
if youre still haveing trouble give me your keyboards bluetooth mac address and ill write up the script for you.
Click to expand...
Click to collapse
I will definitely try that when I get a chance. but also I am having the issue of the bt keyboard not being used as an input device, out of curiosity, how does this make the keyboard usable for an input device? instead of a connected paperweight?
Vnge said:
I will definitely try that when I get a chance. but also I am having the issue of the bt keyboard not being used as an input device, out of curiosity, how does this make the keyboard usable for an input device? instead of a connected paperweight?
Click to expand...
Click to collapse
thats what the hid is human input device, so when you type hidd --server and hidd --connect youre connecting the device as an input device. you can see more options by typing hidd --help from the terminal
Related
i know we have a few applications that allow us to use our phone's screen and keyboard to control our computer, and while it is cool, it's just not something that i have a use for currently. i was wondering if there were any apps that you know of that allow me to have a window on my comp that is my home screen on my phone and control things on the phone from the comp. i hate when i am working on my themes and i get 100 texts and i have to go from using the comp it using the phone and back and forth. WM had several apps like that and i loved them when i was running windows but now i run linux(ubuntu 8.10) and i would love to be able to type texts and run apps on my phone while using the computer keyboard.
i have looked through the market and can't seem to find anything on there and i was hoping someone could point me to one elsewhere or if i missed one on the market. thanks in advance
That would be cool. A VNC Server has already been ported to iPhone, so it's probably not too difficult for someone who knows what they're doing (i.e, not me =P)
It would definitely be great to be able to type text messages and whatnot using the computer's keyboard and screen instead of that tiny little G1 keyboard.
or if there are some commands i can run from adb shell that would work too, all i have been able to figure out how to do is play an mp3 on the phone by typing the command. cool but not what i would like.
alright, for those that care i have figured out how to start an app on the phone by using the adb shell commands, and i can even start to compose a text if i do it correctly
to start the messaging app you need to type in the adb shell(or android terminal but the point is to be able to do it from the comp
adb shell
am start -a android.intent.action.MAIN -n com.android.mms/com.android.mms.ui.ConversationList
the above line brings up the conversation list to allow you to choose a list, but i have yet to figure out how to atually pick a convo from that page
to bring up the compose message to start a new text type in the following
am start -a android.intent.action.MAIN -n com.android.mms/com.android.mms.ui.ComposeMessageActivity
from there i can input the number to send the message to but not what i want the text to say,
input text <string> #that inputs a single word and no more after the word text
so if i were to type
'input text hello android' my phone would act as if i had just typed hello, this also works on the home screen to search your contacts. i am working on in[utting more than one word and also choosing your conversation from the comp
Cool! nice progress. Maybe other Android intents can be used...
progress
i know i can start any app by knowing the commands for it now and typing it in. but for right now my main concern is getting a multi word string to appear in the text box. if i can get that then i just need to figure out how to attach "input keyevent 66" to it as well so it runs cleanly. key 66 is the enter key and i figured out several others along the way but i will list them later. i pulled the input file from the /system/bin directory and maybe someone else should have a look at it and figure out how to acheive multi word texts without placing "_" between all the words, cause right now that's where i'm at. i'm attaching the file for the guru's to take a look at. obviously it isn't saved as a .txt file on the phone but that's how i uploaded it to here.
CALLING THE ANDROID GURU'S TAKE A LOOK AT THIS
Cool. Once you figure out a bunch of commands, I could try making a user interface for it as a project...
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
juangil said:
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
Click to expand...
Click to collapse
Im not sure if you know that your posting in a forum dedicated to the G1/android but MPT supports, as the name would suggest, motorola phones only.
juangil said:
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
Click to expand...
Click to collapse
does said program work with the G1? i can't imagine moto being nice and making a program that works for everyone else's phone
kp126 said:
Im not sure if you know that your posting in a forum dedicated to the G1/android but MPT supports, as the name would suggest, motorola phones only.
Click to expand...
Click to collapse
yeah I know, my bad.. just wanted to put an example of an app (that of course is only for motorola) for any1 wanting to do something like it
i know there's several out there for different phones, but nothing for android. hell i'd be satisfied if i could just have the emulator read from my phone and let me control it that way. right now i don't like what i have to do to send a text
input text hello
input keyevent 62
input text android
input keyevent 66
that is a whole lot of typing for a simple text that says "hello android" and then sends it
would it be possible to write a program that takes what you type and breaks it into one word or one letter segments and runs the proper keyevent for each charecter there?
from what i remember of my programming in java and visual basic from years ago is that it would basically be set to read an input and use a case method to say if $input=="hello" then adb shell input text hello. it would be easier i would assume to just break it down into words and place "adb keyevent 62" between each word to input the spaces, and at the end of the line of input you would have to have the code "input keyevent 66"
i have the keyevent mapped out for each button and such on the phone if anyone is interested. i will see what i can come up with on my own though for now
Hope!
I would <3 who ever release's this in some form or another =)
I could really use an application that lets me use my phone from my computer. Preferably it'd show the desktop of the phone, and allow remote access to all the features.
I don't know if it's possible, but it sounds like some of you are progressing, so I hope for the best.
that is the goal, but right now i think i want to just get a java script written by the end of the week next week that reads the key i press on the computer and inputs it into the phone. so i have a lot of relearning to do since i haven't written javascript in 4 years and even then it was just simple stuff to be run in a console. if someone wants to take whatever i get done and run with it to make a FREE APP then by all means. if i find my work in a paid app then you better hope the US gov't can't find you cause i'll be at your door ready to kick your ass.
i'm not sure how one would go about coding the computer to display the phone desktop, but however it gets done i would prefer it to be written in java so all users of linux, mac, and windows can use it.
alright i have found a program that allows me to display the phone screen on the computer using java *hooray* but it does not switch to landscape when the phone does, and i can't control the phone from the app. it was written so that people could do presentations with the phone instead of using the emulator. the gist of it is described here
http://groups.google.com/group/cw-android/browse_thread/thread/d2dbcabee6bcba1a
i have already emailed the developer asking politely to see the code and for permission to try and run with it to make the ideal app. at this point the only thing i could come up with would be to make a javascript that had a case for each key on the keyboard and when a key is pressed it sends the corresponding command(adb shell input keyevent ##) to the phone. this would work fine to use the arrow keys to control the phone, and i am not sure how to code the mouse into it yet. i will be waiting for a response from the dev hopefully he will give his permission and blessing for us to use the app.
Tubaking182,
Perhaps I could offer some help. Brad Fitz has written a program that injects keys into the Linux input layer. Perhaps the source code to his project can help you. It appears to contain a key code map. Here is the link to his code:
http://github.com/bradfitz/android-misc/blob/master/type.pl
Also, here is a link to his live journal entry regarding his program.
http://brad.livejournal.com/2400054.html
All of this would be wonderful to have with my G1. I wish all involved the best of luck!
the developer of the program i posted gives his blessing but he claims what we are trying to do is impossible without certain firmware. he claims that android does not support remote control. i have already proven it can be done though but you have to use keyvalues instead of the mouse. i don't know much java, but i know i need a case switch that executes adb shell input keyevent when i press a key on the computer. if someone wants to tell me the proper syntax and java command to run a run a command then awesome i can write this up *hopfully* and start testing it.
would it work if i typed it as
int key = evt.getKeyCode();
switch (key){
case 65: run.exec(adb shell input keyevent 29);
break;
what would be the proper way to execute the adb command
tubaking182 said:
the developer of the program i posted gives his blessing but he claims what we are trying to do is impossible without certain firmware. he claims that android does not support remote control. i have already proven it can be done though but you have to use keyvalues instead of the mouse. i don't know much java, but i know i need a case switch that executes adb shell input keyevent when i press a key on the computer. if someone wants to tell me the proper syntax and java command to run a run a command then awesome i can write this up *hopfully* and start testing it.
would it work if i typed it as
int key = evt.getKeyCode();
switch (key){
case 65: run.exec(adb shell input keyevent 29);
break;
what would be the proper way to execute the adb command
Click to expand...
Click to collapse
I've been doing Java for about 4 or 5 years now, nothing to fancy, but anyway,
Code:
int key = evt.getKeyCode();
switch (key)
{
case 65:
Runtime.getRuntime().exec("adb shell input keyevent 29"); // I dont know if this is what you "run" variable is referring to. and you would need quotes around your command as it takes a String parameter.
break;
Just showed up in the market. Awesome works the 1.5 soft keyboard. Has its quirks but does have some good uses, an update was put out this morning to fix the enter key problem.
great find! it's so hard to sort through the **** apps these days. can't wait until we get a well needed market update.
Just to let people know they have a message saying it doesn't work on some modified Roms. I'm on 6.0h and it didnt work for me. it went into a force close loop even when i wasnt using it.
Its a step in the right direction, but its not all there quite yet. VERY HELPFUL though
1) There is a problem getting the <enter> key working. I find that I need to roll around the scroll button a bit before the enter key will work after starting or switching users.
** another way to deal with this is to use a different shell. For some reason, using full bash instead of sh works. There are other (great) advantages to this (more on that later).
2) You can't see what you're typing when in landscape mode, which is the only way that the VK is actually practical -- keys are too small to use effectively in portrait.
3) If you use a colored shell, the colors screw up when switching to/from the vk. Must be something to do with how he's buffering and redrawing the console.
On using bash instead of sh...
Advantages:
1) color
2) BASH HISTORY
3) scroll wheel = arrow keys
4) lots more -- http://en.wikipedia.org/wiki/Bash
How:
copy bash into some executable part of the filesystem
create a bashrc file anywhere at all in the filesystem.
put in your bashrc the following:
Code:
PS1="[\w]\\$ "
HISTFILE=/some/path/file/with/write/permissions
** this is of course a regular shell script, so add whatever startup code you like in there, like a custom PATH, etc.
IN the "better terminal emulator" program, menu --> preferences --> command line and set it to "/path/to/bash --rcfile /path/to/bashrc"
And of course, running the following:
Code:
su -c "/path/to/bash --rcfile /path/to/bashrc"
will give you root with bash and the same setup as your regular user, including a shared history file (note that the history file is only updated when bash EXITS and so it is current as of the moment you initially LAUNCHED the terminal app.
Note: I like to write that su -c line into a wrapper I call "subash" that I place in the path.
bash is attached for convenience, its a .tar.gz file with an extra extension to confuse the newbs (and trick the forum filter into allowing it).
@lbcoder
Thanks Great tip!
@lbcoder
Thanks Great tip!
using bash as default shell
Id love to use bash, its the shell im used to and since Im not that good at *nix having bash would help, 1 cyanogen rom had ash(i think) and then none of the scripts floating around worked and so they needed to be edited(something that sounds a bit tedious)
Id also like a decent prompt, maybe color ls and all those bells and whistles, I think this could be well received with all the bugs worked out and maybe a script that would make any scripts found on the device into a format that bash needs...
the biggest is the lack of history, I have used a good variety of linux and unix shells and droids is the first without cmd history, a prompt with 'pwd' and tab auto complete...
cant we just get a REAL shell, is that so wrong?
bhang
Job Control
lbcoder said:
On using bash instead of sh...
Advantages:
1) color
2) BASH HISTORY
3) scroll wheel = arrow keys
4) lots more ...
Click to expand...
Click to collapse
Very nice and very useful. Thanks for providing this!
One feature lost in this build of bash: Job Control (^Z, jobs, fg, bg, and %number commands to manipulate jobs). Hitting Ctrl-Z suspends the bash shell and all its child processes.
The existing sh shell supports job control. This build of bash does not.
I'm going to have to learn how to set up a cross-compilation environment. Another project to add to the list...
I like to whipe periodically for that fresh g1 feel and smoothness, only reason I hate doing it is that I have to manually punch in my WEP code for the wifi over and over again. It's an annoyance I would love to get rid of. I've tried a few backup apps, none do it though. Anyone know of a specific app that does, or a way I can do it through term/adb? Any way?
I'm sure there is a way to pull the wifi settings data from the system somehow but I've actually found a gscript which I edited a little that goes through and calls the settings screen, turns on wifi, clicks on the topmost network available (assuming youre near the one you want to connect) and enters the WEP key as defined in the gscript code.
You may be able to find it in the 'useful gscipt' thread that was around on xda but if not, I can post mine (edited of course) as soon as my g1 gets done flashing the latest CM rom. :]
EDIT: Here you go put this in gscript or make an empty txt document, paste the following, edit the bold type to reflect your WEP key, save as setupwifi.sh file and run through terminal "sh setupwifi.sh"
***Requires root / 'su' *** either way you run it.
setupwifi.sh said:
am start -a android.intent.action.MAIN -n com.android.settings/com.android.settings.Settings
sleep 1
input keyevent 20
input keyevent 23
sleep 1
input keyevent 23
input keyevent 20
input keyevent 23
input keyevent 20
input keyevent 20
input keyevent 23
sleep 1
input text CHANGE THIS TO WHATEVER YOUR WEP KEY IS
input keyevent 20
input keyevent 20
input keyevent 21
input keyevent 23
input keyevent 3
Click to expand...
Click to collapse
Just make sure your wifi is turned off for the purpose of this script, since first thing it does is go to settings, clicks wireles, turns on wifi. If you had the wifi on and ran this script, it'll turn off and script will sort of go haywire. No damage but just it wont do what its inteded to do.
It's actually fun to watch your phone do things on it's own and press keys and all that. If you want more details on what each of the keyevent's do, just find the GScript thread and its all in there.
Hello! Sorry for bringing this thread back up. But, before anyone gets angry at me, I'm sorry in advance... I did use the search (trust me, I'm in love with it) and didn't have any luck finding anything other than this.
Anyways, just had a small question: let's say I don't know the wep key because my admin at work put it in for me (they wont share it) but I don't want to ask him every time I flash a rom for it again and again. So I was wondering if the script below would make my device pull the inputted wep key from the device and memorize it after every flash or does it only work if the wep key is inserted?
Is there maybe an app that can just backup data (including wifi wep keys)? or another script that shows you the currently inputted wep key on my device that my admin types in it?
When I had my blackberry the desktop manager backup system would save the wifi wepkeys, don't know why Google wont synchronize settings, data, apps, and wep keys but I guess to each it's own.
I have a T-mobile USA G1
Thank you.
prash said:
I'm sure there is a way to pull the wifi settings data from the system somehow but I've actually found a gscript which I edited a little that goes through and calls the settings screen, turns on wifi, clicks on the topmost network available (assuming youre near the one you want to connect) and enters the WEP key as defined in the gscript code.
You may be able to find it in the 'useful gscipt' thread that was around on xda but if not, I can post mine (edited of course) as soon as my g1 gets done flashing the latest CM rom. :]
EDIT: Here you go put this in gscript or make an empty txt document, paste the following, edit the bold type to reflect your WEP key, save as setupwifi.sh file and run through terminal "sh setupwifi.sh"
***Requires root / 'su' *** either way you run it.
Just make sure your wifi is turned off for the purpose of this script, since first thing it does is go to settings, clicks wireles, turns on wifi. If you had the wifi on and ran this script, it'll turn off and script will sort of go haywire. No damage but just it wont do what its inteded to do.
It's actually fun to watch your phone do things on it's own and press keys and all that. If you want more details on what each of the keyevent's do, just find the GScript thread and its all in there.
Click to expand...
Click to collapse
Wifi settings are located here:
Code:
/data/misc/wifi/wpa_supplicant.conf
Copy the .conf file to a safe place before you wipe and install a new ROM and then push it back using ADB or place it on your sdcard and push it back using terminal.
With this method, there is no way to see what the key is, but then again, you don't have to because once you push the file back, all your data is remembered.
DirectMatrix said:
Wifi settings are located here:
Code:
/data/misc/wifi/wpa_supplicant.conf
Copy the .conf file to a safe place before you wipe and install a new ROM and then push it back using ADB or place it on your sdcard and push it back using terminal.
With this method, there is no way to see what the key is, but then again, you don't have to because once you push the file back, all your data is remembered.
Click to expand...
Click to collapse
Just open wpa_supplicant.conf with notepad on PC and whoops your wep key is there.
Write it on paper and make tatoo of it on your leg
Edit:
Solution(s) witouth PC
Or open it with TxTPad Lite (free on market) directly on phone and read it
Upload wpa_supplicant.conf to dropbox with droidbox free
hey guys,
im using on my htc hero "pTerminal" as my terminal emulator, because the htc does not have a hw keyboard, and other terminals do not have a correct input.
when i type "su" (my phone is rooted), the su requester opens but keeps empty.. other apps can request successfully the root-permissions with su requester (which means in fact, that the requester DOES WORK).
does anyone have suggestions what to do, or if there are alternative solutions (except doing all the stuff via adb shell)
thx in advance
edit: i use the terminal mainly to install debian on the htc (http://www.androidfanatic.com/cms/community-forums.html?func=view&catid=9&id=2248) - seems to be a little bit tricky without hardware keyboard ;-)
make sure USB debugging is enabled
if that does not work for you, try connectBot
connectbot would be perfect, if it would not insert extra signs, example:
when inserting "/" (which is actually on the "l" key) i have to long press on "l" and then connectbot inserts an l and after that an /
latest version r404 has fixed that, even tho the 12# key is still not working
http://code.google.com/p/connectbot/
unfortunately this does not work for me, but now im using the touchpal keyboard, this is doing the job so far.
thanks for your help!
if people have managed to install debian on hero please send a pm to me, maybe we can share information
While this may not be something that most people may want to do, it's something that I wanted to figure out here at work since I have a tri-monitor setup and wanted to use my existing keyboard & mouse on my Atrix's webtop without having to get the HD dock and use a physical KVM. Another obstacle to overcome was the fact that my linux workstation (main machine) is on a separate, wired network from my Atrix, which is connected via a 3G/4G MiFi device. You'll want to make sure you're rooted in both android OS and the webtop OS. You'll also need lxterminal working in the webtop.
So you'll need to get a couple of Jaunty packages compiled for arm:
x11vnc
libvncserver0
Once downloaded, you'll need to get them onto the /osh partition for installation. I do this via adb:
adb push x11vncfiles/ /sdcard/tmp/
adb shell
su
mkdir /osh/tmp
cd /sdcard/tmp
cp *.deb /osh/tmp
sudo -H -u adas bash (switch you to adas user in webtop)
sudo /bin/bash (switches you to root in webtop; you may need to use sulogin)
chroot /osh
cd /tmp
dpkg -i *.deb
exit
Now on to testing...
If you are like me and need to be able to get to the webtop but it isn't on the same network that your desktop/laptop machine is on, you can use the USB cable and adb forward to handle the connectivity. A positive side-effect of this limitation is that x11vnc only needs to listen on the lo (localhost) interface, which helps keep that connection more secure.
LOCAL USB CONNECTION
In lxterminal in the webtop, run the following (as adas) for testing:
export DISPLAY=:0.0
x11vnc -noncache -nolookup -localhost
On your desktop/laptop, run the following:
adb forward tcp:5900 tcp:5900
Using a vnc viewing application (vncviewer, tightvnc, etc), connect to localhost:5900
If all worked out, you should see a remote view of your webtop
REMOTE WIFI CONNECTION
If your Atrix and desktop/laptop are on the same network (or can reach each other via routing), you can do the following steps to test:
In lxterminal in the webtop, run the following (as adas) for testing:
export DISPLAY=:0.0
ifconfig (notate the IP address for eth0)
x11vnc -noncache -nolookup -listen ip_addr_from_prev_step
On your desktop/laptop, run the following:
Using a vnc viewing application (vncviewer, tightvnc, etc), connect to ip_addr_of_atrix:5900
If all worked out, you should see a remote view of your webtop
AUTOMATING THE PROCESS
In order for the x11vnc process to spawn automatically, we need to add it to the lxsession autostart file. This file is read when lxsession starts up and in turn fires off whatever scripts are listed in there. The file is located at:
/etc/xdg/lxsession/LXDE/autostart
By default, the only thing listed in that file is start-oshwt-1.sh, which is a script located at /usr/local/bin. So to get x11vnc working, we add an additional entry into that file:
(as root in webtop): echo start-x11vnc.sh >> /etc/xdg/lxsession/LXDE/autostart
Then we need to create that script in /usr/local/bin:
vi /usr/local/bin/start-x11vnc.sh
Code:
#!/bin/sh
export DISPLAY=:0.0
cd ~
nohup /usr/bin/x11vnc -usepw -forever -nossl -logappend /home/adas/.vnc/x11vnc.log -noncache -nolookup -localhost -nofb -bg
(If you're using it on the same network, replace -localhost with -listen ip_addr like the example above)
Save that file, and make it executable:
chmod +x /usr/local/bin/start-x11vnc.sh
Also, we need to modify Tomoyo to allow it to run that script. Edit /etc/tomoyo/domain_policy.conf and around line 1440:
Code:
<kernel> /osh/usr/bin/lxsession
use_profile 3
Change the 3 to a 2.
Add the following lines to that section:
Code:
allow_execute /osh/usr/bin/x11vnc
allow_execute /osh/usr/local/bin/start-x11vnc.sh
FINAL TOUCHES
I wanted to be able to just move my mouse cursor to the right edge of my desktop machine and have it magiaclly jump to the atrix monitor. To do this, I use a piece of software called x2vnc. If you're using Windows, there's also a package called Win2VNC that will accomplish the same thing. With either software, you run the client (in my case, it's x2vnc) and tell it which direction your vnc server is located at. So to the right of my linux desktop would be east, so I run x2vnc like so:
x2vnc -east localhost:5900
And this connects me to the x11vnc instance running on the atrix. By moving my mouse to the right edge of my main screen, the cursor now appears on the webtop, and I'm able to mouse around and type using my desktop's keyboard.
USING X2X INSTEAD OF X2VNC/WIN2VNC
For anyone that would rather not install any additional packages, and are already running a local X server (XFree/Xorg/Cygwin) you can use x2x to directly connect to the X server running on the Atrix. In order to do this, you'd need to modify /etc/init.d/startXServer.sh and remove the -nolisten tcp from the startx lines and reboot. Then X will listen on port 6000 (for the first display) and that can be used via adb forward on your host machine. The keyboard entry still doesn't work in the Mobile View for some reason...still investigating this. But the mouse seems to function a lot better over native X; selecting text and dragging windows works fine, as does copy & paste.
The top section still applies (you'll need double-root), but the changes are rather minimal:
Code:
adb shell
su
sudo -H -u adas bash
sudo /bin/bash
vi /etc/init.d/startXServer.sh
At the bottom of this script you'll find the lines:
Code:
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
Remove the -nolisten tcp from both of those lines. Save that file.
You'll also need a method of giving your localhost access via xhost. This has to run under the user context that has the primary display (adas). Since I went to this method after the x11vnc method, I already have the /usr/local/bin/start-x11vnc.sh script setup. I modified this to not run x11vnc but to instead disable access controls for X connections:
Code:
cat /usr/local/bin/start-x11vnc.sh
#!/bin/sh export DISPLAY=:0.0
xhost +
With those set, reboot your phone. When ready, relaunch the webtop and either fire up x2x directly or via forwarding over adb like so:
adb forward tcp:6001 tcp:6000
x2x -east -to localhost:1 &
You should now be able to mouse around on your webtop. Typing in terminal, browser, etc works, but Mobile View is still not working. I think I have it narrowed down to that app (aiw) not responding to XKEYBOARD events. I'll know more once I get my usb hub working and can plug in a keyboard.
This is awesome. I noticed that everything works great but then when I try to click into my mobile view and use my keyboard it wont work there. So for instance once my vnc is up, i can type in firefox, lxterminal, etc etc. But once I click into the phones mobile view the keyboard just isnt recognized. Its pretty odd.
Again though. This is great. Thanks.
EDIT: After poking around some more, I guess I was mistaken. I must've been using my BT keyboard when I was typing in Handcent. The keyboard via vnc isn't being passed to the aiw (Mobile View) window. I'll try and get that resolved.
Awesome work. This is sweet.
Synergy?
Has anyone tried installing a program called Synergy?
It's a software KVM that lets you "place" another screen beside your current screen and lets you control it by moving your mouse beyond the edge of your screen. For example, you have a desktop monitor in front of you and a laptop to the left. Running the server program on the desktop (where the mouse and keyboard are plugged in) and the client program on the laptop, after a quick setup, you can move your desktop mouse+keyboard to control the laptop. You can't drag windows or files across but copy+paste does work for text between computers, which is very useful.
It's open source and runs on Linux so I don't see any reason the client software couldn't be installed on the webtop (may have to be compiled from source).
I can't post links in the forum yet but the software is at www dot synergy-foss dot org.
I don't have an Atrix (yet) so I can't test it but if VNC works then I don't see any reason that this shouldn't work.
The default port on Synergy is 24800, so substituting that in the tutorial should allow the same thing to be achieved.
If this works it would be one more reason to get the phone when it comes out in Canada (2 days)!
Yep, I tried synergy first, but unfortunately, it wouldn't work in my situation since the synergyc (client) runs on the phone and tries to connect to the syngerys (server) on my PC. I can't redirect ports in that direction over USB, so x11vnc it was.
For those on the same network, there's no reason it wouldn't work just fine. I actually use synergy on the other side of my tri-monitor setup to control our 50" plasma when doing demos and whatnot.
D'oh
I was hoping this was a "got usb host working" thread
Oh well...
/me begins learning about his phone to get that project started.
Does the hdmi cable need to be connected to phone after we setup vnc server to run automatically ? What happens after reboot without cable plugged in ..
The x11vnc server will autostart whenever the webtop is started for the first time. After that, I believe that entire X instance runs in the background. It's just idle, waiting for the next time you connect the hdmi cable/dock.
x2vnc auto reconnects by default, but for those that are forwarding tcp ports via adb, you'll have to recreate the port forward prior to it reconnecting.
agentdr8 said:
The x11vnc server will autostart whenever the webtop is started for the first time. After that, I believe that entire X instance runs in the background. It's just idle, waiting for the next time you connect the hdmi cable/dock.
Click to expand...
Click to collapse
Was your hdmi cable always plugged in your testing ?
I just tested this right now; disconnected both cables and rebooted. Once the phone was fully up, I plugged in usb and adb shell'd in:
Code:
[email protected]:~# ps aux | grep x11vnc
Unknown HZ value! (176) Assume 100.
root 4351 0.0 0.0 1648 528 ? S+ 08:42 0:00 grep x11vnc
[email protected]:~# uptime
Unknown HZ value! (171) Assume 100.
08:42:39 up 2 min, 0 users, load average: 2.29, 1.29, 0.50
[email protected]:~#
And then I plugged the hdmi in, selected Webtop from the popup, and reran that above:
Code:
[email protected]:~# !ps
ps aux | grep x11vnc
adas 4645 0.2 0.2 9832 2020 ? Ss 08:44 0:00 /usr/bin/x11vnc -usepw -forever -nossl -logappend /home/adas/.vnc/x11vnc.log -noncache -nolookup -localhost -nofb -bg
root 5258 0.0 0.0 1652 548 ? S+ 08:44 0:00 grep x11vnc
[email protected]:~# uptime
08:44:36 up 4 min, 0 users, load average: 1.26, 1.16, 0.53
[email protected]:~#
Not sure if usb host without a Motorola media hub / lapdock has been mentioned. I managed to get my Atrix working with full usb host by applying 5vdc to the usb power rail. Seems to work with any usb hub and keyboard / mouse combo long as 5vdc is present on the host side(phone microusb connector). This works in both webtop and normal android shell.
agentdr8 said:
EDIT: For anyone that would rather not install any additional packages, and are already running a local X server (XFree/Xorg/Cygwin) you can use x2x to directly connect to the X server running on the Atrix. In order to do this, you'd need to modify /etc/init.d/startXServer.sh and remove the -nolisten tcp from the startx lines and reboot. Then X will listen on port 6000 (for the first display) and that can be used via adb forward on your host machine. The keyboard entry still doesn't work in the Mobile View for some reason...still investigating this. But the mouse seems to function a lot better over native X; selecting text and dragging windows works fine, as does copy & paste.
Click to expand...
Click to collapse
Hey, this is great. I was wondering if you could make more of a step by step guide for this portion. I'm currently in the middle of getting Cygwin but just in case anything goes wrong haha. Thanks.
^^ Sure thing. I'll update the first post tomorrow.
usb host...?
@callen81 - You got USB host working?! I am highly interested in how this would work, but by applying 5v DC to USB, I don't exactly get what you mean. Could you possibly post a guide? I know a TON of people on this forum would love to hear how exactly you did it.
It's as easy as it sounds; you just connect a micro usb togo cable to a hub and make sure power goes back to the phone. Usually most hubs have a diode to make sure power can only come from the host port not to it. So I just hardwired +5vdc from the hub power socket.
Great work callen. Will give it a try. You may want to draw up a simple schematic or maybe some pics and start a new post in Dev or Accessories so others can benefit from your discovery.
agentdr8 said:
Great work callen. Will give it a try. You may want to draw up a simple schematic or maybe some pics and start a new post in Dev or Accessories so others can benefit from your discovery.
Click to expand...
Click to collapse
I just made a small film.
http://www.youtube.com/watch?v=shvFmLRUNGA
so agentdr8, great guide but im just havin to much trouble with tryin to get x2x workin. its bein a pain with cygwin on my windows box, and too much work for my osx box. im wonderin, would it be hard to just get X workin forwardin the webtop session straight over like ssh or even telnet :/
I haven't tried redirecting the entire webtop X session to a different X server...not sure how that would work out.
I did try some simple ssh forwarding and that works fine. You'd need to install openssh-server, openssh-client, and grep packages (use -i --force-overwrite for grep). You can then tunnel whatever you want over that ssh connection to the phone.