workinghard / jslisten

listen to gamepad inputs and trigger a command
GNU General Public License v3.0
31 stars 18 forks source link

Unable to start jslisten #1

Closed daeks closed 7 years ago

daeks commented 7 years ago

I followed the instructions, but only got:

Dec 19 11:10:24 d-mini systemd[1]: Starting jslisten daemon... Dec 19 11:10:24 d-mini systemd[1]: Started jslisten daemon. Dec 19 11:10:24 d-mini jslisten[15339]: Listen to joystick inputs ... Dec 19 11:10:24 d-mini jslisten[15339]: err: button assignment missing. Please set at least button1 in the ini file! Dec 19 11:10:24 d-mini systemd[1]: jslisten.service: main process exited, code=exited, status=1/FAILURE

My /etc/jslisten.cfg looks like:

[Generic] program="/home/pi/test.sh" button1=8 button2=9 button3=10 button4=

workinghard commented 7 years ago

Maybe there are special invisible characters in your config file or lack of permissions. Try to run the program as root and use this config file https://raw.githubusercontent.com/workinghard/jslisten/master/etc/jslisten.cfg to avoid common mistakes. If that doesn't help, I will add more debug options, so you can check the reason.

daeks commented 7 years ago

thx for your input. I copied the config file from the repo but same error message. I tried to start the service with "sudo systemctl start jslisten.service" - Is that not enough? root is disabled by default.

workinghard commented 7 years ago

It basically should work with the user rights if the permissions set correct. Please try the new version I uploaded. This is what you can use now: pi@kodi ~/jslisten/bin $ ./jslisten --debug

Following similar result is to expect in the syslog: `Dec 19 21:16:33 kodi jslisten[2930]: Listen to joystick inputs ...

Dec 19 21:16:33 kodi jslisten[2930]: reading config /etc/jslisten.cfg

Dec 19 21:16:33 kodi jslisten[2930]: Filename: /opt/bin/modeSwitcher.sh

Dec 19 21:16:33 kodi jslisten[2930]: button1: 10

Dec 19 21:16:33 kodi jslisten[2930]: button2: 11

Dec 19 21:16:34 kodi jslisten[2930]: button3: 0

Dec 19 21:16:34 kodi jslisten[2930]: Active assigned buttons: 3

Dec 19 21:16:34 kodi jslisten[2930]: .

Dec 19 21:16:34 kodi jslisten[2930]: . `

daeks commented 7 years ago

It looks like that it loads the config from another place. After placing a symlink, it works fine :)

Dec 20 10:09:44 d-mini jslisten[9421]: Listen to joystick inputs ... Dec 20 10:09:44 d-mini jslisten[9421]: reading config /root/.jslisten Dec 20 10:09:44 d-mini jslisten[9421]: err: button assignment missing. Please set at least button1 in the ini file! Dec 20 10:09:44 d-mini jslisten[9421]: Active assigned buttons: 0

workinghard commented 7 years ago

Or you can simple delete the /root/.jslisten file. It will take the global one. The logic is to read the user config first and if it doesn't exist, take the global. I'm glad you found the issue :)

daeks commented 7 years ago

I have never created /root/.jslisten. Just created a symlink after the above log mentioned it.

workinghard commented 7 years ago

I know. It happens automatically during the first run, if no configuration exists. Maybe I should change this logic.