
Re: Universal GPIO keyboard daemon
Awesome! I just tried it and it works
. Perfect.

Re: Universal GPIO keyboard daemon
I'm glad I've managed to help someonePhillyNJ wrote:Awesome! I just tried it and it works. Perfect.

I figure the reason it doesn't work on auto is because on auto it AUTOmatically defines the first keyboard it sees as the only keyboard, where as raw tells it to get its information from the system instead.
So happy I found that preference, it would've been a real pain not being able to use custom buttons and a keyboard at the same time.
Re: Universal GPIO keyboard daemon
You have no idea how much this helped out. It was an absolute nightmare trying to work around this. Well done!
-
- Posts: 34
- Joined: Wed May 09, 2012 7:21 pm
- Location: Woodbridge, Ontario
Re: Universal GPIO keyboard daemon
The Wii arcade stick uses I2C and is a 3.3 volt device. http://www.amazon.com/Wii-Arcade-Stick- ... B002OTAD1Q
Could it be used instead of the mpc230017 chip? Has anyone tried it? It usually can be found at gamestop or ebgames for about $10.00.
Might be a quick and easy stick for the pi arcade...
Could it be used instead of the mpc230017 chip? Has anyone tried it? It usually can be found at gamestop or ebgames for about $10.00.
Might be a quick and easy stick for the pi arcade...
Electronics for fun...
Raspberry Pi-1 Occidentalist, Tenda 311m x 2
Raspberry Pi-2 Raspbian Wheezy 07-15-12, Netgear N150 x1
Genius 8000 slimline wireless keyboard and mouse both work great with the usb wifi dongle right in the raspberry pi.
Raspberry Pi-1 Occidentalist, Tenda 311m x 2
Raspberry Pi-2 Raspbian Wheezy 07-15-12, Netgear N150 x1
Genius 8000 slimline wireless keyboard and mouse both work great with the usb wifi dongle right in the raspberry pi.
Re: Universal GPIO keyboard daemon
Apparently there is still some confusion as to how to wire multiple switches to the GPIOs. I thought I'd drop this here for reference:
Re: Universal GPIO keyboard daemon
Thanks for the diagram. This really clears up a few issues in my designmmoller2k wrote:Apparently there is still some confusion as to how to wire multiple switches to the GPIOs. I thought I'd drop this here for reference:

