0

I have a google aiyproject voice kit. I have setup authentication and everything work when the script is run from terminal, like ./example.py. I configured the same script as a systemctl service, and when start I get this error.

Feb 26 20:27:47 raspberrypi python3[933]: To use the Assistant API, manually start the application from the dev terminal.
Feb 26 20:27:47 raspberrypi python3[933]: See the "Turn on the Assistant API" section of the Voice Recognizer
Feb 26 20:27:47 raspberrypi python3[933]: User's Guide for more info.

I see this piece of code here

  if not os.getenv('DISPLAY') and not sys.stdout.isatty():
        print("""
To use the Assistant API, manually start the application from the dev terminal.
See the "Turn on the Assistant API" section of the Voice Recognizer
User's Guide for more info.""")
        sys.exit(1)

I am not too familiar with python, and wonder why can't it run as a service. The auth token is saved in a file, and no need to be interactive. Is there a way I can achieve this. My requirement is that on system boot, the assistant program should start automatically in headless mode.

bsr
  • 57,282
  • 86
  • 216
  • 316
  • Not too familiar with the google-aiy but if you have access to that portion of code why not just remove it? From the looks, that will just try to install the credentials, if you already have one and need to sign in you should be fine removing that condition. – user1767754 Feb 27 '19 at 02:57
  • thanks. the project is open source, as I am not too familiar with the project or python, didn't venture it yet. But, will try if no other way. Currently trying out https://www.digikey.com/en/maker/projects/cc16cb41a3d447b8aaacf1da14368b13, in which there is a section on systemd with GUI. will update the progress. – bsr Feb 27 '19 at 03:26

0 Answers0