maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   N900 Working Bluetooth Mouse (https://talk.maemo.org/showthread.php?t=57427)

azerty1 2010-06-29 20:33

N900 Working Bluetooth Mouse
 
1 Attachment(s)
I had been hoping to have this working properly (in an acceptable form) for a while, I know that once paired you can actually "move" the mouse arround if done very very slowly; supposedly, doing xorg.conf modifications would take care of the sensitivity problem but even though I tried I couldn't make it be any less sensitive, at the same time you can't click at anything, seemingly only the wheel generates click events. So since it hasn't worked for me I tried a different approach and here it is..., it's not 100% perfect, but still, much better than the joke that it was.

DISCLAIMER: THIS SOLUTION COMES AS IS, IT COMES WITH NO WARRANTIES WHATSOEVER EXPRESSED NOR IMPLIED, TRY IT AT YOUR OWN RISK, ALTERING YOUR DEVICE WILL DEFINETLY GIVE YOU SOME GRIEF. EVEN THOUGH I HAVEN'T EXPERIENCED PROBLEMS WITH THIS PARTICULAR SOLUTION, I HAVE HAD TO REFLASH MY DEVICES SEVERAL TIMES AFTER GETTING, FOR INSTANCE, REBOOT CYCLES WHILE TRYING CUSTOM KERNELS. YOU COULD END UP LOOSING ALL YOUR CUSTOMIZATIONS AND APPS OR WORSE, SO BE SURE TO BACKUP FIRST AND KEEP IN MIND THAT THERE'S DATA LOSS OR WHO KNOWS WHAT OTHER RISKS INVOLVED.

Requirements:
- WARNING! WARNING!: Make sure you have your Internet Connection set to automatically connect to WiFi and also make sure that you have installed and configured SSH server and also make sure that you can connect to your device using an SSH client prior to trying this. In the event of something going wrong (like loosing both touch and keyboard) this is the only known way to rescue your device without having to re-flash your rootfs. If you're doing this procedure manually make sure that you're doing this as 'root' and double check that the new 'evdev_drv.so' looks good inside '/usr/lib/xorg/modules/input' before rebooting.
- As pointed in post #29 (thanks jackspost!) it is best to unpack the tarball inside your /home/user directory in order to be able to execute 'xsetroot' and the other scripts; if unpacked inside MyDocs, the default mask is missing execution permissions (and you can't change them using chmod) so you would be getting "permission denied" errors.
- Root (Install rootsh from App. manager)
- Paired Bluetooth Mouse (You'll have to enable the HID profile, refer to http://wiki.maemo.org/Fremantle_Unsu...tooth_profiles)
- Tested with PR 1.2 stock kernel, no idea how it would behave under a different configuration

Attached you will find a new evdev_drv.so that should take care of properly handling your bluetooth mouse (hopefully most mice), you need to have root (rootsh) in order to replace the original file. You can use the provided "install.sh" script or here's how to do it manually (assuming you unpacked everything in /home/user/):

Code:

sudo gainroot
cd /usr/lib/xorg/modules/input
mv evdev_drv.so evdev_drv.so.orig
cp /home/user/N900-BluetoothMouseSupport/evdev_drv.so .

The following needs to be done in order to have mouse pointer visible in some places, namely text boxes, and it might be a requirement to have full cursor visibility (described later).

Code:

cd /usr/share/icons/default/cursors
mv transp trans.orig
cp /home/user/N900-BluetoothMouseSupport/arrow transp

Now reboot. Once your mouse connects to your device (move, click, your Bluetooth icon should turn blue) you should have a more consistent behavior, you won't see a pointer just yet, but trying moving your mouse all the way up and left, then try left clicking, you should get the dashboard or app. menu. Now, do you want to see the cursor? Open notes, it should be visible in the white text area, clicking doesn't work as expected here, this still needs some fixin'. Do you know where it works very nicely?, Easy Debian (thanks for your hard work here qole!), it's a nice experience I tell you, left-click, middle-click, right-click all of them work as they should, drag and drop works just fine too..., connect a bluetooth keyboard, plug to your TV and you've got yourself a truly portable Linux computer!

And last, but not least, Full Mouse Pointer Visibility.

Code:

apt-get install libxmuu1
cd /home/user/N900-BluetoothMouseSupport
./xsetroot -cursor_name arrow

You should now see the arrow anywhere you touch or anywhere you move your mouse pointer to ;-) Having this is just great, you can go in and out of your regular Maemo applications, for instance App. Manager, browse the list, just drag with left-click, or use the wheel..., click, click, and done, click dashboard, go to media player, start some song or video while your applications are being installed, click dashboard, click conversations, have a little chat..., etc. Very cool..., the only place where things just doesn't work is the Web Browser, it's definitely handling thigns differently here, click and right click work OK in the address bar, but they don't in the actual browser area, and it should be just a trick because I have had clicking working in there before I'm just not sure how, perhaps someone might find out.

When you'd like to hide the pointer just do this:

Code:

cd /home/user/N900-BluetoothMouseSupport
./xsetroot

NOTE: You can also use the provided 'showmouse'/'hidemouse'.

Known Issues:

- Sometimes (especially after the screen goes to sleep) the pointer is stuck in the left-top corner and it won't move from there, just click once and it'll move normally again.
- Scroll wheel doesn't work in the app. menu, hold left click and drag, it's apparently just not supported here.
- Under some circumstances while moving the pointer it might lag to catch up (i.e. keep doing circles at medium speed). Do sequential (not constant) moves and it won't bother you, will try to fix this soon. BTW, if you're in a heavy WiFi zone (lots of APs, or whatever that uses 2.4 GHz, microwave oven, cordless phones), this behavior might be related to interference as I have noticed.
- The cursor isn't visible while over the browser area (I guess their large, ugly cursor takes precedence?), still shows in address bar and the top bar. The following is workaround suggested by freemangordon (thanks!), post #24:

Code:

edit following line in /etc/X11/Xsession.d/04b_start_matchbox
/usr/bin/matchbox-window-manager -theme $THEME -use_dialog_mode static -use_cursor yes &

- It is not possible to click inside the browser either, even though you can click in the address bar and the buttons on the sides. The only thing that kinda works ATM inside the browser area is zooming in/out, by holding your left-click and doing circles clockwise/anti-clockwise. Trying to fix it..., but they really made it hard for the mouse to work here..., if the mouse just worked as well here as in maps..., why mess it up!? good grief...
- You don't want to use your laptop anymore :-)

See this working on YouTube: http://www.youtube.com/watch?v=PaNz4uM-29Q

UPDATE: Trying to improve/fix things, I'll create a poll with the items that are being taken care of, please vote for the ones you want to have done sooner.

I'm glad you guys are liking this, thanks for your support and the nice things you're saying! I do really appreciate it! I'm trying to reply to posts as much as I can..., hang in there!

akashbhavsar 2010-06-29 20:38

Re: N900 Working Bluetooth Mouse NOW!!!
 
Sounds great! I'm gonna try this... :)

antezz 2010-06-29 20:42

Re: N900 Working Bluetooth Mouse NOW!!!
 
May i kiss you? >: )

mohannad 2010-06-29 20:44

Re: N900 Working Bluetooth Mouse NOW!!!
 
Welcome to the forum and thank you for this amazing effort!

rajil.s 2010-06-29 21:07

Re: N900 Working Bluetooth Mouse NOW!!!
 
What brand of bluetooth mouse are you using?

quipper8 2010-06-29 21:12

Re: N900 Working Bluetooth Mouse NOW!!!
 
amazing work. thanks so much

quipper8 2010-06-29 21:16

Re: N900 Working Bluetooth Mouse NOW!!!
 
For an extra 2 or 300 dollars, every single new TV out there should have something like this integrated into it

here comes meego....

ZogG 2010-06-29 21:24

Re: N900 Working Bluetooth Mouse NOW!!!
 
that's the way we all should write the first post. thank you.

Tinnet 2010-06-29 23:56

Re: N900 Working Bluetooth Mouse NOW!!!
 
This somehow made it impossible to use the touchscreen. and since bluetooth and wifi arent turned on automatically I am left without a solution to revert back to defaults. hmm :/

azerty1 2010-06-30 01:35

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by Tinnet (Post 734791)
This somehow made it impossible to use the touchscreen. and since bluetooth and wifi arent turned on automatically I am left without a solution to revert back to defaults. hmm :/

Sorry to hear about your problem, but this solution shouldn't interfere with the touchscreen at all, I have been testing this for days and haven't had any issues, I'm using stock kernel, so if you're using something different, although unlikely, it might be the problem.

As for a possible solution to your situation, at first, when I was experimenting with several approaches I lost touch input several times, and my WiFi connection was also set to "Always ask" and bluetooth off or useless..., workaround? press Ctrl-Shift-x on your N900 and you should get a terminal, revert to your old driver and try to find out what might be wrong...

Now, if you did the changes manually and the evdev_drv.so file was named differently, your keyboard might not work either, in this case the only solution I know is to reflash rootfs, if someone knows how to get access to rootfs on a device in this condition (or even better, when it waiting to be flashed) it would be great to know.

Perhaps you could try putting it in R&D mode, it does some wonders from time to time with its "oh so cool" black magic.

imperiallight 2010-06-30 01:42

Re: N900 Working Bluetooth Mouse NOW!!!
 
Great! Has been on my sig wishlist for ages!!

Tinnet 2010-06-30 02:12

Re: N900 Working Bluetooth Mouse NOW!!!
 
Thanks for the answer.
Indeed keyboard does not work either, and im not able to use the flasher lol (ubuntu and w7 both x64). Guess i'll have to lend an x86 machine tomorrow.

DarkShadowSwE 2010-06-30 09:50

Re: N900 Working Bluetooth Mouse NOW!!!
 
my logitech mouse dont seem to work , :/

F2thaK 2010-06-30 10:05

Re: N900 Working Bluetooth Mouse NOW!!!
 
someone needs to *.deb this !

GREAT WORK SON!

freemangordon 2010-06-30 10:26

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by azerty1 (Post 734576)
- Under some circumstances while moving the pointer it might lag to catch up (i.e. keep doing circles at medium speed). Do sequential (not constant) moves and it won't bother you, will try to fix this soon. BTW, if you're in a heavy WiFi zone (lots of APs, or whatever that uses 2.4 GHz, microwave oven, cordless phones), this behavior might be related to interference as I have noticed.

This could be because bt hid driver has buggy sniff mode support, later i will post patches i have made to my n900 to overcome the issue, so you can try if it solves it

Quote:

Originally Posted by azerty1 (Post 734576)
- The cursor isn't visible while over the browser area (I guess their large, ugly cursor takes precedence?), still shows in address bar and the top bar.

while playing recently with my bt mouse, i found that if you open a site containing flash then cursor appears in browser and remains there until reboot.

P.S.

I am not using your solution to use bt mouse,so above may not be your case. I use much simpler approach to show the cursor, so will will post further details/instructions when I am back to my home desktop

Farooq 2010-06-30 10:48

Re: N900 Working Bluetooth Mouse NOW!!!
 
Will the mouse cursor work on conversations?
and which one is the best BT mouse for this

Regards

Bec 2010-06-30 14:31

Re: N900 Working Bluetooth Mouse NOW!!!
 
Well done! I've been really waiting for this :D

azerty1 2010-06-30 16:21

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by DarkShadowSwE (Post 735181)
my logitech mouse dont seem to work , :/

Does your bluetooth icon turns blue once you move/click your mouse? If it doesn't it could be a pairing problem, try installing bluez-compat and then go to terminal as root and try manually connecting to your mouse using its address "hidd --connect 00:00:00:00:00:00"

Could anyone report success? Just want to make sure it's working for someone else besides me.

azerty1 2010-06-30 16:25

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by Farooq (Post 735244)
Will the mouse cursor work on conversations?
and which one is the best BT mouse for this

Regards

I gave it a try and it does work in conversations.

I don't know, I would expect that any mouse works well, I have tried Microsoft and Logitech mice with success.

azerty1 2010-06-30 16:56

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by freemangordon (Post 735218)
This could be because bt hid driver has buggy sniff mode support, later i will post patches i have made to my n900 to overcome the issue, so you can try if it solves it



while playing recently with my bt mouse, i found that if you open a site containing flash then cursor appears in browser and remains there until reboot.

P.S.

I am not using your solution to use bt mouse,so above may not be your case. I use much simpler approach to show the cursor, so will will post further details/instructions when I am back to my home desktop

Somehow I got the pointer to appear on the browser, but lost it after showing and hiding their large cursor, couldn't make it reappear even after going to youtube and playing a video... BTW, are you able to click/right-click scroll in the browser with your bt mouse? My guess is that it only reacts to BTN_TOUCH and ignores all the others... I'll need to try a few other things.

rebelnoob 2010-06-30 17:48

Re: N900 Working Bluetooth Mouse NOW!!!
 
if an application is available in extras-devel i would try!!

asys3 2010-06-30 19:02

Re: N900 Working Bluetooth Mouse NOW!!!
 
I just installed the mouse driver, connected my bt mouse and saw the arrow.
But I can't move it :mad:

Is there a device created by the driver on which I can do a tail or cat?
So that I can see if there comes any input from my bt mouse?

Regards,
asys3

smoss 2010-06-30 19:44

Re: N900 Working Bluetooth Mouse NOW!!!
 
€hampion!! This is awesome!!!! hope it works with quake 3

freemangordon 2010-06-30 19:50

Re: N900 Working Bluetooth Mouse NOW!!!
 
1 Attachment(s)
Quote:

Originally Posted by azerty1 (Post 735701)
Somehow I got the pointer to appear on the browser, but lost it after showing and hiding their large cursor, couldn't make it reappear even after going to youtube and playing a video... BTW, are you able to click/right-click scroll in the browser with your bt mouse? My guess is that it only reacts to BTN_TOUCH and ignores all the others... I'll need to try a few other things.

Maybe it is because the method you are using for showing up the cursor. You can try this instead :

edit following line in /etc/X11/Xsession.d/04b_start_matchbox
/usr/bin/matchbox-window-manager -theme $THEME -use_dialog_mode static -use_cursor yes &

Assuming you already have changed transparent cursor to good one then above should give you visible mouse cursor even in moving dots screen(right after reboot). It disappears after a while (hildon desktop hides it) but opening a site with flash (not sure if you need to open flash in full screen, but give it a try) should restore the cursor even in browser. Did not investigate this further, but seems great adobe product sets root X window cursor to its own.

Re your question - I am not able to use mouse in microb, and it seems that not only BTN_TOUCH event is expected, but some pressure threshold too. Recently I was on the way of modifying evdev so instead of BTN_MOUSE a BTN_TOUCH event to be generated on left click, but didn't have time to do it :( .

Please find attached archive with bluetooth.ko module for both kernel-power37 and original nokia kernel(PR1.2). This one should cure laggy mouse movement. Just in case both modules are incompatible with your kernel - the actual patch is in hci_event.c, function hci_mode_change_evt :

/*if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
if (conn->mode == HCI_CM_ACTIVE)
conn->power_save = 1;
else
conn->power_save = 0;
}*/


I think you can use hci_event.c from attachment as direct replacement, as I think this file is same in both PR1.1.1 and PR1.2

Give it a try (backup your own bluetooth.ko just in case), the worse that could happen is that one will lose bluetooth until original module is copied back.

In attached zip you can find my version of evdev.c, so you can diff it with yours, just in case my extraterrestrial programming skills have added something valuable there :D

Thanks for your efforts on this matter, and if you need help - count on me

Regards and sorry if my English is not so good

F2thaK 2010-07-01 01:21

Re: N900 Working Bluetooth Mouse NOW!!!
 
damn i wanna try this

KingKobraone 2010-07-01 10:25

Re: N900 Working Bluetooth Mouse NOW!!!
 
hey

i have the same problem

touchscreen and Keyboard dont work

what can i do ?

only flash?

wifi and bluetooth are disabled =(

freemangordon 2010-07-01 12:18

Re: N900 Working Bluetooth Mouse NOW!!!
 
azerty1: Will you please update you initial post and include some kind of advice for user to set WiFi to automatic before copying evdev_drv (and to install ssh if not already), so in case touch/keyboard is unusable after reboot one to have option to log into the system and restore evdev_drv

KingKobraone: you can try to bring up USB network (using Linux, not Windows) , ssh in the system and restore original evdev_drv.so.

KingKobraone 2010-07-01 12:49

Re: N900 Working Bluetooth Mouse NOW!!!
 
i have ubuntu on my pc at home:rolleyes:
but i donīt know this fukntion.:(
thanks for this information than i dont flash the device now
first i will try this

you have maybe some tutourials or something?:confused:
have you icq msn skype ??

sry my english is not good


KingKobraone
(german)

jackspost 2010-07-01 13:16

Re: N900 Working Bluetooth Mouse NOW!!!
 
hello,

typing

./xsetroot -showmouse

gets

-sh: ./xsetroot: Permission denied error.

Trying to chmod +x don't work.


I can add Logitech MX900 Mouse, but can't connect. bluetooth symbol stay gray, not blue.

Why is there a permission denied?

thanks for any help!


add:

Ok nice, now it works.
had to move N900-BluetoothMouseSupport folder to /home/user to set user rights.

Also following this thread to connect Logitech mouse:
http://talk.maemo.org/archive/index.php/t-33517.html

is there a way to autostart this on boot-up?

freemangordon 2010-07-01 13:33

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by KingKobraone (Post 737033)
i have ubuntu on my pc at home:rolleyes:
but i donīt know this fukntion.:(
thanks for this information than i dont flash the device now
first i will try this

you have maybe some tutourials or something?:confused:
have you icq msn skype ??

sry my english is not good


KingKobraone
(german)

First of all you should have ssh installed on your device, otherwise the only option is reflash.

Here http://wiki.maemo.org/N900_USB_networking is wiki page with instructions re USB networking. As you cannot type ifup usb0 on n900 try to bring up usb0 on ubuntu box after attaching usb cable (same ifup usb0 command) - hopefully this will bring up usb0 on n900 too as it is set up as auto in /etc/interfaces. If above seems complicated here http://wiki.maemo.org/Updating_the_firmware is wiki page with instructions on howto reflash

Veix 2010-07-01 14:58

Re: N900 Working Bluetooth Mouse NOW!!!
 
Waiting for Quake3 video with BT keyboard+mouse and tv-out :)

Trek1701 2010-07-01 20:27

Re: N900 Working Bluetooth Mouse NOW!!!
 
Razer Orochi BT mouse working 100%. Thanks a lot azerty1!

qole 2010-07-01 21:48

Re: N900 Working Bluetooth Mouse NOW!!!
 
Thank you very much. This is one of the missing pieces needed to make the N900 into a Real Computer.

qole 2010-07-01 21:56

Re: N900 Working Bluetooth Mouse NOW!!!
 
I'm not clear about this...

The modified evdev_drv.so is not safe? It might cause your keyboard to stop working? Or the driver is safe, but you might lose your keyboard if you make a mistake?

Can you install the new driver before pairing the mouse, or does the new driver interfere with the pairing somehow?

I'm asking this because it would be fairly simple to make a package that installs the new driver and enables BT HID support, but I don't want to do that if the driver may cause serious problems.

Trek1701 2010-07-01 22:07

Re: N900 Working Bluetooth Mouse NOW!!!
 
@qole

These are the steps I followed:

1. remove the "input" from /etc/bluetooth/main.conf
2. replace the "evdev_drv.so" file
3. move "transp" and copy "arrow" file
4. install the bluez-compat from here
5. install libxmuu1
6. paired Razer Orochi BT mouse (was necessary to run hidd --search on terminal first)
7. reboot
8. run ./showmouse

And done.

azerty1 2010-07-01 23:16

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by freemangordon (Post 736994)
azerty1: Will you please update you initial post and include some kind of advice for user to set WiFi to automatic before copying evdev_drv (and to install ssh if not already), so in case touch/keyboard is unusable after reboot one to have option to log into the system and restore evdev_drv

KingKobraone: you can try to bring up USB network (using Linux, not Windows) , ssh in the system and restore original evdev_drv.so.

A WARNING has been added. Thanks for sending your files and for your help freemangordon! (your English is great BTW) I'm in the process of incorporating your stuff (while trying to fix that dang browser too!)

F2thaK 2010-07-02 05:24

Re: N900 Working Bluetooth Mouse NOW!!!
 
bought one of these yesterday, cant wait

http://www.crazysales.com.au/2-4ghz-...utm_medium=cpc

F2thaK 2010-07-02 05:26

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by qole (Post 737899)
Thank you very much. This is one of the missing pieces needed to make the N900 into a Real Computer.

SO true..

..........

freemangordon 2010-07-02 07:14

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by azerty1 (Post 737972)
A WARNING has been added. Thanks for sending your files and for your help freemangordon! (your English is great BTW) I'm in the process of incorporating your stuff (while trying to fix that dang browser too!)

Wish you luck fixing the browser, but I have feeling that this is a dead end for microb without patching/recompiling. Yesterday I installed mozilla 1.1 and with little tweaking it has mouse cursor in web pages. Mouse is 100% working in mozilla. If anyone is interested here is how to show pointer in mozilla(1.1):

edit

/opt/mozilla/fennec-1.1/chrome/chrome.manifest

and add following line

override chrome://browser/content/cursor.css data:text/plain,<nada/>

Sure same effect can be acheved in a different way (even maybe on the fly), but some with more knowledge on mozilla should advice how.

Re poll questions -

showing/hiding mouse pointer can be done automaticly trough hal fdi script(think so :) ), so when mouse is paired/connected cursor to appear (and to disappear when unpaired/disconnected). What I am thinking is a control panel extension to select for which BT device[s] this to happen, so no end user has to modify scripts by hand.

lag that some people (including me before bluetooth.ko patching) have I'm 99 percent sure is due to bluetooth subsystem

BTW did you try bluetooth.ko and evdev_drv.so that I am using (those from attachment)? If yes - is mouse movement still erratic?

Cheers

DarkShadowSwE 2010-07-02 09:41

Re: N900 Working Bluetooth Mouse NOW!!!
 
Quote:

Originally Posted by Trek1701 (Post 737916)
@qole

These are the steps I followed:

1. remove the "input" from /etc/bluetooth/main.conf
2. replace the "evdev_drv.so" file
3. move "transp" and copy "arrow" file
4. install the bluez-compat from here
5. install libxmuu1
6. paired Razer Orochi BT mouse (was necessary to run hidd --search on terminal first)
7. reboot
8. run ./showmouse

And done.

i got down to part 6... , the bluetooth icon goes blue and then white again after 0.5 sec , -.-


All times are GMT. The time now is 01:12.

vBulletin® Version 3.8.8