Closed daeks closed 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.
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.
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]: . `
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
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 :)
I have never created /root/.jslisten. Just created a symlink after the above log mentioned it.
I know. It happens automatically during the first run, if no configuration exists. Maybe I should change this logic.
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=