[how to] Setting up LIRC remote as keystroke

Standard

If you wish to use an infrared remote control (like the one used with televisions) with your computer then LIRC it’s perfect solution for you, since most of the modern media center softwares and multimedia players support it.

LIRC is a remarkable piece of software. Let’s see how it can help using our remote as keyboard in ubuntu.

First, you will need of course to install LIRC:

sudo apt-get install lirc xdotool

A configuration menu will pop up, asking you what receiver are you using.

(Xdotool is used for inject keystroke in your system).

Now you will need a configuration file:

cd

gedit .lircrc

And now you can set up your own configuration.

Every key needs its own section in the file, like the following:

begin
prog = irexec
remote = mceusb
button = KEY_OK
config = xdotool key space
end

Leave prog as it is, you can take what information you need for “remote” and “button” form the command irw.

Launch it in a shell and press any button on your remote:

000000037ff07bdd 00 KEY_OK mceusb

In my case, “button” is KEY_OK and “remote” is mceusb.

Now save the file and check if it works, launching irexec.

Finally, you can add irexec to “Startup Applications” and reboot the system.

 

Done!

 

Control servo motor from Raspberry Pi

Standard

IMG_20131009_110313

Today I managed to use a little sevo with my Raspberry Pi (RPi).

There are different ways to do this but, in my opinion, python is too slow and you will need a fast pwm in order to properly drive the servos. I found this project which is written in C and looks fast enough. Let’s see how to use it.

Get a shell on your RPi and type:

wget http://abyz.co.uk/rpi/pigpio/pigpio.tar
tar -xvf pigpio.tar
cd pigpio
cp libpigpio.a-hard libpigpio.a
make
sudo make install
sudo pigpiod

I wrote a script in python to use the c library:

from subprocess import call

for pos in range(530,2300):
	call(["pigs","S","18",pos ]) #S is for servo, 18 is the gpio and pos is the position
	print "position:"+str(pos)

Happy moving!

The Intel-powered Arduino

Standard

Well, I think I won’t need the Beaglebone Black anymore…

Hackaday

Dev boards based on microcontrollers and ARM System on Chips are everywhere, but finding a small pocketable computer based on an Intel processor has been difficult to find. [Massimo] of Arduino just unveiled a new Intel architecture Arduino-compatible board at the Rome Maker Faire. It’s called the Galileo, and it has everything you’d expect from a juiced-up Arduino running x86.

The main chip is an Intel Quark SoC running at 400MHz with 256 MB of DRAM. On board is a Mini-PCIe slot, 100Mb Ethernet port, Micro SD slot, RS-232, and USB host and client ports. Here’s the datasheet for the Galileo with all the applicable information.

The Galileo can be programmed with the standard Arduino IDE, but from the getting started guide, it looks like this board is running Yocto, a stripped down Linux for embedded environments.

Realistically, what we have here is a board with about the…

View original post 59 more words

USB flash drive and openWRT

Standard

If you own a router that uses openWrt as firmware, sometimes you’ll need more memory space for packages and configurations.

Almost all the new routers we find on the market now, have 4 or 8 megabyte of internal flash and openWrt will use a big part of that. What you can do, is using a method called “external root”: this involves a USB mass memory (8gb USB flash drive in my case) and some tricky configurations . Just a couple of months ago, you would have been required to do all the work by hand, but now there is a better, safer and quicker way.

This is the minimum you will need:

  • Router with openWRT (you will need Attitude Adjustment!) on it. (ouch!)

  • USB mass storage (formatted in ext4)

  • a way to connect to your router through ssh

  • espresso

Let’s start!

First, you’ll need to connect to the router and update the list of package with:

opkg update

Then, you’ll have to install the basic modules for the USB:

opkg install kmod-usb-storage block-mount kmod-fs-ext4 kmod-usb2

After that, in the web interface, in the mount tab you should see something like this:

usb-storage-samba-webinterface-mountpoint

Under “mount point” you should now have your USB disk. If not, just click on “add” and add your disk from there.

Now click on “edit” and check on “use this device as root partition”.

Save, apply and reboot the router.

After the reboot you can check under system>software and your free space will have increased!

Enjoy