pimoroni / inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
https://shop.pimoroni.com/?q=inky
MIT License
596 stars 122 forks source link

Cannot set border with newer inkyphat (SSD1608) #100

Closed keillor closed 3 years ago

keillor commented 3 years ago

When I run the command set to control the border on one of the new inkyphats, nothing happens. I believe this is due to the resolution size being slightly different (250x122 instead of 212x104).

jerbzz commented 3 years ago

I also always get a white border on my yellow Inky pHat, no matter what I set, such as:

inky_display.set_border(inky_display.YELLOW) inky_display.set_border(inky_display.BLACK) inky_display.set_border(inky_display.RED)

all produce a white border. No errors or exceptions are raised.

Otherwise the device appears to function perfectly. I wonder if https://github.com/pimoroni/inky/issues/42 is the same problem?

Hardware details:

$ sudo python3 identify.py
Found: Yellow pHAT (SSD1608)
Display: 212x104
Color: yellow
PCB Variant: 1.2
Display Variant: 12
Time: b'2020-10-08 17:17:35.9'
$ cat /sys/firmware/devicetree/base/model
Raspberry Pi Zero W Rev 1.1

Software details:

$ pip show inky
Name: inky
Version: 1.2.0
...
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
jerbzz commented 3 years ago

@Gadgetoid any thoughts on next steps I could take for debugging? I'm not a Python or hardware expert by any means but certainly happy to get my hands dirty.

jerbzz commented 3 years ago

OK - so in inky_ssd1608.py the border wasn't getting set at all in the _update method.

I've now added this (with some modifications) from inky.py...

        if self.border_colour == self.BLACK:
            self._send_command(ssd1608.WRITE_BORDER, 0b00000000)
            # GS Transition + Waveform 00 + GSA 0 + GSB 0
        elif self.border_colour == self.RED and self.colour == 'red':
            self._send_command(ssd1608.WRITE_BORDER, 0b01010000) # FIXME
            # Fix Level A + VSH
        elif self.border_colour == self.YELLOW and self.colour == 'yellow':
            self._send_command(ssd1608.WRITE_BORDER, 0b00000110)
            # GS Transition + Waveform 01 + GSA 1 + GSB 0
        elif self.border_colour == self.WHITE:
            self._send_command(ssd1608.WRITE_BORDER, 0b00000001)
            # GS Transition + Waveform 00 + GSA 0 + GSB 1

And I can now make it black, white or yellow on my yellow pHAT... w00t!

Anyone want to send me a red SSD1608 pHAT to try?

jerbzz commented 3 years ago

I'm planning to submit a PR for this but I am really struggling to get my hands on a red SSD1608 Inky pHAT! The Pi Hut and Amazon both sent me old style ones, as did Pimoroni after assuring me they only had new style ones in stock!

Gadgetoid commented 3 years ago

I'm planning to submit a PR for this but I am really struggling to get my hands on a red SSD1608 Inky pHAT! The Pi Hut and Amazon both sent me old style ones, as did Pimoroni after assuring me they only had new style ones in stock!

Sorry for the lack of response here, I've been WFH and having to focus down on some select projects to avoid being overwhelmed.

I'll check up regarding an SSD1608-based red Inky pHAT. I'm not 100% sure if they exist and could have sworn we only had yellow. Not disambiguating between old/new products with their own SKUs was a mistake.

I really appreciate the effort you're putting in here- I hope it hasn't left you too out of pocket!? :grimacing:

jerbzz commented 3 years ago

Nah it's fine, I was just hoping for a matching pair of red and yellow in my project! I've returned the non-SSD1608 ones from Amazon/Pi Hut, but still waiting to hear back from Pimoroni Support about why I got a low res when they said it would be a high res!

I know everyone is busy :)

If the red SSD1608 doesn't exist then I will have to just suck up the fact that my displays won't match - scaling factors argh!!

chorltonwheelies commented 3 years ago

Not sure if this helps (I will check using the Inky eeprom function), but as the owner of a black and also a red Inky PHAT, I can report that the red unit is definitely a lower resolution compared to the former: I have had to adjust all draw positions initially set for the black variety (bought in mid 2020), to make the same python script display correctly on the red (bought January 2021).

On Tue, 30 Mar 2021, 14:28 James Herbert, @.***> wrote:

Nah it's fine, I was just hoping for a matching pair of red and yellow! I've returned the non-SSD1608 ones from Amazon/Pi Hut, but still waiting to hear back from Pimoroni Support about why I got a low res when they said it would be a high res!

I know everyone is busy :)

If the red SSD1608 doesn't exist then I will have to just suck up the fact that my displays won't match - scaling factors argh!!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pimoroni/inky/issues/100#issuecomment-810242205, or unsubscribe https://github.com/notifications/unsubscribe-auth/APW6UFKA6BV3IKHFTDONCFTTGHGXBANCNFSM4XV2PZWQ .

jerbzz commented 3 years ago

I heard from Hel at Pimoroni support this afternoon:

"We've solved the mystery :)

Turns out we only started manufacturing red Inky pHATs with SSD1608 screens on 19 March, which is why you would have received one of the old ones. We've had the screens since the end of last year so I think everyone assumed they would have filtered into the system by now!"

One of them is on the way to me - hot off the production line yesterday!

(Don't try too hard with the EEPROM: https://github.com/pimoroni/inky/issues/102)

jerbzz commented 3 years ago

Fixed with https://github.com/pimoroni/inky/pull/108

Gadgetoid commented 3 years ago

Should be released as of v1.2.1 - https://pypi.org/project/inky/

Thanks all!