Can anyone help setting up PiGlow on OSMC?

The default user on OSMC is osmc with its home directory being /home/osmcso you would need to change all occurrences of /home/pi by it

yeap , you right its work now Thank You :slight_smile:

sort , thank you

hello one more thing , how to delete old script from startup and add another one?

Which startup and how did you add it to there?

Auto start the clock.py example

Sometimes you a script to start automatically, so you don’t have to login each time to start the script. The binary clock script is a perfect one to do this with.

So follow this simple guide to have the binary clock start when you plug your Raspberry Pi in:

After following the Installation instructions and having run the test script:

Make the piglow directory if not already done:

mkdir /home/pi/piglow

cd /home/pi/piglow
Download the clock.py script into the /home/pi/piglow folder:

wget https://raw.github.com/Boeeerb/PiGlow/master/piglow.py
wget https://raw.github.com/Boeeerb/PiGlow/master/Examples/clock.py
Next create the init.d file, so change to the /etc/init.d folder

cd /etc/init.d
Now create the file

sudo nano clock
And paste the following

#!/bin/sh

/etc/init.d/test

BEGIN INIT INFO

Provides: clock

Required-Start: $remote_fs $syslog

Required-Stop: $remote_fs $syslog

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: Simple script to auto start binary clock

Description: Simple script to auto start binary clock

END INIT INFO

case “$1” in
start)
sudo python /home/pi/piglow/clock.py &
;;
stop)
killall python
;;
*)
exit 1
;;

esac
exit 0
Ctrl + x and Y to save, notice there is no file extension

Now make the file executable

sudo chmod +x clock
And add the clock to the startup scripts

sudo insserv clock
Try it out without restarting

sudo /etc/init.d/clock start
After you have observed it starting, we should be safe to reboot

sudo reboot

To be honest not sure if it was necessary to copy the whole thing into the post you could just point out to the instructions you followed.
Anyhow if you copy something like that into your posts use the peformatted text button </> to make it appear readable.

Now coming to your question, first using init.d scripts is a bit outdated for OSMC so you might want to check if you can transform that into a service based start script.

To remove your clock script you could try sudo update-rc -f clock remove
Adding another service to startup follow the instructions and exchange clock with whatever script you have in mind.

ok thanks will try to do it