LCDproc development and user support list

Text archives Help


[Lcdproc] Display forgets lines or freezes


Chronological Thread 
  • From: zeeman AT gmx.net (zeeman)
  • Subject: [Lcdproc] Display forgets lines or freezes
  • Date: Thu Jan 13 20:03:01 2005

Hi!

At the moment I test only with the ncurse-interface of LCDd, but I saw
the same behavior with my HD47780 (which is broken now -.-).

I use a 4x20 Display (the HD47780 was a 4x20 and ncurse shows me 4x20, too).

Sometimes (can't reproduce it) some lines are shown blank.
A new refresh bringt live back into that lines and they behave like always.
Mostly, it's the first or the last line.

A greater problem occours, too:
Sometimes, the whole LCDd-process hangs and the display only shows the
last screen.
But this doesn't effekt any other programs who communicate with LCDd.

I use LCDd only with my own program, so it's maybe also a logical
problem in my program.
Here are the funkctions I use to communiate with LCDd:

Preparing:
--------------------
ClientSocket* LCDconnect(int Display=0)
{
cout << "LCD ";
ClientSocket* client_socket;
client_socket = new ClientSocket( "127.0.0.1", (13666+Display) );
//sometimes I use 2 LCDds, but the problems occours, too
string reply;
*client_socket << "hello\r\n";
*client_socket << "client_set name zmp3\r\n";
*client_socket << "screen_add 0\r\n";
*client_socket << "screen_set 0 heartbeat off\r\n";
*client_socket << "widget_add 0 0 string\r\n";
*client_socket << "widget_add 0 1 string\r\n";
*client_socket << "widget_add 0 2 string\r\n";
*client_socket << "widget_add 0 3 string\r\n";

cout << "[OK]" << endl;
return client_socket;
}
----------------------
The main-function:
----------------------
void LCDwrite(ClientSocket* client_socket, int line, string Text)
{
pthread_mutex_lock(&mutexLCD);
switch(line)
{
case 0:
*client_socket << "widget_set 0 0 1 1 \"" << Text <<"\"\r\n";

break;
case 1:
*client_socket << "widget_set 0 1 1 2 \"" << Text <<"\"\r\n";

break;
case 2:
*client_socket << "widget_set 0 2 1 3 \"" << Text <<"\"\r\n";

break;
case 3:
*client_socket << "widget_set 0 3 1 4 \"" << Text <<"\"\r\n";

break;
}
pthread_mutex_unlock(&mutexLCD);
}
------------------------
I tested around with this function.
At the moment I added the mutex-functions, because the programm, who
uses the LCDwrite()-function has 2 threads (main+child).
The two threads _never_ call LCDwrite with the same client_socket (child
doesn't know something about the main-client_socket).

And the usage of LCDwrite:
-------------------------
LCDwrite(Display2, 0, "Music-Thread [OK]");
LCDwrite(Display2, 1, "Sound-System ");
LCDwrite(Display2, 2, " ");
LCDwrite(Display2, 3, " ");

/* Some stuff here */

LCDwrite(Display2, 1, "Sound-System [OK]");
-------------------------
This is the way I use LCDwrite.

Does anybody have a hint for me?
Sebastian

P.S.: Sorry for my bad english -.-




Archive powered by MHonArc 2.6.18.

Top of page