AUTOMATION HAT IOError: [Errno 5] Input/output error


#1

Hey all,
I just bought the automation hat and tried to get it to work on my raspi, I installed via the one liner:
curl -sS get.pimoroni.com/automationhat | bash

Once it got everything and rebooted this is what I get.
Now, I have tried this same thing on 2 different pi’s now, with 2 different installations. With this same output.
I am starting to wonder if my hat is non functional.

root@raspberrypi:/home/pi/Pimoroni/automationhat/examples# ./relay.py Traceback (most recent call last):
File “./relay.py”, line 5, in
import automationhat as autohat
File “/usr/local/lib/python2.7/dist-packages/automationhat/init.py”, line 3, in
import sn3218
File “/usr/local/lib/python2.7/dist-packages/sn3218.py”, line 112, in
enable_leds(0b111111111111111111)
File “/usr/local/lib/python2.7/dist-packages/sn3218.py”, line 60, in enable_leds
[enable_mask & 0x3F, (enable_mask >> 6) & 0x3F, (enable_mask >> 12) & 0X3F])
IOError: [Errno 5] Input/output error

I also get this output with the i2c command, but I am not certain I have the right syntax, does this show its not detecting anything? I have no lights on the hat. Not sure if that is normal or what.

root@raspberrypi:/home/pi/Pimoroni/automationhat/examples# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

Thanks in advance.
Datsun.


#2

Which versions of the Raspberry Pi are you using?

You should be seeing the ADC, for the analog inputs, and the SN3218 chip, for the lights, in i2cdetect. Failure to see either suggests something else is at fault, since I’d normally expect at least one to work if there were a board level problem.


#3

Pi2 model b 1.1
Pi3 model b 1.2

Are the two board revisions I have tried on.


#4

By just installing the hat on the board and powering it up, should any leds on the hat illuminate?


#5

Nope, the LEDs are driven by the SN3218 LED driver which needs to be told to turn them on by the software library. So that’s no cause for alarm.

Are you running the latest, greatest version of Raspbian?


#6

root@raspberrypi:~# uname -a
Linux raspberrypi 4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 armv7l GNU/Linux

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux

Looking over the installation on this one, I see this error:
Installing collected packages: automationhat, sn3218
Running setup.py install for automationhat

Sorry: TabError: inconsistent use of tabs and spaces in indentation (ads1015.py, line 50)

Running setup.py install for sn3218

Successfully installed automationhat sn3218
Cleaning up…

On the other one I had this error, but after it finished I just did a apt-get install python3-smbus and it installed fine, then I rebooted.

After this operation, 58.4 kB of additional disk space will be used.
Err http://archive.raspberrypi.org/debian/ jessie/main python3-smbus armhf 3.1.1+svn-2
503 Service Unavailable [IP: 46.235.227.11 80]
E: Failed to fetch http://archive.raspberrypi.org/debian/pool/main/i/i2c-tools/python3-smbus_3.1.1+svn-2_armhf.deb 503 Service Unavailable [IP: 46.235.227.11 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Apt failed to install python3-smbus!
python3-smbus can’t be found, fetching from alternative location…
dpkg: error processing archive /tmp/pimoroni.fTTaLW/python3-smbus_3.1.1+svn-2_armhf.deb (–install):
cannot access archive: No such file or directory
Errors were encountered while processing:
/tmp/pimoroni.fTTaLW/python3-smbus_3.1.1+svn-2_armhf.deb
Unable to install smbus for python 3!


#7

The smbus install error is odd. What happens when you run:

sudo apt-get update
sudo apt-get upgrade

#8

Ok on the pi2 v 1.1 I updated and upgraded successfully rebooted, and then ran the one liner…

pi@raspberrypi:~ $ curl -sS get.pimoroni.com/automationhat | bash

This script will install everything needed to use
the Pimoroni Automation HAT

— Warning —

Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.

If you want to see what this script does before
running it, you should run:
\curl -sS https://get.pimoroni.com/automationhat

Note: Automation HAT requires I2C communication

Do you wish to continue? [y/N] y

Checking environment…
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Reading package lists… Done

Checking hardware requirements…

Checking for packages required for GPIO control…

I2C already enabled

Checking packages required by I2C interface…

Automation HAT comes with examples and documentation that you may wish to install.
Performing a full install will ensure those resources are installed,
along with all required dependencies. It may however take a while!

Do you wish to perform a full install? [y/N] y
Checking install requirements…

Checking for dependencies…

Installing Automation HAT library for Python 2…

Requirement already up-to-date: automationhat in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: sn3218 in /usr/local/lib/python2.7/dist-packages (from automationhat)
Cleaning up…

Installing Automation HAT library for Python 3…

Requirement already up-to-date: automationhat in /usr/local/lib/python3.4/dist-packages
Requirement already up-to-date: sn3218 in /usr/local/lib/python3.4/dist-packages (from automationhat)
Cleaning up…

Checking for additional software…

Downloading examples and documentation…

Cloning into ‘automation-hat’…
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 34 (delta 3), reused 25 (delta 1), pack-reused 0
Unpacking objects: 100% (34/34), done.
Checking connectivity… done.

The examples directory already exists on your system!
We’ve backed it up to examples-backup, just in case you’ve changed anything!

Resources for your Automation HAT were copied to
/home/pi/Pimoroni/automationhat

