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

gifio.OnDiskGif stops displaying next_frame() if web workflow is not enabled and USB not connected to host #9854

Open
RetiredWizard opened this issue Dec 2, 2024 · 0 comments

Comments

@RetiredWizard
Copy link

RetiredWizard commented Dec 2, 2024

CircuitPython version

Adafruit CircuitPython 9.2.1-13-g617915ee80 on 2024-12-02; Adafruit Feather ESP32-S3 Reverse TFT with ESP32S3
Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit MatrixPortal S3 with ESP32S3

Code/REPL

import board,displayio,gifio,time
import digitalio
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

disp = board.DISPLAY

odgcc = gifio.OnDiskGif('classic40.gif')

with odgcc as odg:
    cs = displayio.Colorspace.RGB565_SWAPPED

    facecc = displayio.TileGrid(odg.bitmap, \
        pixel_shader=displayio.ColorConverter(input_colorspace=cs))

    splash = displayio.Group()
    splash.append(facecc)
    disp.root_group = splash

    start = 0
    next_delay = -1
    # Display repeatedly.
    while True:
        while time.monotonic() >= start and next_delay > time.monotonic()-start:
            pass
        next_delay = odg.next_frame()
        #next_delay = .5
        led.value = not led.value

        start = time.monotonic()

Behavior

If there is no WiFi credentials in settings.toml and the board is not connected to a host computer via USB a couple frames of the GIF file are displayed and then the animation stops. Oddly, the LED continues to blink. Connecting a host computer to the boards USB port when the animation is frozen causes the animation to begin and disconnecting it again causes it to stop again.

Description

If I comment out the call to odg.next_frame() and replace it with a statement setting the next_delay to .5 seconds the LED blinks steadily regardless of whether the host computer is connected to the USB port or not.

Additional information

Connecting the boards USB to a powerbank results in the same behavior as when it's not connected to anything so for the animation to work a host computer must be connected (or settings.toml must enable web workflow).

classic40.zip

@tannewt tannewt added this to the Long term milestone Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants