# Odd IO errors with Scroll pHAT

**URL:** <https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738>\
**Category:** Support\
**Created:** [May 18, 2018, 9:19am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738 "2018-05-18T09:19:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [May 18, 2018, 9:19am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/1 "2018-05-18T09:19:48Z")

</div>

Hello,

I’m getting quite a few strange IO errors when running the script below.

It’s a simple script; adjust the brightness of a scrolling clock according to the time of day.

**clock.py**

> #!/usr/bin/env python
> 
> import sys  
> import datetime  
> import time
> 
> import scrollphat
> 
> while True:  
> try:  
> now = datetime.datetime.now()  
> brightness = scrollphat.set\_brightness(10)
> 
> ```
> if now.hour >= 20 and now.hour <= 8:
> brightness = brightness / 2
> 
> scrollphat.write_string(time.strftime("%H:%M "))
> scrollphat.scroll(1)
> time.sleep(0.5)
> 
> except KeyboardInterrupt:
> scrollphat.clear()
> sys.exit(-1)
> 
> ```

The script runs for a bit, then freezes.

> A high number of IO Errors have occurred, please check your soldering/connections.
> 
> Traceback (most recent call last):  
> File “Pimoroni/scroll-phat/examples/clock.py”, line 12, in brightness = scrollphat.set\_brightness(10)  
> File “/usr/lib/python3/dist-packages/scrollphat/ **init**.py”, line 52, in set\_brightness controller.set\_brightness(brightness)  
> File “/usr/lib/python3/dist-packages/scrollphat/IS31FL3730.py”, line 71, in set\_brightness self.bus.write\_i2c\_block\_data(self.i2cConstants.I2C\_ADDR, self.i2cConstants.CMD\_SET\_BRIGHTNESS, [self.brightness])
> 
> OSError: [Errno 121] Remote I/O error

The errors suggest that my soldering is to blame, which is entirely possible…

However, I’m not convinced, as it seems to be failing when passing an integer to the brightness parameter.

(Running the test-all.py script works fine and throws zero errors, which is another reason I’m not convinced it’s the soldering.)

So, I dumbed it down to just scroll the time:

**clock2.py**

> #!/usr/bin/env python
> 
> import sys  
> import time
> 
> import scrollphat
> 
> brightness = scrollphat.set\_brightness(5)
> 
> while True:  
> try:  
> scrollphat.write\_string(time.strftime("%H:%M "))  
> scrollphat.scroll(1)  
> time.sleep(0.5)
> 
> ```
> except KeyboardInterrupt:
> scrollphat.clear()
> sys.exit(-1)
> 
> ```

This works, no freezing, but again in the terminal window I get:

> A high number of IO Errors have occurred, please check your soldering/connections.

With non of the Traceback hints.

To be fair, my python-fu is not that strong, so:

- Is my script OK?
- Should I care about IO errors in a terminal window.

Cheers,

Simon.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [May 18, 2018, 9:29am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/2 "2018-05-18T09:29:18Z")

</div>

Could you post a photo of your setup/soldering?

The Scroll pHAT code will tolerate a certain number of IO errors, but beyond that it’ll fail to avoid getting stuck in an endless loop with genuinely bad connections or even a pHAT not being connected at all.

It’s possible to tweak your code to catch OSError and just keep on trying until it works.

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [May 18, 2018, 9:36am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/3 "2018-05-18T09:36:20Z")

</div>

Hi,

Thanks for the quick response.

I can post pics, but I’m going to have to take [this](https://forums.pimoroni.com/t/googleaiy-a-box-and-a-scrollphat/7610/24) apart first.

I’ll have to get back to you.

Cheers,

Simon.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [May 18, 2018, 9:56am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/4 "2018-05-18T09:56:02Z")

</div>

Zoiks! Judging from those pictures, it may be that your soldering is fine but that you’re getting issues with crosstalk between the i2c data/clock wires or noise coupled into the system from somewhere else. You might find it easier just to more aggressively ignore IO errors since you can always send a screen update again if it fails.

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [May 18, 2018, 10:08am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/5 "2018-05-18T10:08:33Z")

</div>

Hi,

Well, I’m going to take it apart anyway, as I’ve just ordered the [booster headers](https://shop.pimoroni.com/products/booster-header) from you.

This will give me a bit more room at the top of the box as I’d previously had to lift the AIY HAT off the RaspIO board with extra long (11mm I think) headers.

Ordered a Scroll pHAT HD too, so I might chuck that in there for a test.

A weekend job methinks.

I’ll post back with pics.

Incidently, how can I _‘aggressively ignore IO errors’_?

Cheers,

Simon.

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [May 18, 2018, 10:11am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/6 "2018-05-18T10:11:39Z")

</div>

I still think that this may be something related:

> File “/usr/lib/python3/dist-packages/scrollphat/init.py”, line 52, in set\_brightness controller.set\_brightness(brightness)  
> File “/usr/lib/python3/dist-packages/scrollphat/IS31FL3730.py”, line 71, in set\_brightness self.bus.write\_i2c\_block\_data(self.i2cConstants.I2C\_ADDR, self.i2cConstants.CMD\_SET\_BRIGHTNESS, [self.brightness])

No ideas what though :)

---

<div class="post-metadata">

**Author:** ![bensimmo](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/bensimmo/32/7663_2.png) [@bensimmo](https://forums.pimoroni.com/u/bensimmo)\
**Post date:** [May 19, 2018, 2:54pm UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/7 "2018-05-19T14:54:50Z")

</div>

Another though (more on the build).  
If you add the headers to the VoiceHAT for i2c, you’ll have 5V gnd and i2c’s in a nice row header, then use a the Dupont jumper cables or similar wiring to just the gpio holes on the scrollhathd when you get it. You may even be able to use a square black on the phat if 5V5 is down pin 4 and not pin 2.  
That’ll get rid of that large ribbon cable .

(I’m sure the scrollhatHD needs 5V and not 3V3, but get it confirmed, that there in the line on the voiceHAT as well.)

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [August 5, 2018, 8:10am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/8 "2018-08-05T08:10:40Z")

</div>

Hi,

Thanks for the tip.

I have one of the new Scroll pHAT HDs in a box somewhere.

When I get the time / inclination to take it apart again and install it instrad I will definitely go down this route.

Cheers,

Simon.

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [August 5, 2018, 9:45am UTC](https://forums.pimoroni.com/t/odd-io-errors-with-scroll-phat/7738/9 "2018-08-05T09:45:54Z")

</div>

OK, so I finally got around to dismantling the box to inspect the soldering.

This is the top of the FullpHAT board that allows for two HATs to be connected at once:

 ![01_FullpHAT1](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/b/bda1f7f27490e2bb9ea8d9601a2f95627acae28a.jpg)

Same board but from a different angle:

 ![02a_FullPhat2](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/d/d73482987156cebbeddc18f6802941ba778b0172.jpg)

The underside of the board:

 ![03a_FullpHAT3](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/9/9b9b9d34182dd9b7a97ae2ffe01f0a7e33b7889e.jpg)

The connections to the ScrollpHAT:

 ![04a_ScrollpHAT1](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/b/bc8f8a8f3eff3314d7ff7dc7ed7a262c376f07a6.jpg)

I replaced the overly long headers that I initially used with the correctly sized ones:

 ![05a_Headers1](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/6/645f76db8ffe9153412d938f6909360e125a81d8.jpg)

As you can see this reduces the overall height of the assembled boards and will give a bit more room between the top of the boards and the underside of the top of the case; it actually made a difference:

 ![06a_Assembled1](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/d/d2527194d658d941b313fded488166554f1eafd7.jpg)

I think I’m going to draw a line under this now, as the unit runs headless and the errors do not in any way affect the running of it.

I’ll see if I get the same errors when I hook up a different HAT, probably in the way that @bensimmo suggested above as that way I’ll be able to remove the big fat coloured cable.

Thanks everyone for the advice and tips

Simon.
