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

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 
refresh.sh

code: select all

wid=$(xdotool search --onlyvisible --class midori|head -1) xdotool windowactivate ${wid} xdotool key ctrl+f5 
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

code: select all

cd / cd home/pi/flickr-uploader sudo python refresh_trigger.py cd / 
browser starts, script running. when press button hear sound no browser refresh... with:

code: select all

sub.call(['sh','refresh.sh'])
has idea why working when start script manually not boot?



raspberrypi



Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support