-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd-daemon.8
226 lines (194 loc) · 6.61 KB
/
lcd-daemon.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
.\" vim: tw=75
.LL 1i
.TH lcd-daemon 8
.SH NAME
lcd-daemon \- Daemon for controlling LCD Displays with Hitachi 44780
controller
.SH SYNOPSYS
\fBlcd-daemon\fR [-v] [-f \fIfifo\fR] [-m \fImode\fR]
[-b \fIbits\fR] [-c \fIcols\fR] [-r \fIrows\fR]
.nf
[-t readtimeout] [-p port]
[-d \fIscroll_delay\fR] [-i startup_message] [-s shutdown_message]
.fi
.SH DESCRIPTION
\fBlcd-daemon\fR(1) reads a named pipe \fIfifo\fR or listens on a UDP
socket to read messages from clients to be printed on 20x4 or 16x2 LCD
Displays with Hitachi 44780 controller. \fBlcd-daemon\fR(8) creates the
directory for the named pipe \fIfifo\fR, if it doesn't exist. The file mode
for \fIfifo\fR can be provided by \fImode\fR. \fIcols\fR and \fIrows\fR
depends on the LCD display connected - either a 20x4 display which has 20
colums and 4 rows or a 16x2 display which has 16 columns and 2 rows. You
can operate these displays in 4 bit mode or 8 bit mode. In 4 bit mode 4
terminals of the LCD data pins are connected (pins D4 to D7). In 8 bit
mode, all 8 data pins of the LCD display are connected (pins D0 to D7).
\fBlcd-daemon\fR(8) is generally started through supervise(8) using
/service/lcd-daemon service. You can however use your own method to start
\fBlcd-daemon\fR(8). \fBlcd-daemon\fR(8) uses the wiringPi library, which
needs write access to /dev/mem and /dev/gpiomem and needs to run with uid 0.
By default, \fBlcd-daemon\fR(8) creates \fIrundir/lcd-daemon/lcdfifo\fR
named pipe and listens on UDP port \fB1806\fR.
You can use \fBnc\fR(1) command or any TCP applciation to write a message
to the UDP port 1806. You can use any any client that writes to the named
pipe \fIrundir/lcd-daemon/lcdfifo\fR, created by \fBlcd-daemon\fR(8).
\fBpilcd\fR(1) is one client that writes to the named pipe created by
\fBlcd-daemon\fR(8).
Any client has to write the message by following format below (<sp> stands
for the white space character).
.EX
\fIrownum\fR<sp>\fIscroll\fR<sp>\fIclear\fR:\fImessage\fR
.EE
where
.TP
\fIrownum\fR
value can be 0 or 1 for 16x2 display or 0, 1, 2 or 3 for 20x4 display.
.TP
\fIscroll\fR
value can be 0 or 1. 1 turns on scrolling
.TP
\fIclear\fR
The following values are supported for \fIclear\fR
.EX
1 clear the screen
2 clear and initialize
3 initializing LCD display
4 clear screen without displaying text
5 clear and initialize screen without displaying text
6 initialize screen without displaying text
.EE
.TP
\fImessage\fR
Here \fImessage\fR is any string consisting of one or more words.
.SH OPTIONS
.TP
\fB\-v\fR
Turn on verbose output
.TP
\fB\-f\fR \fIfifo\fR
Path to fifo
.TP
\fB\-m\fR \fImode\fR
File mode to set for \fIfifo\fR on startup.
.TP
\fB\-b\fR \fIbits\fR
This is either the value 8 or 4 to specify 8 bit or 4 bit operation.
.TP
\fB\-c\fR \fIcols\fR
This is either the value 20 or 16 to specify 20 character or 16
character display
.TP
\fB\-r\fR \fIrows\fR
This is either the value 4 or 2 to specify 4 rows or 2 rows display
.TP
\fB\-d\fR \fIdelay\fR
This can be used to change the default delay period in milliseconds of
200ms for scrolling.
.TP
\fB\-p\fR \fIport\fR
UDP port on which \fBlcd-daemon\fR(8) listens. If not provided this is
\fB1806\fR.
.TP
\fB\-t\fR \fIreadtimeout\fR
No of milliseconds \fBlcd-daemon\fR(8) will read a message from a client
before timing out. Default is 300 milliseconds.
.TP
\fB\-i\fR \fIstartup_msg\fR
Startup message to be displayed on LCD on \fBlcd-daemon\fR(8) startup
.TP
\fB\-s\fR \fIshutdown_msg\fR
Shutdown message to be displayed on LCD on \fBlcd-daemon\fR(8) startup
.SH Environment Variables
\fBlcd-daemon\fR(8) uses the following environment variables.
.TP 13
LCDFIFO
If the -f option is not provided, \fBlcd-daemon\fR(8) reads
\fIrundir/lcd-daemon/lcdfifo\fR, where \fIrundir\fR is /run, /var/run or
/tmp depending on your system. The fifo can be changed by setting
\fBLCDFIFO\fR environment variable.
.TP
FIFO_MODE
if the -m option is not provided, \fBlcd-daemon\fR(8) sets 0666 as the file
mode for \fIfifo\fR. The mode can be changed by setting \fBFIFO_MODE\fR
environment variable.
.TP
VERBOSE
If -v option is not provided the value of \fBVERBOSE\fR environment is
used. Setting \fBVERBOSE=1\fR turns on verbose output and \fBVERBOSE=0\fR
turns of verbose output.
.TP
SCROLL_DELAY
Delay in milliseconds. Default 200 milliseconds
.TP
DATA_TIMEOUT
If -t is not provided, the env variable \fBDATA_TIMEOUT\fR is used. This is
timeout in seconds after which \fBlcd-daemon\fR(8) will timeout when
reading from the named pipe or from the socket. Default is 300 seconds.
.TP
PORT
If -p is not provided, the env variable \fBPORT\fR is used. This is the UDP
port on which \fBlcd-daemon\fR(8) listens for UDP packets. Default port is
\fB1806\fR.
.TP
BIT_MODE
If -b is not specifed, the value of this environment variable is used.
There is no default. You have to either use the -b option or set
\fBBIT_MODE\fR environment variable.
.TP
LCD_WIDTH
If -c is not specifed, the value of this environment variable is used to
specify the columns that the LCD display supports. There is no default. You
have to either use the -c option or set \fBLCD_WIDTH\fR environment
variable.
.TP
LCD_ROWS
If -r is not specifed, the value of this environment variable is used to
specify the rows that the LCD display supports. There is no default. You
have to either use the -r option or set \fBLCD_ROWS\fR environment variable.
.TP
PIN_RS
The pin on Raspberry Pi / Banana Pi which is connected to the RS pin on the
LCD display.
.TP
PIN_EN
The pin on Raspberry Pi / Banana Pi which is connected to the EN pin on the
LCD display
.TP
PIN_D0
The pin on Raspberry Pi / Banana Pi which is connected to the Data 0 pin on
the LCD display
.TP
PIN_D1
The pin on Raspberry Pi / Banana Pi which is connected to the Data 1 pin on
the LCD display
.TP
PIN_D2
The pin on Raspberry Pi / Banana Pi which is connected to the Data 2 pin on
the LCD display
.TP
PIN_D3
The pin on Raspberry Pi / Banana Pi which is connected to the Data 3 pin on
the LCD display
.TP
PIN_D4
The pin on Raspberry Pi / Banana Pi which is connected to the Data 4 pin on
the LCD display
.TP
PIN_D5
The pin on Raspberry Pi / Banana Pi which is connected to the Data 5 pin on
the LCD display
.TP
PIN_D6
The pin on Raspberry Pi / Banana Pi which is connected to the Data 6 pin on
the LCD display
.TP
PIN_D7
The pin on Raspberry Pi / Banana Pi which is connected to the Data 7 pin on
the LCD display
.SH RETURN VALUE
0 if all steps were successful, non-zero otherwise. If any of the steps
fail, a diagnostic message is printed. If any systerm error is encountered,
the return value will be 111.
.SH AUTHORS
Manvendra Bhangui <lcd-daemon@indimail.org>
.SH "SEE ALSO"
supervise(8), svc(8), envdir(8), multilog(8), pilcd(1), notify-daemon(8)