Been a long time since I posted here, 2012 in fact!
I've been struggling to get my project to move forward, I've installed a Pi 2b a small 300w amp and an Arduino inside the case for a double din car radio (For my camper van) with the hopes and dreams of it being a touchscreen sensor display as well as pass through bluetooth audio (This part works flawlessly, https://github.com/BaReinhard/Super-Sim ... er-Install for details)
So I have the hardware all connected up, audio working fine, arduino on I2C with the pi, wifi in my van means I can access it remotely, even customised the cloud4rpi.io scripts to show my public IP so I can ssh to it on a non standard port from anywhere. All fine.
The last part im struggling with is the GUI, im running the latest headless Jessie with a 7" 1024x600 screen from aliexpress (not great but for £25 its a steal).
My idea was to launch pygame on boot (systemd service?) but can't seem to get an image out of it successfully. I've googled and googled this but all solutions I try don't seem to work. My last attempt was to use code from here https://facelesstech.wordpress.com/2017 ... pi-camera/ which looked promising as I was able to use fim, the frame buffer tool, to show a splash screen (altho not successfully on boot, got the console text over the top as it scrolled through)
The rest of the plans to connect up the sensors and relays etc is simple enough, just this one thing has defeated me, now my new wife thinks i'm not the nerd I promised I was, please help me save my marriage
Will going to a lightweight desktop environment be the simplest solution, will this be worth the extra load?
This is my current code:
Code: Select all
#!/usr/bin/env python3 import pygame import sys import time from time import strftime import os import json time_stamp_prev=0 os.environ['SDL_AUDIODRIVER'] = 'dsp' os.environ["SDL_VIDEODRIVER"] = "fbcon" os.environ["SDL_FBDEV"] = "/dev/fb0" print(os.environ["SDL_FBDEV"]) pygame.init() size = width, height = 1024, 600 #pygame.mouse.set_visible(0) screen = pygame.display.set_mode(size) while True: displayTime() pygame.display.flip() time.sleep(10) graph = pygame.image.load("/opt/splash.png") graphrect = graph.get_rect() screen.blit(graph, graphrect) pygame.display.flip() time.sleep(10)
Forgot to include the error!
Code: Select all
[email protected]:~ $ ./test3.py pygame 1.9.5 Hello from the pygame community. https://www.pygame.org/contribute.html /dev/fb0 Traceback (most recent call last): File "./test3.py", line 19, in <module> screen = pygame.display.set_mode(size) pygame.error: Unable to open a console terminal