monsterJoy video system not initialised
Forums:
Second problem now. I got my controller and connected it.
I have then tried to start runMonsterJoy.py and I get the following error:
Loading ThunderBorg on bus 1, address 15
Found ThunderBorg at 15
ThunderBorg loaded on bus 1
Battery monitoring settings:
Minimum (red) 6.98 V
Half-way (yellow) 21.00 V
Maximum (green) 35.02 V
Current voltage 13.95 V
Waiting for joystick... (press CTRL+C to abort)
Joystick found
Press CTRL+C to quit
Traceback (most recent call last):
File "/home/pi/monsterborg/monsterJoy.py", line 120, in
events = pygame.event.get()
pygame.error: video system not initialized
piborg
Sun, 02/24/2019 - 12:07
Permalink
pygame.error: video system not initialized
Unfortunately this is a bug with pygame where some versions need an extra call to make them work without a GUI.
Fortunately it is very simple to fix :)
Open monsterJoy.py and look for this line:
Remove the
#
symbol so the line is run:spacedementia87
Sun, 02/24/2019 - 18:30
Permalink
Thank you for the response.
Thank you for the response.
Unfortunately that just gave me a different error:
Traceback (most recent call last):
File "./monsterJoy.py", line 77, in
pygame.display.set_mode((1,1))
pygame.error: Unable to open a console terminal
I guess this has something to do with it being run headless through SSH.
piborg
Sun, 02/24/2019 - 19:00
Permalink
Trouble running monsterJoy.py over SSH
We have seen problems using SSH before as well...
Try this alternative pygame setup code instead:
If you get a permission error you might have to run the script with
sudo
as well.spacedementia87
Sun, 03/03/2019 - 18:20
Permalink
Unfortunately I seem to get
Unfortunately I seem to get the same error:
piborg
Mon, 03/04/2019 - 17:26
Permalink
Try without pygame.display.init()
Try commenting out the
pygame.display.init()
line, it might not be needed.piborg
Mon, 03/04/2019 - 19:04
Permalink
Another possible solution
You could also try using this command before running the script:
You might need to put the script back to the original code as well.
jdh30
Sat, 09/07/2019 - 21:26
Permalink
I had the exact same sequence
I had the exact same sequence of problems (video and then console). This export fixed it for me. Thanks!
spacedementia87
Mon, 03/11/2019 - 11:37
Permalink
Unfortunately not. Still not
Unfortunately not. Still not working.
Surely I can't be the only person having this issue. Is there no way of running the joystick control without a screen attached?
How is everyone else doing it?
piborg
Mon, 03/11/2019 - 17:58
Permalink
Not sure what to try
When we have had this problem in the past one of the above suggestions has fixed the issue :(
Unfortunately this seems to be a problem that only occurs for some people and we have not been able to figure out exactly how to stop it.
You can probably get it to work if you enable X11 forwarding on SSH. If you are using PuTTY this guide explains how: https://www.cpdforteachers.com/resources/setting-up-ssh-and-x-forwarding...
piborg
Wed, 03/13/2019 - 21:20
Permalink
I have some good news
we have had some discussion around the office and have a plan to make our own joystick input code without the need for pygame at all.
The good news is that this will completely remove the problem you are seeing as our code will not be trying to do anything with the screen. It just talks to the controller :)
The bad news is that I am not sure how long it will take. We have a lot of great ideas and some improvements on the existing pygame API which should make the scripts easier to understand and modify.
Hopefully when it is ready we will have a library which is focused on controllers and easier to use for people writing code for their robots.
dasdasdasdas
Sun, 12/20/2020 - 11:58
Permalink
I've had the same issue but I
I've had the same issue but I found this page that really got to the root of the problem and solved it for me:
https://unix.stackexchange.com/questions/58961/how-do-i-let-an-sdl-app-n...