#thanks you re calling release displays
1 messages · Page 1 of 1 (latest)
Very little meaningfull stuff in the exception... ValueError: IO35 in use
.Traceback (most recent call last):
File "code.py", line 162, in <module>
I am doing this:
try:
spi = busio.SPI(clock=CLK_PIN,MOSI=DIN_PIN)
spiok=True
except Exception as inst:
traceback.print_exception(inst,chain=True)
and it works initially?
Yes, always works when I power on.
and issue is repeatable? can get to REPL, press <CTRL><D> to soft reset, and it hits issue?
Yes
what does it take to get it working again at this point?
Power Cycle, then things go back to normal
what specific board is being used?
waveshare_esp32_s3_pico
oh wait. nvm. you mention above.
just to verify. this one?
https://circuitpython.org/board/waveshare_esp32_s3_pico/
Yepp
Is there a way that I can disable the feature that repl uses the displays once they are available? I guess that Repl taking over and sending output is part of the issue.
yes
it's buried somewhere. one sec.
import board
import busio
import displayio
displayio.release_displays()
CLK_PIN = board.IO35 #10
DIN_PIN = board.IO36 #11
spi = busio.SPI(clock=CLK_PIN,MOSI=DIN_PIN)
print("Looping forever.")
while True:
pass
try that real quick and see if you get same behavior.
while i continue to look for the repl thing....
Looks a little different now:
lots of discussion on showing REPL:
https://github.com/adafruit/circuitpython/issues/2791
in 8.x, need to show() a group. in 9.x, will use root_group
Found the same issue....
display.root_group.hidden = True --> perhaps worth a try....
did you get a new error with above code?
display.root_group.hidden = True did not help
What is strange is that with your code I do not get the error message. But I guess the reason is that no display is created in your code.
that was just a simple check for any other possible pin conflicts
import board
import busio
import displayio
displayio.release_displays()
CLK_PIN = board.IO35 #10
DIN_PIN = board.IO36 #11
DC_PIN = board.IO33 #8
CS1_PIN = board.IO16 #4
spi = busio.SPI(clock=CLK_PIN,MOSI=DIN_PIN)
display_bus = displayio.FourWire(spi, command=DC_PIN, chip_select=CS1_PIN)
display = ST7789(display_bus, rotation=270, width=240, height=135, rowstart=40, colstart=53, auto_refresh=False)
print("Looping forever.")
while True:
pass
what about that?
Still OK, some imports were missing:
import displayio
import board
import busio
from adafruit_st7789 import ST7789
displayio.release_displays()
CLK_PIN = board.IO35 #10
DIN_PIN = board.IO36 #11
DC_PIN = board.IO33 #8
CS1_PIN = board.IO16 #4
spi = busio.SPI(clock=CLK_PIN,MOSI=DIN_PIN)
display_bus = displayio.FourWire(spi, command=DC_PIN, chip_select=CS1_PIN)
display = ST7789(display_bus, rotation=270, width=240, height=135, rowstart=40, colstart=53, auto_refresh=False)
print("Looping forever.")
while True:
pass
thanks. sry. yah. i'm just hacking stuff together.
why did you add the loop?
the while spiok == False loop
I think this kills the cat:
displayio.release_displays()
I added this:
group = displayio.Group()
group.append(tile_grid)
display.show(group)
display.refresh(target_frames_per_second=None, minimum_frames_per_second=0)
displayio.release_displays()
without release code still worked, but with the additional realease I started getting the error
like multiple calls to release is what is causing it?
the while spiok == False loop was only for trying if I find a cure by accident, no luck....
I guess so, let me simplify...
This is needed to get the error:
import displayio
import board
import busio
from adafruit_st7789 import ST7789
displayio.release_displays()
CLK_PIN = board.IO35 #10
DIN_PIN = board.IO36 #11
DC_PIN = board.IO33 #8
CS1_PIN = board.IO16 #4
spi = busio.SPI(clock=CLK_PIN,MOSI=DIN_PIN)
display_bus = displayio.FourWire(spi, command=DC_PIN, chip_select=CS1_PIN)
display = ST7789(display_bus, rotation=270, width=240, height=135, rowstart=40, colstart=53, auto_refresh=False)
displayio.release_displays()
print("Looping forever.")
while True:
pass
and can just comment out the second call and it works?
Yes
Problem is I need to use it, otherwise I cannot switch between the 6 displays.
(unless you know a better way to use multiple displays...)
Found this loooonnnggggg discussion:
I guess I will have to go lowlevel with SPI only and no displayio, as I only want to show bitmaps that should not be to difficult. Time for me to go to bed, thank you for your help so far!