# Problems running keyboard.py with button shim

Just purchased the button-shim. When I try and run the example, I get:

pi@raspberrypi:~/Pimoroni/button-shim/examples \$ `sudo python3 keyboard.py`

``````
Button SHIM: keyboard.py

Trigger keyboard key presses with Button SHIM.

Press Ctrl+C to exit.

Traceback (most recent call last):
File "keyboard.py", line 33, in <module>
@buttonshim.on_press(BUTTONS)
File "/usr/local/lib/python3.7/dist-packages/buttonshim/__init__.py", line 294, in on_press
setup()
File "/usr/local/lib/python3.7/dist-packages/buttonshim/__init__.py", line 188, in setup
OSError: [Errno 121] Remote I/O error
Exception ignored in: <function InputDevice.__del__ at 0xb6328e40>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/evdev/device.py", line 159, in __del__
File "/usr/local/lib/python3.7/dist-packages/evdev/device.py", line 304, in close
File "/usr/local/lib/python3.7/dist-packages/evdev/eventio_async.py", line 54, in close
File "/usr/lib/python3.7/asyncio/events.py", line 640, in get_event_loop
File "/usr/lib/python3.7/asyncio/events.py", line 660, in new_event_loop
File "/usr/lib/python3.7/asyncio/unix_events.py", line 51, in __init__
File "/usr/lib/python3.7/asyncio/selector_events.py", line 49, in __init__
File "/usr/lib/python3.7/asyncio/base_events.py", line 373, in __init__
File "/usr/lib/python3.7/asyncio/coroutines.py", line 28, in _is_debug_mode
AttributeError: 'NoneType' object has no attribute 'dev_mode'
Exception ignored in: <function BaseEventLoop.__del__ at 0xb636c4b0>
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/base_events.py", line 622, in __del__
File "/usr/lib/python3.7/asyncio/base_events.py", line 390, in __repr__
File "/usr/lib/python3.7/asyncio/base_events.py", line 1794, in get_debug
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_debug'
``````

I’m pretty sure I see it on the I2C bus (this is a PI Zero W):

pi@raspberrypi:~/Pimoroni/button-shim/examples \$ `sudo i2cdetect -y 1`

``````     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
``````

Double check that i2c is enabled in Raspberry Pi Configuration. Or raspi-config if running Buster lite.
Also run this from a terminal window `i2cdetect -y 1`
The button shim uses 0x3f

@alphanumeric We must has posted at the same time. I edited to show the `i2cdetect` output

I was posting while you were doing the edit. When I see I/O error I usually double check that i2c is alive and well. It’s being detected Ok so its likely not that.

How are your soldering skills? I ask because that shim requires soldering.
Did you solder all the Pin’s, or just what is used?

What are the pins that must be soldered on the header? I didn’t do every pin, since it said it only needed i2c, 5V and 3.3V. Since I was detecting the `3f` in the `i2cdetect`, I figured it was communicating.

Ah, OK, you may be using the wrong 3.3v pin. It uses the one on pin 17, not the one on pin 1. Did you also solder the ground pin, pin 6 ?

Wow, would you believe I miscounted and soldered pin 19 instead of 17?

Working now, thanks @alphanumeric

That can happen. Now you get to have some fun. =)