n0bel / PiClock3

A Fancy Clock built around a monitor and a Raspberry Pi and python3 + pyqt5
MIT License
15 stars 3 forks source link

Unhandled Error - AttributeError: 'Config' object has no attribute 'styles' #5

Open Rabidgeek opened 2 years ago

Rabidgeek commented 2 years ago

I'm able to run, customize a bit and run again PiClock3 manually. No problems there. However, trying to get it to start on reboot - tried two ways, first was a crontab -e, added '@reboot /usr/bin/python3 /home/pi/PiClock3/PyQtPiClock3.py' but it refuses to run because qt.qpa.plugin and qt.qpa.xcb could not connect to display, need to reinstall Qt... so I wrote a display.desktop in /etc.xdg/autostart with similar command to run PiClock3. However, it gives me the Unhandled Error on boot and does not execute the program. I can open terminal and run python3 PyQtPiClock3.py and it starts up just fine! Seems problem is running this so early in startup?

looking forward to your map update!

SerBrynden commented 2 years ago

Have you tried mimicking how it's done in the original PiClock with the startup.sh script? It includes a wait for Xwindows and the desktop to start up. https://github.com/n0bel/PiClock

Rabidgeek commented 2 years ago

Thanks - I did that, and now the logs are back to Qt errors. this one says: "Invalid MIT-MAGIC-COOKIE-1 keyqt.qpa.xcb: could not connect to display :0 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted"

Even though on reboot this happens, I just have to open terminal and run python3 PyQtPiClock3.py and all is fine.

SerBrynden commented 2 years ago

Beats me. Maybe n0bel or others will have some ideas.

Rabidgeek commented 2 years ago

Thanks for your help, though. If its of any help, I'm running a Raspberry Pi 4, 4gb ram, all required packages installed to the most recent version, with a small samsung tv. Tv was on the entire time during reboots. So far I've been running the PiClock3 since my last reply without issue. Been working on customizing the fonts, but struggling with figuring out how to apply shadows. I've reinstalled pyqt5 twice, too. Maybe n0bel's next update will fix my issue? fingers crossed!