Re: How to persist text on the screen when the client exits?
Eric Pooch <[email protected]> Tue, 1 Jan 2013 16:53:12 -0800
| Newsgroups | gmane.comp.sysutils.lcdproc |
|---|---|
| Message-ID | <[email protected]> |
I don't think there is an easy way to change LCDproc in the way you want. However, why can't you just keep the client connected? It should be easy. You can use your shell script to do all of the background work and keep running in a loop, sending raw text to stdout. When you invoke it, pipe the the script information to the stdin of lcdproc_client.py. Like this: lcd_status.sh | lcdproc_client.py As long as the script keeps running, lcdproc_client should keep running (I think, by what I read of the code just now). As long as the client stays connected, your screen will stay in the LCDproc rotation. --Eric On Jan 1, 2013, at 3:59 PM, Richard Neill wrote: > Dear Eric, > > Thanks for your quick reply. > > I'm afraid that my simplified bash script > may have added confusion - I do know about the -t option for the > client. > Also, I'd rather not respawn python every time - but in this case > it's OK (the performance hit, while wasteful, is not actually an > issue). The machine I'm monitoring is actually an ADSL router - > it's job is just to run multilink ppp, and is rather overspecd, > > So, I'm attaching my script, which may make things a bit clearer. > This is launched from cron with "@reboot". > > Anyway, it works fine, except that the screen is blank about half > the time. > > What I really want is to treat the LCD display like a simple > character device, into which I can echo text. I appreciate the > sophistication of the lcdproc architecture, with support for > buttons, menus etc, but in this particular use-case, I don't need it. > > Best wishes, > > Richard > > > On 01/01/13 23:44, Eric Pooch wrote: >> You need to re-imagine your client rather than the change the server. >> Your client is spawning 4 processes every 2 seconds. This doesn't >> seem like a good idea. >> >> As a temporary fix, the -t option for lcdproc_client.py will keep >> the connection open for the time you specify. I would change your >> final sleep command to account for this. >> >> --Eric >> >> On Jan 1, 2013, at 3:27 PM, Richard Neill wrote: >> >>> Dear All, >>> >>> I've just joined this list, so please excuse me if I ask an obvious >>> question. >>> >>> I'm trying to get a server status monitor system working, >>> monitoring a set of parameters of my choice (the lcdproc defaults >>> aren't suitable for me here) >>> >>> So, I have LCDd running (with a 20x2 picolcd), and found the text >>> client here: http://lcdproc-client.sourceforge.net/ >>> >>> I have a bash-script that sends strings to the client every few >>> seconds, and they display on the LCD as expected. A simplified >>> example: >>> >>> while : ; do hostname | lcdproc_client.py -f - sleep 1 date | >>> lcdproc_client.py -f - sleep 1 done >>> >>> >>> This displays the hostname and the date, alternately, as I expect. >>> >>> BUT, between these, every time the python script exits, the system >>> keeps going back to either the LCDd default screen, or to blank >>> (the value of ServerScreen). >>> >>> How can I get LCDd to just leave the text on screen as it was, >>> until I explicitly overwrite it? >>> >>> Thanks very much, >>> >>> Richard >>> >>> >>> P.S. Might I suggest that a "--text" option to lcdproc i.e. "write >>> this line to screen, and exit" would be really useful in the >>> default distribution. >>> >>> >>> _______________________________________________ LCDproc mailing >>> list [email protected] >>> http://lists.omnipotent.net/mailman/listinfo/lcdproc >> >> > > <lcd_status.sh>_______________________________________________ > LCDproc mailing list > [email protected] > http://lists.omnipotent.net/mailman/listinfo/lcdproc