#thanks you re calling release displays

1 messages · Page 1 of 1 (latest)

fleet salmon
#

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)

feral current
#

and it works initially?

fleet salmon
#

Yes, always works when I power on.

feral current
#

and issue is repeatable? can get to REPL, press <CTRL><D> to soft reset, and it hits issue?

fleet salmon
#

Yes

feral current
#

what does it take to get it working again at this point?

fleet salmon
#

Power Cycle, then things go back to normal

feral current
#

what specific board is being used?

fleet salmon
#

waveshare_esp32_s3_pico

feral current
#

oh wait. nvm. you mention above.

fleet salmon
#

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.

feral current
#

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....

fleet salmon
#

Looks a little different now:

feral current
#

in 8.x, need to show() a group. in 9.x, will use root_group

fleet salmon
#

Found the same issue....

#

display.root_group.hidden = True --> perhaps worth a try....

feral current
#

did you get a new error with above code?

fleet salmon
#

display.root_group.hidden = True did not help

feral current
#

may not be in 8.x yet

#

it'll be in 9.x

fleet salmon
#

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.

feral current
#

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?

fleet salmon
#

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

feral current
#

thanks. sry. yah. i'm just hacking stuff together.

#

why did you add the loop?

#

the while spiok == False loop

fleet salmon
#

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

feral current
#

like multiple calls to release is what is causing it?

fleet salmon
#

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

feral current
#

and can just comment out the second call and it works?

fleet salmon
#

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...)

feral current
#

good question. actually haven't done that. i think the limit is 1 display.

fleet salmon
#

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!