Hallo
Ich habe mir den Mars-Rover von Elektor gekauft. Nun möchte ich, dass beim einschalten des Rovers das einfache Fahrprogramm automatisch startet. (driveRover.py) Im Ordner «marsrover» stehen aber noch mehr Programme zur Auswahl. Zum Beispiel «ledTest.py» Beide Programmteile kann ich im LX-Terminal problemlos starten. Nun habe ich beide Programme mal in die Datei «rc.local» aufgenommen. Die einfachere Datei «ledTest.py» läuft einwandfrei. Die Datei «driveRover» ist aber mit anderen Dateien verhängt, die startet nicht. Als nächstes versuchte ich es mit der speziellen Datei «crontab». Beide obigen Dateien bringe ich aber nicht zum laufen. Die Dateirechte sind bei beiden Dateien auf «jeder» angepasst. In der Datei «crontab» habe ich schon zig Möglichkeiten ausprobiert, aber noch keine Lösung gefunden….
Zum Beispiel habe ich das root weggelassen oder nur mit python ohne das 3, oder eine 1 bei @reboot vorangestellt usw.
Reicht das für eine Analyse? Das wäre toll.
Einige Beispiele die ich in «crontab» ausprobiert habe sehen sie hier:
GNU nano 2.7.4 Datei: /etc/crontab Verändert
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
@reboot sudo python3 /home/pi/marsrover/ledTest.py
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron
( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron
( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron
( cd / && run-parts --report /etc/cron.monthly )
@reboot root python3 /home/pi/marsrover/ledTest.py
#------------------
LX-Terminal (dieses Vorgehen funktioniert!)
pi@raspberrypi:~ $ cd marsrover
pi@raspberrypi:~/marsrover $ sudo python ledTest.py
^Cpi@raspberrypi:~/marsrover $
Hardware: Marsrover von elektor (4tronix), Pi zero, micro SD 8Gb
Software: 4tronixSD.rar
Gerhard