InkyPhat a few issues getting started

Hi, I’ve just received an InkyPHAT (RED) purchased from Little Bird Electronics here in Australia. Runing through the samples I’ve found that the EEPROM isn’t detected (I assume the one I got was old-ish stock) I tried it on 2 different pi zero 2 w, both running the latest install of raspbian. SPI and I2C is ebabled on both.

Stepping into the code I find that auto.py gets a none from the call to eeprom.read_eeprom(i2c_bus=i2c_bus)

I’ve ended up passing --type=phat and --colour=red as arguments, that gets things running. Unfortunately the examples aren’t displaying correctly (see below). I’ve run clean.py a few times but it’s not helping.

A few questions:

  1. Do I have an old version? I’ve included a photo of the back of the phat
  2. I thought it used spi to access the phat, but it seems to be using i2c, is the i2c just for the eeprom?
  3. If it’s the newer version and I need i2c to read the eeprom, is there a way to debug the i2c issue.
  4. The logo was clear when it arrived, so I’m assuing it’s a coding issue. Anything else I could try?

Thanks.




Some more googling and I found this:

Looking at the back of the board it’s certainly different than the one in the article. It looks like I might have a V1 board. I’ve tried the old inkyphat library with the same results as before.

The pinout is here,
Inky pHAT at Raspberry Pi GPIO Pinout

It uses SPI for the display and i2c to read the eprom. Make sure i2c is enabled, if you haven’t already.

I’ve got i2c enabled, I have a servo hat I can drive from it, so that’s got to be working, it really looks like it’s an older one :(

I’ll double check from a different device later on. I did wonder if it was the resolution that was off, so I changed it and the output was completely wrong, so I suspect it’s the right resolution, but the display might be bad (see my second comment)

It’d be good to get pictures of the boards of the various versions, so I can work out what mine is.

I don’t own an inky, just so you know. Lots of SPI displays, just not that one.
Good reliable power supply?
Inky firmly seated on the GPIO?
Might want to try Buster instead of Bullseye.

1 Like

I tried again on my pi zero that has the button shim (I2C works). I can also successfully use the Waveshare 1.44" hat, it communicates (SPI works, see: 1.44inch LCD HAT - Waveshare Wiki )

Here’s the output of the i2cdetect command

% 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: -- -- -- -- -- -- -- --  

So it really looks like it’s a pre I2C version

Or its broken / defective?
@hel

1 Like

That looks to be a moderately old Inky - it doesn’t have an EEPROM chip so it won’t be able to auto-detect the resolution (but if it’s updatable with the inky library and has a big inductor on the back it’s not one of the problematic v1s!).

--type=phat and --colour=red should be correct in that case - you could try the ‘Build Your Own Code’ part of the Inky tutorial to see if that works any better than the examples (making sure to use the phat boilerplate, rather than the auto boilerplate)?

If it’s still not playing then you might have a faulty display - drop an email to support@pimoroni.com with a link to this thread and they’ll get you sorted.

1 Like

(Here’s what a recent Inky with EEPROM looks like, if anyone’s curious!)

1 Like

Thanks! Now I know that’s not a problem at least. Mine looks exactly the same except for the 2 chips above the pimoroni logo. I’m still playing around with it, but displaying loaded images or images and text seem a bit blurry. Though I had some trouble with my own images, I couldn’t get the RED to display, it may have somethign to do with my images being 4bit, rather than 2.

However, I’ve had some OK results using set pixel:

from inky import InkyPHAT

inky_display = InkyPHAT("red")
colors = [InkyPHAT.BLACK, InkyPHAT.WHITE, InkyPHAT.RED]
colorCount = len(colors)

def getColor(x,y):
    """use the x and y values to calculate the color to display"""
    color = colors[round((x+y)/2) % colorCount] # diagonal stripes
    return color

for x in range(inky_display.WIDTH):
    for y in range(inky_display.HEIGHT):
        inky_display.set_pixel(x, y, getColor(x,y))
print("pixles set")
inky_display.show()

By changing the divisor in getColor() I’ve changed the width of the stripes. Changing the colors list I changed the colors. Also horizotal trips by just using y and verticle by just using x.

Wider Stripes work best

1 pixel width aren’t as good.

It looks like red spreads out a bit. Next thing I try will be using the PIL library and see if I get similar results.

I’m still having issues with displaying text. I’ll email support, but all my stuff is here: pi-playpen/inky at main · baralong/pi-playpen · GitHub
Disclaimer, it’s very hack-y and I’m not too familiar with python.

I am wondering if the text issues might have something to do with the way PIL is rendering the fonts.

Thanks for persevering! I tested a few different generation Inkys with the latest release yesterday, and I didn’t see anything like the blurriness you’re getting so I’m wondering if you have a faulty display - support should be able to sort it out.

1 Like

No problem. It’s always going to be faster if I can work it out myself. Thanks for trying it out on other inkys.

I emailled support yesterday, I’m sure we’ll sort it out soon.