Script on Boot - Raspberry Pi Forums
hej,
try trigger .sh file python script.
code. , works fine when running sudo python refresh_trigger.py
refresh_trigger.py refresh.sh try run script , launch browser on boot.
browser:
/etc/xdg/lxsession/lxde-pi/autostart
@xset s off
@xset -dpms
@xset s noblank
@midori -a http://www.google.com
script
crontab:
@reboot sh /home/pi/path/launcher.sh >/home/pi/logs/cronlog 2>&1
launcher.sh browser starts, script running. when press button hear sound no browser refresh... with: has idea why working when start script manually not boot?
try trigger .sh file python script.
code. , works fine when running sudo python refresh_trigger.py
refresh_trigger.py
code: select all
import rpi.gpio gpio import time import picamera import subprocess sub pygame import mixer mi[b][/b]xer.init() mixer.music.load("../sound.wav") gpio.setmode(gpio.bcm) photobutton = 25 gpio.setup(photobutton,gpio.in,pull_up_down=gpio.pud_up) while true: if gpio.input(photobutton) == false: sub.call(['sh','refresh.sh']) mixer.music.play() while mixer.music.get_busy() == true: continue
code: select all
wid=$(xdotool search --onlyvisible --class midori|head -1) xdotool windowactivate ${wid} xdotool key ctrl+f5
browser:
/etc/xdg/lxsession/lxde-pi/autostart
@xset s off
@xset -dpms
@xset s noblank
@midori -a http://www.google.com
script
crontab:
@reboot sh /home/pi/path/launcher.sh >/home/pi/logs/cronlog 2>&1
launcher.sh
code: select all
cd / cd home/pi/flickr-uploader sudo python refresh_trigger.py cd /
code: select all
sub.call(['sh','refresh.sh'])
raspberrypi
Comments
Post a Comment