All done!

Enjoy your Automation HAT!

pi@raspberrypi:~ cd /home/pi/Pimoroni/automationhat pi@raspberrypi:~/Pimoroni/automationhat cd examples
pi@raspberrypi:~/Pimoroni/automationhat/examples ./relay.py Traceback (most recent call last): File "./relay.py", line 5, in <module> import automationhat as autohat File "/usr/local/lib/python2.7/dist-packages/automationhat/__init__.py", line 3, in <module> import sn3218 File "/usr/local/lib/python2.7/dist-packages/sn3218.py", line 112, in <module> enable_leds(0b111111111111111111) File "/usr/local/lib/python2.7/dist-packages/sn3218.py", line 60, in enable_leds [enable_mask & 0x3F, (enable_mask >> 6) & 0x3F, (enable_mask >> 12) & 0X3F]) IOError: [Errno 5] Input/output error pi@raspberrypi:~/Pimoroni/automationhat/examples i2c
i2cdetect i2cdump i2cget i2cset
pi@raspberrypi:~/Pimoroni/automationhat/examples $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --


#9

The power LED should lit up, is that the case? How are you connecting the HAT incidentally, right on top of the Pi or some other way?


#10

err, sorry, that’s right the power LED is also controlled by the sn3218.

Still, I think you should be able to confirm whether the board is powered up or not by measuring voltage between ground and any of the input on the left hand side. If not, check the header on the underside and look for any sign of flaky contacts, particularly on the right hand side (when you’re looking at the header placed at the top).


#11

Hello,
As far as I can see each solder connection looks good with no cold looking joints.
I have the hat on top, as one should connected to the double row of headers from the pi.
I have a business card underneath the hat to make sure no connections can touch the hdmi output.
I can sent pics.
I have apt-get upgrade and update on the 2nd pi now, and ran the one liner which I will paste at the bottom of this message but the i2cdetect output still looks blank.

root@raspberrypi:~# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
root@raspberrypi:~#

root@raspberrypi:~# curl -sS get.pimoroni.com/automationhat | bash

This script will install everything needed to use
the Pimoroni Automation HAT

— Warning —

Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.

If you want to see what this script does before
running it, you should run:
\curl -sS https://get.pimoroni.com/automationhat

Note: Automation HAT requires I2C communication

Do you wish to continue? [y/N] y

Checking environment…
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Reading package lists… Done

Checking hardware requirements…

Checking for packages required for GPIO control…

I2C already enabled

Checking packages required by I2C interface…

Automation HAT comes with examples and documentation that you may wish to install.
Performing a full install will ensure those resources are installed,
along with all required dependencies. It may however take a while!

Do you wish to perform a full install? [y/N] y
Checking install requirements…

Checking for dependencies…

Installing Automation HAT library for Python 2…

Requirement already up-to-date: automationhat in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: sn3218 in /usr/local/lib/python2.7/dist-packages (from automationhat)
Cleaning up…

Installing Automation HAT library for Python 3…

Requirement already up-to-date: automationhat in /usr/local/lib/python3.4/dist-packages
Requirement already up-to-date: sn3218 in /usr/local/lib/python3.4/dist-packages (from automationhat)
Cleaning up…

Checking for additional software…

Downloading examples and documentation…

Cloning into ‘automation-hat’…
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 34 (delta 3), reused 25 (delta 1), pack-reused 0
Unpacking objects: 100% (34/34), done.
Checking connectivity… done.

The examples directory already exists on your system!
We’ve backed it up to examples-backup, just in case you’ve changed anything!

Resources for your Automation HAT were copied to
/home/pi/Pimoroni/automationhat

All done!

Enjoy your Automation HAT!

root@raspberrypi:~# /home/pi/Pimoroni/automationhat/examples/relay.py
Traceback (most recent call last):
File “/home/pi/Pimoroni/automationhat/examples/relay.py”, line 5, in
import automationhat as autohat
File “/usr/local/lib/python2.7/dist-packages/automationhat/init.py”, line 3, in
import sn3218
File “/usr/local/lib/python2.7/dist-packages/sn3218.py”, line 112, in
enable_leds(0b111111111111111111)
File “/usr/local/lib/python2.7/dist-packages/sn3218.py”, line 60, in enable_leds
[enable_mask & 0x3F, (enable_mask >> 6) & 0x3F, (enable_mask >> 12) & 0X3F])
IOError: [Errno 5] Input/output error
root@raspberrypi:~#


#12

All measured at the hat:

Between Ground and outputs 1 2 3
Ground and output_1 = 143mv
Ground and output_2 = 0
Ground and output_3 = 144 mv

Ground and 5v = 4.78v


#13

It looks like everything on the software side is fine. I would shoot off an email to support@pimoroni.com and they’ll sort you out a replacement. Sorry for the trouble.


#14

Do the voltages I measured mean there is a hardware problem?

I purchased form adafruit, does that complicate things?

here are some pictures:


#15

I contacted Adafruit showed them this thread and they are taking care of me. Thank you for your support.


#16

Brilliant! Thanks for letting us know.

If they figure out what the problem was, and it doesn’t wing its way back to us, I’d love to know what was up for future debugging efforts :D


#17

Hi, I have the same problem, if ya don’t mind me asking, what was the fix?