crontab doesn't turn off LCD cloudshell 2

Good evening :slight_smile:,

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:

#!/bin/bash
echo 1 > /sys/class/backlight/*/bl_power

Lcd_on.sh:

#!/bin/bash
echo 0 > /sys/class/backlight/*/bl_power

Furthermore created i a crontab via “crontab -e” and enterd the following

0 8 * * * /path/to/lcd_on.sh
0 22 * * * /path/to/lcd_off.sh

Everything is going well :slight_smile:. If i use “crontab -l” I see the following:

0 8 * * * /path/to/lcd_on.sh
0 22 * * * /path/to/lcd_off.sh

But as you aspect the cron isn’t starting :frowning:. Does anyone know how to fix this problem?

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

John

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 :wink:, I want to completely turn off the LCD

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

chmod 755 lcd_on.sh

and

chmod 755 lcd_off.sh

After that the cronjob works flawless :sunglasses:

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)

# Turn off backlight
echo 1 | sudo tee /sys/class/backlight/*/bl_power

And for turning on the screen

# Turn on backlight
echo 0 | sudo tee /sys/class/backlight/*/bl_power

If it works just use my setup with this code :wink:.

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?

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 :wink: