Ich arbeite derzeit an einer Multimedia-Maschine, die ich über eine PS4 DS4 (mit ds4drv
und ein bisschen Scripting) steuern möchte. Alles funktioniert wie ein Zauber, wenn er manuell über Bash/Terminal gestartet wird. Aber fast nichts funktioniert, wenn über crontab
gestartet wird.Env & Crontab -> Programm funktioniert in bash aber wird nicht über cron
Bis jetzt habe ich einige Nachforschungen gemacht und es scheint, als ob der Fehler irgendwie mit meiner Umgebung vars zusammenhängt.
Auch ds4drv
andauernd abstürzt, wenn es mit dem Vars von cron
gestartet wird:
[email protected]:~$ env - `cat ~/cronenv` /bin/sh
$ /usr/local/bin/ds4drv
[info][controller 1] Created devices /dev/input/js2 (joystick) /dev/input/event25 (evdev)
[info][controller 1] Connected to Bluetooth Controller (1C:66:6D:64:2F:74 hidraw5)
[info][hidraw] Scanning for devices
[info][controller 1] Battery: 75%
[info][controller 1] Switching to profile: kbmouse
[info][controller 1] Switching to profile: gaming
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "build/bdist.linux-x86_64/egg/ds4drv/__main__.py", line 110, in run
self.loop.run()
File "build/bdist.linux-x86_64/egg/ds4drv/eventloop.py", line 105, in run
callback()
File "build/bdist.linux-x86_64/egg/ds4drv/__main__.py", line 107, in read_report
self.fire_event("device-report", report)
File "build/bdist.linux-x86_64/egg/ds4drv/__main__.py", line 39, in fire_event
self.loop.fire_event(event, *args)
File "build/bdist.linux-x86_64/egg/ds4drv/eventloop.py", line 90, in fire_event
self.process_events()
File "build/bdist.linux-x86_64/egg/ds4drv/eventloop.py", line 96, in process_events
callback(*args)
File "build/bdist.linux-x86_64/egg/ds4drv/action.py", line 73, in _handle_report
self.handle_report(report)
File "build/bdist.linux-x86_64/egg/ds4drv/actions/binding.py", line 105, in handle_report
binding.callback(report, *binding.args)
File "build/bdist.linux-x86_64/egg/ds4drv/actions/binding.py", line 62, in <lambda>
lambda r: self.controller.next_profile())
File "build/bdist.linux-x86_64/egg/ds4drv/__main__.py", line 62, in next_profile
self.load_profile(self.profiles[next_index])
File "build/bdist.linux-x86_64/egg/ds4drv/__main__.py", line 48, in load_profile
self.load_options(profile_options)
File "build/bdist.linux-x86_64/egg/ds4drv/__main__.py", line 94, in load_options
self.fire_event("load-options", options)
File "build/bdist.linux-x86_64/egg/ds4drv/__main__.py", line 39, in fire_event
self.loop.fire_event(event, *args)
File "build/bdist.linux-x86_64/egg/ds4drv/eventloop.py", line 90, in fire_event
self.process_events()
File "build/bdist.linux-x86_64/egg/ds4drv/eventloop.py", line 96, in process_events
callback(*args)
File "build/bdist.linux-x86_64/egg/ds4drv/actions/input.py", line 75, in load_options
self.joystick.device.close()
File "/usr/lib/python2.7/dist-packages/evdev/uinput.py", line 115, in close
self.device.close()
AttributeError: 'NoneType' object has no attribute 'close'
crontab:
@reboot /usr/local/bin/ds4drv > /home/hehxes/ds4drv/verbose.log
Das Protokoll zeigt nur die oben ausgegeben, wenn überhaupt.
Ich habe bereits versucht, cron
‚s Umgebung
@reboot /bin/bash; . /home/hehxes/.profile; /usr/bin/screen -dmS ds4drv-screen /usr/local/bin/ds4drv
aber ohne Erfolg zu spezifizieren.
Was mache ich falsch?
Danke, aber am Ende 'sudo crontab -e \ n @reboot su hehxes -c‚Bildschirm -DMS ds4 sudo ds4drv> home// hehxes/ds4drv/verbose.log' für mich gearbeitet – hehxes