-
- Posts: 4
- Joined: Thu Feb 28, 2013 11:23 am
Re: Universal GPIO keyboard daemon
mmoller2k wrote:Apparently there is still some confusion as to how to wire multiple switches to the GPIOs.
Would you be so kind and clear out which GPIOS's should be used for a Rev. 1 PCB with 14 buttons?
Re: Universal GPIO keyboard daemon
Try the wiki: http://elinux.org/Rpi_Low-level_peripherals
According to this, the pins I/Os are
0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25
for rev 1, and
"on the Revision2.0 RaspberryPis, this list changes to: 2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27, with 28, 29, 30, 31 additionally available on the P5 header"
If you use the I2C pins you can omit the pull-up resistors, as these pins already have them.
According to this, the pins I/Os are
0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25
for rev 1, and
"on the Revision2.0 RaspberryPis, this list changes to: 2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27, with 28, 29, 30, 31 additionally available on the P5 header"
If you use the I2C pins you can omit the pull-up resistors, as these pins already have them.
Re: Universal GPIO keyboard daemon
W00T! Finally got my working prototype up and running. The below uses Pikeyd and UInput via the GPIO
http://instagram.com/p/XAfdiNSRFF/
http://instagram.com/p/XAfdiNSRFF/
Re: Universal GPIO keyboard daemon
In regards to how to connect switches, I noticed on Chris Swan's blog that he was connecting a joystick to the GPIO and using the internal pull-up resistors so that no additional components were necessary.
http://blog.thestateofme.com/2012/08/10 ... -joystick/
See near the end of the posting.
Any thoughts on this? Is it possible to get away with not using resistors?
http://blog.thestateofme.com/2012/08/10 ... -joystick/
See near the end of the posting.
Any thoughts on this? Is it possible to get away with not using resistors?
Re: Universal GPIO keyboard daemon
Thank you Mr. mmoller2k. I was implement your daemont into my RPi media center for controlling XBMC via buttons on front panel. It works like a charm.
Re: Universal GPIO keyboard daemon
Hi all,
I have tried to install pikeyd but I seem to be doing something wrong. Please bare with me as I am completely new to linux. I downloaded the zip from github to my windows machine. I extracted the zip to a folder named pikeyd and moved it onto the RPi (via winSCP) to /home/pi. Inside of that folder was the file "pikeyd" that I copied to /usr/local/bin and changed the chmod to rwxr-xr-x. I have a momentary push button hooked up to GPIO pin 18 and 3v3. When I press the button, I don't get an output in the terminal window. Can someon please help me get this to work? In the end I just need a button connected to pin 18 and 3v3 to output a letter to the terminal. it can be pretty much any letter!
Thanks in advance for any help!
I have tried to install pikeyd but I seem to be doing something wrong. Please bare with me as I am completely new to linux. I downloaded the zip from github to my windows machine. I extracted the zip to a folder named pikeyd and moved it onto the RPi (via winSCP) to /home/pi. Inside of that folder was the file "pikeyd" that I copied to /usr/local/bin and changed the chmod to rwxr-xr-x. I have a momentary push button hooked up to GPIO pin 18 and 3v3. When I press the button, I don't get an output in the terminal window. Can someon please help me get this to work? In the end I just need a button connected to pin 18 and 3v3 to output a letter to the terminal. it can be pretty much any letter!
Thanks in advance for any help!
Re: Universal GPIO keyboard daemon
Hey AirBurn, first off, did you start the PiKeyD Daemon? You need to have it run as a Daemon to work with the terminal. Do this by running it as:
pikeyd -d
2nd, have you setup the conf file? This file is where you specify what GPIO pin does what key. 3rd, if you have setup the config file, are you certain you've labeled it right,
http://elinux.org/RPi_Low-level_periphe ... .28GPIO.29
This page is a good reference, just make sure you know what revision your Pi is, if it has 512MB of RAM then it's Revision 2, else it's 1.
After that the only thing that i could think to be wrong is your circuit. I'd double check to see if it's wired correctly, just in case. And if any of my information here is unclear, go back through the other pages of this thread, I'm certain all you need to know is in these posts.
Good Luck and happy coding
pikeyd -d
2nd, have you setup the conf file? This file is where you specify what GPIO pin does what key. 3rd, if you have setup the config file, are you certain you've labeled it right,
http://elinux.org/RPi_Low-level_periphe ... .28GPIO.29
This page is a good reference, just make sure you know what revision your Pi is, if it has 512MB of RAM then it's Revision 2, else it's 1.
After that the only thing that i could think to be wrong is your circuit. I'd double check to see if it's wired correctly, just in case. And if any of my information here is unclear, go back through the other pages of this thread, I'm certain all you need to know is in these posts.
Good Luck and happy coding

Re: Universal GPIO keyboard daemon
I have started it with -d, and I also added the line into the local file to start on every boot. It seems that when I navigate to the directory I placed the unziped files in through winSCP and type make, it does not create the pikeyd file. I only have the pikeyd.c and pikeyd.conf. Am I missing something?Hey AirBurn, first off, did you start the PiKeyD Daemon? You need to have it run as a Daemon to work with the terminal. Do this by running it as:
pikeyd -d
2nd, have you setup the conf file? This file is where you specify what GPIO pin does what key. 3rd, if you have setup the config file, are you certain you've labeled it right,
http://elinux.org/RPi_Low-level_periphe ... .28GPIO.29
This page is a good reference, just make sure you know what revision your Pi is, if it has 512MB of RAM then it's Revision 2, else it's 1.
After that the only thing that i could think to be wrong is your circuit. I'd double check to see if it's wired correctly, just in case. And if any of my information here is unclear, go back through the other pages of this thread, I'm certain all you need to know is in these posts.
Good Luck and happy coding
Re: Universal GPIO keyboard daemon
"Yes, it needs the uinput module. Load this manually with 'modprobe uinput', or automatically by adding 'uinput' to /etc/modules.
Then you need to run it as root, with perhaps the -d switch to make it ran as a daemon. Adding the line '/usr/local/bin/pikeyd -d' to /etc/rc.local makes it run as root at boot time.
The pins require pull-up resistors to 3V3 of 10k ohm, and the switches pull down. A 1K resistor in serial with the pin for protection doesn't hurt.
You define which pins does what by editing /etc/pikeyd.conf. One gpio pin can be defined to emit a series of characters as if it was a keyboard. That makes it compatible with whatever functions you want to control on whatever software - as long as it accepts keyboard input of course."
Found this in an earlier post. If the steps mentioned above dont work, try starting the PiKeyD Daemon and then unplug your Keyboard (if you have one plugged in)
Also, where are you testing the input, in the terminal or inside a program like Leafpad or MAME?
Then you need to run it as root, with perhaps the -d switch to make it ran as a daemon. Adding the line '/usr/local/bin/pikeyd -d' to /etc/rc.local makes it run as root at boot time.
The pins require pull-up resistors to 3V3 of 10k ohm, and the switches pull down. A 1K resistor in serial with the pin for protection doesn't hurt.
You define which pins does what by editing /etc/pikeyd.conf. One gpio pin can be defined to emit a series of characters as if it was a keyboard. That makes it compatible with whatever functions you want to control on whatever software - as long as it accepts keyboard input of course."
Found this in an earlier post. If the steps mentioned above dont work, try starting the PiKeyD Daemon and then unplug your Keyboard (if you have one plugged in)
Also, where are you testing the input, in the terminal or inside a program like Leafpad or MAME?
-
- Posts: 9
- Joined: Tue Jul 31, 2012 7:51 am
Re: Universal GPIO keyboard daemon
Hi,
I download and unzip the folder, but I tried to install without success.
I gave the command "sudo make" and move the file into /user/local/bin but after if i go to the console and i digit "pikeyd -d" i see this error:

I download and unzip the folder, but I tried to install without success.
I gave the command "sudo make" and move the file into /user/local/bin but after if i go to the console and i digit "pikeyd -d" i see this error:
And the pikeyd doesn't workspi@raspberrypi ~/Desktop/tastiera $ sudo pikeyd
/dev/i2c-1: No such file or directory
/root/.pikeyd.conf: No such file or directory
/etc/pikeyd.conf: No such file or directory
Polling 0 GPIO pin(s).
Found 0 I/O expander(s).
Ready.
Joystick init OK.
Press ^C to exit.

Re: Universal GPIO keyboard daemon
Imercantanti, I believe to solve your problem, just read this:
"Usage: pikeyd [option]
Options:
-d run as daemon
-k try to terminate running daemon
-v version
-h this help
Install notes.
If you're using Raspbian wheezy add the folowing to /etc/modules:
uinput
i2c-dev
edit /etc/modprobe.d/raspi-blacklist.conf
and remove or comment out
#blacklist i2c-bcm2708"
After doing the steps mentioned above, make sure your config file is correct (pikeyd.conf). As you'll need to add in there what pins you want to trigger what key, so you need to tell pikeyd that you want pin 2 to be the letter "a".
"Usage: pikeyd [option]
Options:
-d run as daemon
-k try to terminate running daemon
-v version
-h this help
Install notes.
If you're using Raspbian wheezy add the folowing to /etc/modules:
uinput
i2c-dev
edit /etc/modprobe.d/raspi-blacklist.conf
and remove or comment out
#blacklist i2c-bcm2708"
After doing the steps mentioned above, make sure your config file is correct (pikeyd.conf). As you'll need to add in there what pins you want to trigger what key, so you need to tell pikeyd that you want pin 2 to be the letter "a".
Re: Universal GPIO keyboard daemon
This might be a noob question with a very obvious solution, but I have a problem.
I downloaded the .zip file from the github link. Unzipped it, changed directory to its location and ran "sudo make" but it just gives me a weird error 127
What am I doing wrong? I'm running Raspbmc. Any help would be appreciated, thanks.
I downloaded the .zip file from the github link. Unzipped it, changed directory to its location and ran "sudo make" but it just gives me a weird error 127
What am I doing wrong? I'm running Raspbmc. Any help would be appreciated, thanks.
- Attachments
-
- Error after "sudo make" command
- Error.JPG (58.58 KiB) Viewed 5280 times
-
- Posts: 9
- Joined: Tue Jul 31, 2012 7:51 am
Re: Universal GPIO keyboard daemon
Thanks bushrat for your reply, but where i can find:
uinput
i2c-dev
Thanks a lot in advance
uinput
i2c-dev
Thanks a lot in advance
Re: Universal GPIO keyboard daemon
It's really simple, cause /etc/modules is actually a text file (.txt) so all you need to do is do:lmercatanti wrote:Thanks bushrat for your reply, but where i can find:
uinput
i2c-dev
Thanks a lot in advance
"sudo nano /etc/modules"
This opens the file in nano (a command line text editor)
Then all you do is add:
uinput
i2c-dev
To the end of the file. Then do Control+O to save and press enter to confirm, then Control+X to exit. Then just reboot and hopefully it should work

