Description
I have this code running on a PyPortal:
import board
from adafruit_pyportal import PyPortal
# Set a data source URL
IMAGE_URL = "http://192.168.1.109:8000/image_compressed2.bmp"
TEXT_URL = "http://192.168.1.109:8000/test.txt"
# Create the PyPortal object
pyportal = PyPortal(
# url=TEXT_URL,
# image_url_path=IMAGE_URL,
status_neopixel=board.NEOPIXEL,
debug=True,
# convert_image=False
)
pyportal.set_background(0xFF00FF)
# Go get that data
# print("Fetching")
# data = pyportal.fetch()
pyportal.set_background("/sd/cache.bmp")
print("after")
while True:
pass
It was originally fetching the image to test an unrelated PR. Now it is just using pyportal.set_background("/sd/cache.bmp")
to try to set the background to an image stored on the sdcard.
When this code runs the PyPortal gets into a "stuck" state where CIRCUITPY
becomes unresponsive and disappears. The serial console becomes unresponsive. If I press the reset button the device will reboot as normal but when the set_background()
call executes it will get stuck again. If I press the reset button twice I do successfully get t bootloader mode.
I can see 1 pixel (I think its 1) getting drawn at the top of the screen from my bmp image. But nothing else gets drawn on the screen and then the devices gets into the "stuck" state mentioned above.
I have tested this on some older versions and have realized that back on Circuit Python version 4.1.2
this code works correctly. But 5.0.0
and anything newer (up to latest in S3) the code gets "stuck" as noted above.
I'm guessing that something in the PyPortal library may need to be updated. But also perhaps there is a way in the core to prevent this from getting into the "stuck" state?