Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display.refresh() hangs infinitely #13

Open
jmodrako opened this issue Mar 9, 2023 · 7 comments
Open

display.refresh() hangs infinitely #13

jmodrako opened this issue Mar 9, 2023 · 7 comments

Comments

@jmodrako
Copy link

jmodrako commented Mar 9, 2023

Hey!

I'm using an e-ink display that is supported by this library. I've checked and call to display.refresh() stops and paused forever.

Do you have any clue what could be wrong?

Here is my code:

import time
import board
import displayio
import adafruit_ssd1680

displayio.release_displays()

# This pinout works on a Metro M4 and may need to be altered for other boards.
spi = board.SPI()  # Uses SCK and MOSI
epd_cs = board.D41
epd_dc = board.D40
epd_reset = board.D39  # Set to None for FeatherWing
epd_busy = board.D42  # Set to None for FeatherWing

print("1")

display_bus = displayio.FourWire(
    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)

print("2")
time.sleep(1)

# For issues with display not updating top/bottom rows correctly set colstart to 8
display = adafruit_ssd1680.SSD1680(
    display_bus,
    colstart=8,
    width=250,
    height=122,
    busy_pin=epd_busy,
    highlight_color=0xFF0000,
    rotation=270,
)

print("3")

g = displayio.Group()

print("4")

with open("/display-ruler.bmp", "rb") as f:
    pic = displayio.OnDiskBitmap(f)
    
    print("5")
    
    # CircuitPython 6 & 7 compatible
    t = displayio.TileGrid(
        pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
    )
    
    print("6")
    
    # CircuitPython 7 compatible only
    # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
    g.append(t)

    print("7")

    display.show(g)

    print("8")

    display.refresh()

    print("refreshed")

    time.sleep(120)
@makermelissa
Copy link
Collaborator

Can you open a serial terminal to the device? It might give you more information about the error.

@ylihemmo
Copy link

I have exactly the same issue.
Serial does not give any information. It just hangs and needs to be reset via button.

@tannewt
Copy link
Member

tannewt commented Apr 18, 2023

Try the example without setting the busy pin. It may not be hooked up right.

@ylihemmo
Copy link

It does not get stuck without busy pin but it does not display properly either.

@ylihemmo
Copy link

Without busy pin display.refresh() does not do anything.

@makermelissa
Copy link
Collaborator

I'm using an e-ink display that is supported by this library.

Which specific display are you using? Also which version of CircuitPython? I tested out a number of different featherwing displays over the past few days using CP 8.2.6 and had no issues.

Also, did you set both of the lines with # Set to None for FeatherWing next to them to None?

@tpchuckles
Copy link

tpchuckles commented Feb 26, 2025

Did you ever figure this out?

I ran into this issue too, but it turned out I was just using the wrong indices for the GPIO pins. the "board.DNN" lines in python refer to the GPIO pin numbers not the pin indices. (the outer numbers here).

In the example from here:

import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.CE0)
dc = digitalio.DigitalInOut(board.D22)
rst = digitalio.DigitalInOut(board.D27)
busy = digitalio.DigitalInOut(board.D17)
srcs = None

D22 refers to GPIO 22, i.e., pin 15 (upper-midway down the left side), not pin 22 (halfway down the right side)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants