Enable LCD backlight permanently on QNAP TS-459 II
So you got one of these QNAP TS-459 II NAS boxes and want the fancy LCD being permantly backlit?
Here’s how to do it…
I recommend to have the Optware (IPKG) package from the QPKG repository installed. While not strictly required, it will provide an framework to keep our changes persistent after reboots.
Installing QPKG packages is made easy, just download the QPKG to your computer and install them from the QNAP admin panel.
You’ll find further readings on this topic on the QNAP homepage.
If you have just a brand new setup of Optware, you must enable it to run startup scripts automatically as pointed out in QNAP Wiki in section Running /opt/etc/init.d/* on startup.
If have you have already some services installed through Optware, like cron or snmpd, then the next step is not required.
Otherwise, you may need to create a few directories and set proper permissions, as these may not yet exist.
mkdir -p /opt/sbin /opt/etc/init.d chown admin:administrators /opt/sbin /opt/etc/init.d chmod 755 /opt/sbin /opt/etc/init.d
So, after you successfully installed Optware (IPKG), let’s move on with our backlight stuff.
Save the code below to a new file at /opt/sbin/lcd_backlight.
#!/bin/sh # # lcd_backlight - tries to keep front lcd lit at all times ;-) # while [ : ]; do # redirect lcd_tool output to nirvana # occasionally there'll be a 'cannot control LCD' message # but well, actually, who cares? ;-) /sbin/lcd_tool -o > /dev/null 2>&1 /bin/sleep 5 done
Don’t forget to make the new script executable:
# chmod 755 /opt/sbin/lcd_backlight
Now, you can always login through SSH and run /opt/sbin/lcd_backlight to have LCD backlight permanently turned on.
Maybe you want this to start automatically every time you reboot the box?
Add another script at /opt/etc/init.d/S99lcd-backlight with this contents:
#!/bin/sh RETVAL=0 QPKG_NAME="LCD_Backlight" QPKG_DIR= _exit() { echo -e "Error: $*" echo exit 1 } case "$1" in start) echo "Enabling permanent LCD backlight ..." /opt/sbin/lcd_backlight & RETVAL=$? ;; stop) echo "Disabling permanent LCD backlight ... " /bin/ps aux|/bin/grep lcd_backlight|/bin/grep -v grep|/bin/grep -v stop|/bin/awk '{ print $1 }'|/usr/bin/xargs kill -9 RETVAL=$? /bin/sleep 3 ;; restart) $0 stop $0 start RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $RETVAL
Make this executable as well:
chmod 755 /opt/etc/init.d/S99lcd-backlight
This hack will permanently enable the LCD backlight. Even that the output is suppressed, it shall be noted that the ‘lcd_tool’ binary spills a ‘Cannot control LCD’ message every now and then. This seems to mean no harm. However, enabling the LCD backlight permanently is probably neither intended nor supported by the vendor. You do this at your own risk.
September 18th, 2011 at 2:13 pm
Hi,
just made the changes and did a reboot.
Does not work with the Firmware 3.5.0 and TS-419p+.
After reboot all files are gone (lcd_backlight.sh and lcd_backlight)
Any ideas?
September 25th, 2011 at 2:28 pm
Yes, indeed the files are lost after reboot. I do have a fix for this, but I need to write it down. It involves placing some files witihin the opt structure.
September 29th, 2011 at 8:39 pm
I just wait for your instructions. 😉
December 2nd, 2011 at 3:53 pm
Sorry for the long time no hear, I was kept quiet busy. Please read my updated post on that topic.
December 14th, 2011 at 7:07 pm
Hi, its me again. On my system there are no folders /opt/sbin and /opt/etc/init.d
Should I generate them?
I have a TS-419p+ with 3.5.2 running.
January 22nd, 2012 at 6:46 pm
Hi Matthias,
According to your feedback I have the revised howto.
I filled some blanks, especially the need to add auto-start support to Optware after installation.
I had hoped that would be clear by having just the reference to QNAP WIki placed, now I added a direct link to appropriate section with explicit directions.
The issue with the missing directories applies only on brand new installations of Optware, so you’d need to create the directories. I have added a section describing this as well.
Please note also another omission from the last version: the name of the startup-script must be “/opt/etc/init.d/S99lcd-backlight” to really work.
If you had created it, just rename it like this: “mv /opt/etc/init.d/lcd_backlight /opt/etc/init.d/S99lcd-backlight”
Cheers,
Gianpaolo
January 13th, 2012 at 5:42 pm
This isn’t’ working because I don’t have the folder structure on my box as you described
October 29th, 2013 at 11:37 pm
Is this still the only solution to have the LCD permanently on?
A bit to technical for a noob like me…
/Per