tvservice-cleint: Failed to connect to TV service: -1

Hello! My program goal is take pictures, when sensor is triggered. I use raspbian latest version and have done all updates and so on. It saves pictures directly to network drive. My program works fine for days and suddenly it gets to “tvservice-client: Failed to connect to TV service: -1”. Only reboot seems to work, restart program wont help But how do I catch that error? Programs runs in lxterminal, maybe thats the cause of the issue? I mean I added lines to /home/pi/.bashrc

I could create new exception, but how would I catch that from python shell?
class TvServiceError(Exception):

I am begginner, so dont be harsh :slight_smile: . Thank you for helping ;)!



I’m sorry we missed your question, may I ask if you are making any progress now?

Hello, I have not fixed random crashing :slight_smile:


It seems you have not connect the hdmi display.


Hello, but I like to use Raspberry via remote connection, then I wouldnot need hdmi display. What should I do then?



Sorry for my late reply. I think there should be at least one display device. some application does not support remote display. Connect one hdmi display, you can run export DISPLAY=:0 then you can log in the the system remotely.