-
- Posts: 9
- Joined: Tue Jul 31, 2012 7:51 am
Re: Universal GPIO keyboard daemon
Thanks a lot again!
Now i have another problem
When i digit "pikeyd -d" the daemon start but if i push the button connect to input 17... Nothing!
If i digit "sudo pikeyid" this is the result and doesn't works:
Now i have another problem

When i digit "pikeyd -d" the daemon start but if i push the button connect to input 17... Nothing!
If i digit "sudo pikeyid" this is the result and doesn't works:
pi@raspberrypi ~/Desktop/tastiera $ sudo pikeyd
Config file is /etc/pikeyd.conf
Line 23. No such expander: XIO_A
Line 24. No such expander: XIO_B
iic write data: Input/output error
iic init write 1
: Input/output error
iic write data: Input/output error
iic init write 2
: Input/output error
iic write data: Input/output error
Configuring MCP23008
Error writing to i2c: Input/output error
Error reading from i2c: Input/output error
Polling 1 GPIO pin(s).
Found 1 I/O expander(s).
Ready.
Joystick init OK.
Press ^C to exit.
Re: Universal GPIO keyboard daemon
Have you also done this?
"edit /etc/modprobe.d/raspi-blacklist.conf
and remove or comment out
#blacklist i2c-bcm2708"
If you have and its still not working, could you post the contents of your pikeyd.cfg
"edit /etc/modprobe.d/raspi-blacklist.conf
and remove or comment out
#blacklist i2c-bcm2708"
If you have and its still not working, could you post the contents of your pikeyd.cfg
-
- Posts: 9
- Joined: Tue Jul 31, 2012 7:51 am
Re: Universal GPIO keyboard daemon
Yes, i commented "#blacklist i2c-bcm2708".
Now i clean the pikeyd.config to check if something changes.
Here the pikeyd.config (i move it to /etc/, right?)
After this if i go to text editor and i push the button nothing happens.
The button works because i write a simple code that write in the console "button pushed" when i push the button
Now i clean the pikeyd.config to check if something changes.
Here the pikeyd.config (i move it to /etc/, right?)
And this is the result when I digit "sudo pikeyd":#joy.cfg
#format:
# [keycode from /usr/include/linux/input.h] [whitespace] [GPIO pin no]
# Not limited to a single key. A GPIO press will emit all defined keys in order.
KEY_7 17
Code: Select all
pi@raspberrypi ~/Desktop/tastiera $ sudo pikeyd
Config file is /etc/pikeyd.conf
Polling 1 GPIO pin(s).
Found 0 I/O expander(s).
Ready.
Joystick init OK.
Press ^C to exit.
The button works because i write a simple code that write in the console "button pushed" when i push the button
Re: Universal GPIO keyboard daemon
Code: Select all
pi@raspberrypi ~/Desktop/tastiera $ sudo pikeyd
Config file is /etc/pikeyd.conf
Polling 1 GPIO pin(s).
Found 0 I/O expander(s).
Ready.
Joystick init OK.
Press ^C to exit.
pikeyd -d
or
sudo pikeyd -d
-
- Posts: 9
- Joined: Tue Jul 31, 2012 7:51 am
Re: Universal GPIO keyboard daemon
Yes, sure, i don't press CTRL+C
I try "sudo pikeyd" and after instead of going to a text editor push the button, but... Nothing
I try "sudo pikeyd" and after instead of going to a text editor push the button, but... Nothing
