-1

I got a problem with setting up my Pygame code on RasPi 4. I have HDMI display (7" for now, later to be replaced by 4" on final product) connected to it (boot to console), but do all development on remote desktop.

When I use pygame 1.9, i have no problems using fbcon driver, and can show stuff on display. I now installed pygame_gui, and it pushed up the pygame version to 2.1.2. Now, I cant get the screen working, the error is

pygame 2.1.2 (SDL 2.0.14, Python 3.9.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
Setting SDL variables...
...done
Checking current env variables...
SDL_FBDEV = /dev/fb0
Traceback (most recent call last):
File "/home/proto/pygameui.py", line 24, in <module>
pygame.display.init()
pygame.error: fbcon not available

I tried to set driver to fbcon, directfb, svgalib, kmsdrm, but in vain. Trying to downgrade pygame and pygame_gui to 1.9 and 5.7 worked for normal pygame graphics, but I cant get gui stuff to work with this version..

Any idea what to do?

Petr Osipov
  • 621
  • 6
  • 16

1 Answers1

1

Found a solution in meanwhile, which is a bit bulky, but works.

I only edit from remote desktop, but start the python execution from a separate ssh console. This way, kmsdrm driver works.

When the raspi will be installed into a standalone hardware device, it would anyways autostart the python script.

Petr Osipov
  • 621
  • 6
  • 16