After updating the PyPortal to the latest bootloader and Circuitpython version, I'm not getting either the startup BMP or background BMP images displayed. The quotes show up fine.
I'm using the version 5 sample code. Any thoughts on what I'm doing wrong?
PyPortal - No background images
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- danhalbert
- Posts: 4653
- Joined: Tue Aug 08, 2017 12:37 pm
Re: PyPortal - No background images
Did you update the libraries also? Also, a problem with OnDiskBitmap was just fixed in a library recently.
- jcalvin
- Posts: 52
- Joined: Mon Jan 04, 2016 3:37 pm
Re: PyPortal - No background images
I'm current seeing something similar. I've tried 3 different projects. Downloaded the latest libraries. Even tried 7.1 beta (briefly) all to no avail.
Currently trying with the ISS project. The map.bmp file never shows on the screen. Nice track builds up, but no map image.
Also tried the Cleveland Art and NASA image projects - no images from Cleveland (although cache.bmp looks fine on the SD card). The
NASA logo as a background image never shows on screen.
BTW, the NASA image display project was having an additional problem: when I was trying this, NASA was handing over something from youtube (animated/movie)
and Adafruit was handing back a badly formatted .BMP (not a complete surprise). So cache.bmp was invalid.
Currently trying with the ISS project. The map.bmp file never shows on the screen. Nice track builds up, but no map image.
Also tried the Cleveland Art and NASA image projects - no images from Cleveland (although cache.bmp looks fine on the SD card). The
NASA logo as a background image never shows on screen.
BTW, the NASA image display project was having an additional problem: when I was trying this, NASA was handing over something from youtube (animated/movie)
and Adafruit was handing back a badly formatted .BMP (not a complete surprise). So cache.bmp was invalid.
- steve220
- Posts: 36
- Joined: Sat Sep 16, 2017 10:52 pm
Re: PyPortal - No background images
Libraries are up to date. I'm probably not smart enough to wade through the library code effectively, but the "TODO" comment in the following section of code seems germane.
Since I'm running CP7, should this be changed?
Code: Select all
if isinstance(file_or_color, str): # its a filenme:
with open(file_or_color, "rb") as self._bg_file:
background = displayio.OnDiskBitmap(self._bg_file)
self._bg_sprite = displayio.TileGrid(
background,
pixel_shader=getattr(
background, "pixel_shader", displayio.ColorConverter()
),
# TODO: Once CP6 is no longer supported, replace the above line with below
# pixel_shader=background.pixel_shader,
x=position[0],
y=position[1],
)
- steve220
- Posts: 36
- Joined: Sat Sep 16, 2017 10:52 pm
Re: PyPortal - No background images
FYI, I tried changing the code above in the library (adafruit_portalbase\graphics.py), but I still don't see any images displayed.
Also, the beta and absolute newest circuitpython versions don't change this behavior.
Also, the beta and absolute newest circuitpython versions don't change this behavior.
- danhalbert
- Posts: 4653
- Joined: Tue Aug 08, 2017 12:37 pm
Re: PyPortal - No background images
There was a fix for this but it wasn't merged yet. I just merged it. Use the 1.10.0 or later version of the PortalBase library: https://github.com/adafruit/Adafruit_Ci ... ses/latest. It will be in the bundle after tonight, but you can download it from that link now.
- jcalvin
- Posts: 52
- Joined: Mon Jan 04, 2016 3:37 pm
Re: PyPortal - No background images
That did indeed fix the problem!
Thanks Dan!
Thanks Dan!
- steve220
- Posts: 36
- Joined: Sat Sep 16, 2017 10:52 pm
Re: PyPortal - No background images
Ditto for me. Works great. Thanks!
- steve220
- Posts: 36
- Joined: Sat Sep 16, 2017 10:52 pm
Re: PyPortal - No background images
Well, I may have spoke too soon. The loading image and background image load fine for the sample "quotes" project.
When using the SlideShow library with the examples here:
https://learn.adafruit.com/creating-sli ... n?view=all
The slides are blank. I've inserted code that prints out the current image file name and that is working. The code "transitions" to the next file, but the screen stays blank (backlight remains on). Here is the code...
Here is the output (loops continuously)
All libraries are from the 12/2/21 update.
When using the SlideShow library with the examples here:
https://learn.adafruit.com/creating-sli ... n?view=all
The slides are blank. I've inserted code that prints out the current image file name and that is working. The code "transitions" to the next file, but the screen stays blank (backlight remains on). Here is the code...
Code: Select all
# CircuitPython Slideshow - uses the adafruit_slideshow.mpy library
import board
import time
from adafruit_slideshow import PlayBackOrder, SlideShow
# Create the slideshow object that plays through once alphabetically.
slideshow = SlideShow(board.DISPLAY,
folder="/images",
loop=True,
fade_effect=False,
order=PlayBackOrder.ALPHABETICAL,
dwell=1)
while slideshow.update():
print(slideshow.current_slide_name)
time.sleep(5)
pass
Code: Select all
/images/002.bmp
/images/003.bmp
/images/004.bmp
/images/005.bmp
/images/006.bmp
/images/Nier_quote_background.bmp
/images/background-old.bmp
/images/pyportal_startup - Copy.bmp
/images/pyportal_startup.bmp
- steve220
- Posts: 36
- Joined: Sat Sep 16, 2017 10:52 pm
Re: PyPortal - No background images
After trying an old version of the slideshow library, I found that replacing this block of code in the current library file (starting at line 426)
With this block from the 1.5.1 library file works great.
It seems there is something problematic being caused by the "with open...." command?
Code: Select all
file_name = self._file_list[self._current_slide_index]
with open(file_name, "rb") as self._slide_file:
if file_name.endswith(".bmp"):
try:
odb = displayio.OnDiskBitmap(self._slide_file)
except ValueError:
self._slide_file.close()
self._slide_file = None
del self._file_list[self._current_slide_index]
elif file_name.endswith(".json"):
lbl = self._create_label(self._slide_file)
Code: Select all
file_name = self._file_list[self._current_slide_index]
self._slide_file = open(file_name, "rb")
if file_name.endswith(".bmp"):
try:
odb = displayio.OnDiskBitmap(self._slide_file)
except ValueError:
self._slide_file.close()
self._slide_file = None
del self._file_list[self._current_slide_index]
elif file_name.endswith(".json"):
lbl = self._create_label(self._slide_file)
- steve220
- Posts: 36
- Joined: Sat Sep 16, 2017 10:52 pm
Re: PyPortal - No background images
Bump. Is a library update available to fix this?
- danhalbert
- Posts: 4653
- Joined: Tue Aug 08, 2017 12:37 pm
Re: PyPortal - No background images
No, but it's on our short list. I just need to do a test setup to vet a fix.
- danhalbert
- Posts: 4653
- Joined: Tue Aug 08, 2017 12:37 pm
Re: PyPortal - No background images
Fixed, with release 1.7.2 and later: https://github.com/adafruit/Adafruit_Ci ... ses/latest. This release will be in the bundle after tonight.
- steve220
- Posts: 36
- Joined: Sat Sep 16, 2017 10:52 pm
Re: PyPortal - No background images
Awesome! Thanks!
Please be positive and constructive with your questions and comments.