<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Benny's Blog &#187; keyboard</title>
	<atom:link href="http://blog.projectnibble.org/tag/keyboard/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.projectnibble.org</link>
	<description>House Of Code</description>
	<lastBuildDate>Fri, 13 Aug 2010 15:06:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>How to connect a bluetooth keyboard in Ubuntu 9.04 Jaunty and 9.10 Karmic (workaround)</title>
		<link>http://blog.projectnibble.org/2010/01/28/how-to-connect-a-bluetooth-keyboard-in-ubuntu-9-04-jaunty-and-9-10-karmic-workaround/</link>
		<comments>http://blog.projectnibble.org/2010/01/28/how-to-connect-a-bluetooth-keyboard-in-ubuntu-9-04-jaunty-and-9-10-karmic-workaround/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 21:54:57 +0000</pubDate>
		<dc:creator>Benny Bottema</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.projectnibble.org/?p=374</guid>
		<description><![CDATA[Here&#8217;s a quick workaround for connecting and reconnecting a bluetooth keyboard (or any bluetooth device for that matter) in Ubuntu Jaunty and Karmic, even after rebooting. In short it&#8217;s a shell script that keeps connecting to your device in the background on a regular interval. Dirty? Absolutely. Does it work? Absolutely, no bluetooth configuration required [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick workaround for connecting and reconnecting a bluetooth keyboard (or any bluetooth device for that matter) in Ubuntu Jaunty and Karmic, even after rebooting. In short it&#8217;s a shell script that keeps connecting to your device in the background on a regular interval. Dirty? Absolutely. Does it work? Absolutely, no bluetooth configuration required at all.</p>
<p><span id="more-374"></span></p>
<p>Originally, this whole workaround came from a <a href="http://ubuntuforums.org/showthread.php?p=8739447#post8174091">post on ubuntuforums.org</a> by Unkie, which I modified only slightly (I&#8217;m plantface there). This workaround revolves around <a href="http://linuxcommand.org/man_pages/hidd1.html">hidd</a>, which was removed in Ubuntu 9.04 which you can get back as follows:</p>
<pre  name="code">sudo apt-get install bluez-compat</pre>
<p>Hidd is a tool that works like a charm for scanning and connecting to bluetooth devices. It&#8217;s still used these days because  the Ubuntu dev team somehow manages to kill bluetooth support  every new version. There are so many tutorials and flavors floating around to get a bluetooth device working and apparently with so little success that hidd remains popular. With 9.04 they gave bluetooth an <a href="http://ubuntuforums.org/showthread.php?t=952168">overhaul</a> and deprecated hidd.</p>
<p>Anyway, here&#8217;s the shell script that keeps connecting your keyboard. There&#8217;s one catch though: I haven&#8217;t figured out how to let the keyboard sleep, awake and reconnect itself, so you&#8217;ll need to hit the reset button on the keyboard to reveal itself to the bluetooth adapter looking for it. Reconnecting this way requires thus one extra manual action before it reconnects (same thing goes for when you rebooted). But it reconnects when you want it to, which is what I&#8217;m content with for the moment, considering the alternative.</p>
<ol>
<li>
First create a new file for the script:</p>
<pre  name="code">sudo nano /etc/keyboard.sh</pre>
<p>Add the following script:</p>
<pre  name="code">
while (sleep 10)
do
sudo hidd --connect AA:BB:CC:DD:EE:FF > /dev/null 2>&#038;1
done
</pre>
<p>Close and save. </p>
<p style="font-size: 4pt; background-color: rgb(225,225,225);"><strong>Note</strong>: that AA:BB address should be the MAC address of your keyboard. You can find it using the new bluetooth tool <i>hcitool scan</i> (make sure your keyboard is findable by hitting its reset switch) or with <i>hidd &#8211;search</i>, which coincidently will automatically attempt to connect your device while scanning it.</p>
<p style="font-size: 4pt; background-color: rgb(225,150,150);"><strong>EDIT: August 8th, 2010</strong><br />
I updated the above script to react much more quickly and avoid unnecessary connect attempts:</p>
<pre  name="code">

#! /bin/bash

address="AA:BB:CC:DD:EE:FF"

while (sleep 1)
do
 connected=`sudo hidd --show` > /dev/null
 if [[ ! $connected =~ .*${address}.* ]] ; then
  sudo hidd --connect ${address} > /dev/null 2>&#038;1
 fi
done
</pre>
</li>
<li>
Next we&#8217;ll make sure it&#8217;ll run in the background when booted. Create a new boot entry:</p>
<pre  name="code">sudo nano /etc/init.d/keyboard</pre>
<p>Add the following script:</p>
<pre  name="code">
#!/bin/sh

/etc/keyboard.sh &#038;

exit 0
</pre>
<p>Close and save.
</li>
<li>
Give both files execution rights with <i>chmod +x {filename}</i>
</li>
<li>
Now run the following command to get the script executing during boot:</p>
<pre  name="code">sudo update-rc.d keyboard defaults</pre>
</li>
</ol>
<p>Reboot and check if it works. Remember to hit your keyboard&#8217;s reset switch when you want Ubuntu to connect your keyboard.</p>
<p><a href="http://blog.projectnibble.org/2010/01/28/how-to-connect-bluetooth-keyboard-in-ubuntu-9-04-jaunty-workaround/trackback/">trackback</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.projectnibble.org/2010/01/28/how-to-connect-a-bluetooth-keyboard-in-ubuntu-9-04-jaunty-and-9-10-karmic-workaround/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
