crontab doesn't turn off LCD cloudshell 2

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Antho
Posts: 5
Joined: Sun Feb 18, 2018 12:07 pm

crontab doesn't turn off LCD cloudshell 2

Post by Antho »

Good evening :),

I'm rocking a Xu4 with the cloudshell 2. Right now I'm trying to implement a script so that the LCD turn's off and on at a specific time.

I have the following 2 scripts in the following folder "/home/dietpi"

Lcd_off.sh:

Code: Select all

#!/bin/bash
echo 1 > /sys/class/backlight/*/bl_power
Lcd_on.sh:

Code: Select all

#!/bin/bash
echo 0 > /sys/class/backlight/*/bl_power
Furthermore created i a crontab via "crontab -e" and enterd the following

Code: Select all

0 8 * * * /path/to/lcd_on.sh
0 22 * * * /path/to/lcd_off.sh
Everything is going well :). If i use "crontab -l" I see the following:

Code: Select all

0 8 * * * /path/to/lcd_on.sh
0 22 * * * /path/to/lcd_off.sh
But as you aspect the cron isn't starting :(. Does anyone know how to fix this problem?
Last edited by Antho on Fri Jul 27, 2018 7:22 am, edited 1 time in total.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: crontab doesn't turn off LCD cloudshell 2

Post by johnvick »

I haven't the cloudshell 2 but the first version. The dietpi-cloudshell utility should do what you want?

John
Antho
Posts: 5
Joined: Sun Feb 18, 2018 12:07 pm

Re: crontab doesn't turn off LCD cloudshell 2

Post by Antho »

I tried that, and yes that works for 50% ( in my case).
  • If I install the dietpi-cloudshell and setup an interval it works, but the LCD keeps on ( backlight is still on)
  • The codeline I posted turns the LCD completely of ( including the backlight)
So that was my goal ;), I want to completely turn off the LCD
Antho
Posts: 5
Joined: Sun Feb 18, 2018 12:07 pm

Re: crontab doesn't turn off LCD cloudshell 2

Post by Antho »

I Fixed it :) :), I forgot to give the shell permission to execute the scripts. I needed the set

Code: Select all

chmod 755 lcd_on.sh
and

Code: Select all

chmod 755 lcd_off.sh
After that the cronjob works flawless 8)
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: crontab doesn't turn off LCD cloudshell 2

Post by johnvick »

Nice - I may try this as on my device dietpi-cloudshell doesn't work well after a reboot unless I go into its menu, save settings and restart.

Edit - just tried your scripts from the command line but no luck - did they work that way for you?

What do you use to display stuff on the screen?

John
Antho
Posts: 5
Joined: Sun Feb 18, 2018 12:07 pm

Re: crontab doesn't turn off LCD cloudshell 2

Post by Antho »

johnvick wrote: Fri Jul 27, 2018 8:40 pm
Nice - I may try this as on my device dietpi-cloudshell doesn't work well after a reboot unless I go into its menu, save settings and restart.

Edit - just tried your scripts from the command line but no luck - did they work that way for you?

What do you use to display stuff on the screen?

John

Are you using the cloudshell 2 or the 1ste cloudshell?

If you use the first cloudshell try this.
( For testing just past the following in the command line, just to see if the screen goes off)

Code: Select all

# Turn off backlight
echo 1 | sudo tee /sys/class/backlight/*/bl_power
 
And for turning on the screen

Code: Select all

# Turn on backlight
echo 0 | sudo tee /sys/class/backlight/*/bl_power
If it works just use my setup with this code ;).

I use the standard LCD software from odroid. But I guess, you could also use the dietpi-cloudshell software ( combined with this script).

PS, what do you mean with:
Edit - just tried your scripts from the command line but no luck - did they work that way for you?
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: crontab doesn't turn off LCD cloudshell 2

Post by johnvick »

Those commands work just fine thanks (cloudshell 1).

What I meant was when the original dietpi-cloudshell came out I seem to remembr the commands only worked from within a script, not from the CLI.

John
Antho
Posts: 5
Joined: Sun Feb 18, 2018 12:07 pm

Re: crontab doesn't turn off LCD cloudshell 2

Post by Antho »

johnvick wrote: Sun Jul 29, 2018 10:57 pm Those commands work just fine thanks (cloudshell 1).

What I meant was when the original dietpi-cloudshell came out I seem to remembr the commands only worked from within a script, not from the CLI.

John
Aaah oké. Nice to be able to help you anyway ;)
Post Reply