RobTrapp
Golden User  
Anmeldungsdatum: 26.11.2005 Beiträge: 556
|
Verfasst am: 26 Jun 2009 19:20 Titel: LCD2USB Easiest Way for Linux and LCD |
 |
|
Hi an alle,
ich habe mich, da ein Hardware Update bei mir ansteht mal wieder mit dem Thema LCD beschäftigt.
Problemstellung war folgende:
Kein Parallel Anschluss mehr, was nun? Da bleibt nur USB.
Aber die USB Display sind mir zu teuer.
Nach ein wenig Google, konnten diese Probleme auch gelöst werden.
Als Hardware-Basis, dient mir nun folgendes:
1. LCD2USB Platine von Till Harbaum http://www.harbaum.org/till/lcd2usb/index.shtml English vorrausgesetzt!!!
2. Pollin LCD Display 4x27 http://www.pollin.de/shop/detail.php?pg=NQ==&a=NzY3OTc4OTk=
Was kann das Projekt:
Die Platine von Till wandelt die USB Signale so um, dass das Dispaly diese wieder versteht. Diese ersetzt dann auch den Früheren USB Anschluss.
Vorraussetzung zum Nutzen dieser Platine ist, dass das Display HD44780 Controller kompatible ist. Alles andere macht dann die Software und die Platine von Till.
Schon am Projekt ist auch, dass die gesamte Stromversorgung des LCDs über den USB Port realisiert wird. Also kein Zusätzliches Kabel.
Dazu kann man auch per Config File die Helligkeit und den Kontrast des LCD einstellen.
Benutzung eines LCDs mit Hintergrundbeleuchtung ist auch möglich. Hierzu sind extra Pins auf der Platine vorgesehen.
Mit anderen wie dem von mir verwendetem LCD, ist es möglich per Pfosten Stecker die LCD2USB Platine direkt am LCD zu befestigen.
Es gibt dazu zwei verschiedene Pfostenstecker. Bei einem der Beiden, kann dann auch per Lötbruck noch die Polarität der Stromanschluss, je nach verwendetem LCD eingestellt werde.
Kosten:
1. LCD2USB Leer Platine ca. 10€
2. Benötigte Bauteil für Platinenbestückung ca. 6€
3. Pollin LCD Display ca. 5€
Die Platine kann bei Till bezogen werden. Wer es kann, kann Sie auch selber ätzen oder mit Kupferlackdraht aufbauen.
Benötigt Vorkenntnis:
1. Grundlegende Lötkenntnisse
2. uController grundlegende Programmierkenntnisse
3. Konsolen umgang
Umsetztung:
1. Platine Bestücken und Löten
Bestückt wird das ganze nach dem Bestückungsplan auf Tills Seite.
2. Programmieren des Controllers
Der Controller kann ISP programmiert werde ( In Circuit).
Man braucht also nicht den uController, wie Früher üblich, auf eine andere Platine stecken um Ihn zu flashen.
Problem ist allerdings, man brauch ein Adapter der dass ganze IN Circuit programmieren kann.
Das geht per USB und per Parallel Port.
Auf Tills Homepage ist auch ein kleiner Bauplan, wie man sich so ein Programmierer selber bauen kann, allerdings für den Parallel Port.
Aber Achtung bei dem Programmierer auf Tills Homepage,
fehlt der Plus und Minus Anschluss vergessen. Ohne gehts net.
Also ein Typisches Henne Ei Problem.
Zum Glück hatte ich noch ein altes Mainboard.
Das habe ich mit einer Ubuntu Live CD gebootet.
Und damit den Controller geflash.
Bei Ubuntu muss dann noch das Paket avrdude nachinstalliert werden.
Sollte aber auch mit anderen Distri gehen.
Programmiert wird mit dem Befehl wie auf Tills Homepage.
Wer Problem mit dem Flashen hat, kann sich gerne an mich wenden.
Wer sich das Programmieren garnicht zutraut, kann sich auch gerne an mich wenden.
Oder gleich mit der Platine den Programmierten uController bei Till mit bestellen.
3.Schritt die Software
Software:
Als Software habe ich lcd4linux eingesetzt. http://ssl.bulix.org/projects/lcd4linux/
Es gibt aber auch Support durch LCDProc und LCDSmartie.
Die Installation geht noch ganz einfach apt-get install lcd4linux.
Das Gute ist, dass die Ansteuerung schon direkt in die ganzen Programm integriert wurde. Für Windows braucht man lediglich eine DLL die bekommt man aber auch auf Tills Homepage
Aber Vorsicht, wer sich wundert, warum das LCD nicht gleich nach der Installation funktioniert, muss wissen, es wird in /etc kein Config file erstellt.
Das wird ganz dem Benutzer überlassen.
Bei LCD4Linux hatte ich am Anfang Problem mit der Config.
Nach dem ich aber einfach das Config Files, welche alle Beispiel Configs beinhaltet war angepasst habe, läuft es aber ohne Probleme.
Im Config File ist auch noch ne Haufen Zeug drin, was man nicht brauch.
Ich hab es aber einfach mit drin gelassen.
Bei Size im oberen Teil der Config, muss man eintragen wie viel Zeilen und Buchstaben, dass jeweilige LCD braucht.
Zum Testen des LCDs empfiehlt es sich, dass Layout Test1 und Test2 zu benutzen.
Hier werden einfach alle Zeilen mit Buchstaben und Ziffern gefüllt.
Config File für LCD4Linux:
| Code: |
Variables {
tick 500
tack 100
minute 60000
}
Display LCD2USB {
Driver 'LCD2USB'
Size '27x4'
Backlight 1
Icons 1
}
#Plugin KVV {
# StationID '12_701'
# Refresh 30
# Proxy 'igate'
# Port 8080;
#}
Plugin Seti {
Directory '/root/setiathome-3.08.i686-pc-linux-gnu'
}
Plugin MySQL {
server 'gsmlandia.com' # if none, localhost assumed
port 3306 # if none, MySQL default assumed
user 'lcd4linux' # if none, lcd4linux unix owner assumed
password 'lcd4linux' # if none, empty password assumed
database 'lcd4linux' # MUST be specified
}
Plugin Pop3 {
server1 'localhost'
port1 110
user1 'michael'
password1 'secret'
}
Widget OS {
class 'Text'
expression '*** '.uname('sysname').' '.uname('release').' ***'
width 27
align 'M'
style 'bold'
speed 50
update tick
}
Widget CPU {
class 'Text'
expression uname('machine')
prefix 'CPU '
width 9
align 'L'
style test::onoff(7)>0?'bold':'norm'
update tick
}
Widget CPUinfo {
class 'Text'
expression cpuinfo('model name')
prefix ''
width 27
align 'M'
speed 100
update tick
}
Widget RAM {
class 'Text'
expression meminfo('MemTotal')/1024
postfix ' MB RAM'
width 11
precision 0
align 'R'
update tick
}
Widget Busy {
class 'Text'
expression proc_stat::cpu('busy', 500)
prefix 'Busy'
postfix '%'
width 9
precision 1
align 'R'
update tick
}
Widget BusyBar {
class 'Bar'
expression proc_stat::cpu('busy', 500)
expression2 proc_stat::cpu('system', 500)
length 10
direction 'E'
update tack
}
Widget Load {
class 'Text'
expression loadavg(1)
prefix 'Load'
postfix loadavg(1)>1.0?'!':' '
width 10
precision 1
align 'R'
update tick
}
Widget LoadBar {
class 'Bar'
expression loadavg(1)
max 2.0
length 10
direction 'E'
update tack
}
Widget Disk {
class 'Text'
# disk.[rw]blk return blocks, we assume a blocksize of 512
# to get the number in kB/s we would do blk*512/1024, which is blk/2
# expression (proc_stat::disk('.*', 'rblk', 500)+proc_stat::disk('.*', 'wblk', 500))/2
# with kernel 2.6, disk_io disappeared from /proc/stat but moved to /proc/diskstat
# therefore you have to use another function called 'diskstats':
expression diskstats('hd.', 'read_sectors', 500) + diskstats('hd.', 'write_sectors', 500)
prefix 'disk'
postfix ' '
width 10
precision 0
align 'R'
update tick
}
Widget DiskBar {
class 'Bar'
#expression proc_stat::disk('.*', 'rblk', 500)
#expression2 proc_stat::disk('.*', 'wblk', 500)
# for kernel 2.6:
expression diskstats('hd.', 'read_sectors', 500)
expression2 diskstats('hd.', 'write_sectors', 500)
length 14
direction 'E'
update tack
}
Widget Eth0 {
class 'Text'
expression (netdev('eth0', 'Rx_bytes', 500)+netdev('eth0', 'Tx_bytes', 500))/1024
prefix 'eth0'
postfix ' '
width 10
precision 0
align 'R'
update tick
}
Widget Eth0Bar {
class 'Bar'
expression netdev('eth0', 'Rx_bytes', 500)
expression2 netdev('eth0', 'Tx_bytes', 500)
length 14
direction 'E'
update tack
}
Widget PPP {
class 'Text'
expression (ppp('Rx:0', 500)+ppp('Tx:0', 500))
prefix 'PPP'
width 9
precision 0
align 'R'
update tick
}
Widget Temp {
class 'Text'
expression i2c_sensors('temp_input3')*1.0324-67
prefix 'Temp'
width 9
precision 1
align 'R'
update tick
}
Widget TempBar {
class 'Bar'
expression i2c_sensors('temp_input3')*1.0324-67
min 40
max 80
length 10
direction 'E'
update tack
}
Widget MySQLtest1 {
class 'Text'
expression MySQL::query('SELECT id FROM table1')
width 20
align 'R'
prefix 'MySQL test:'
update minute
}
Widget MySQLtest2 {
class 'Text'
expression MySQL::status()
width 20
align 'M'
prefix 'Status: '
update minute
}
Widget Uptime {
class 'Text'
expression uptime('%d days %H:%M:%S')
width 20
align 'R'
prefix 'Up '
update 1000
}
# debugging widgets
Widget BarTest {
class 'Bar'
# test::bar(barno,maxval,startval,delta) - move a test value between 0 and max.
# delta= step to change value by each time it's read.
# barno - ten different test bar values can be set up, with barno=0..9
# if delta=0, just returns the value of bar n instead of changing it.
expression test::bar(0,30,25,1)
expression2 test::bar(1,30,0,1)
length 8
# max 50
direction 'E'
update 10
}
Widget BarTestVal {
class 'Text'
expression test::bar(0,100,50,0)
prefix 'Test '
width 9
update 200
}
Widget LightningTest {
class 'icon'
speed 500
visible test::onoff(0)
bitmap {
row1 '...***'
row2 '..***.'
row3 '.***..'
row4 '.****.'
row5 '..**..'
row6 '.**...'
row7 '**....'
row8 '*.....'
}
}
# Icons
Widget Heartbeat {
class 'Icon'
speed 800
Bitmap {
Row1 '.....|.....'
Row2 '.*.*.|.*.*.'
Row3 '*****|*.*.*'
Row4 '*****|*...*'
Row5 '.***.|.*.*.'
Row6 '.***.|.*.*.'
Row7 '..*..|..*..'
Row8 '.....|.....'
}
}
Widget EKG {
class 'Icon'
speed 50
Bitmap {
Row1 '.....|.....|.....|.....|.....|.....|.....|.....'
Row2 '.....|....*|...*.|..*..|.*...|*....|.....|.....'
Row3 '.....|....*|...*.|..*..|.*...|*....|.....|.....'
Row4 '.....|....*|...**|..**.|.**..|**...|*....|.....'
Row5 '.....|....*|...**|..**.|.**..|**...|*....|.....'
Row6 '.....|....*|...*.|..*.*|.*.*.|*.*..|.*...|*....'
Row7 '*****|*****|****.|***..|**..*|*..**|..***|.****'
Row8 '.....|.....|.....|.....|.....|.....|.....|.....'
}
}
Widget Karo {
class 'Icon'
speed 200
Bitmap {
Row1 '.....|.....|.....|.....|..*..|.....|.....|.....'
Row2 '.....|.....|.....|..*..|.*.*.|..*..|.....|.....'
Row3 '.....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....'
Row4 '.....|..*..|.*.*.|*...*|.....|*...*|.*.*.|..*..'
Row5 '.....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....'
Row6 '.....|.....|.....|..*..|.*.*.|..*..|.....|.....'
Row7 '.....|.....|.....|.....|..*..|.....|.....|.....'
Row8 '.....|.....|.....|.....|.....|.....|.....|.....'
}
}
Widget Heart {
class 'Icon'
speed 250
Bitmap {
Row1 '.....|.....|.....|.....|.....|.....'
Row2 '.*.*.|.....|.*.*.|.....|.....|.....'
Row3 '*****|.*.*.|*****|.*.*.|.*.*.|.*.*.'
Row4 '*****|.***.|*****|.***.|.***.|.***.'
Row5 '.***.|.***.|.***.|.***.|.***.|.***.'
Row6 '.***.|..*..|.***.|..*..|..*..|..*..'
Row7 '..*..|.....|..*..|.....|.....|.....'
Row8 '.....|.....|.....|.....|.....|.....'
}
}
Widget Blob {
class 'Icon'
speed 250
Bitmap {
Row1 '.....|.....|.....'
Row2 '.....|.....|.***.'
Row3 '.....|.***.|*...*'
Row4 '..*..|.*.*.|*...*'
Row5 '.....|.***.|*...*'
Row6 '.....|.....|.***.'
Row7 '.....|.....|.....'
Row8 '.....|.....|.....'
}
}
Widget Wave {
class 'Icon'
speed 100
Bitmap {
Row1 '..**.|.**..|**...|*....|.....|.....|.....|.....|....*|...**'
Row2 '.*..*|*..*.|..*..|.*...|*....|.....|.....|....*|...*.|..*..'
Row3 '*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...'
Row4 '*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...'
Row5 '*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...'
Row6 '.....|.....|....*|...*.|..*..|.*..*|*..*.|..*..|.*...|*....'
Row7 '.....|.....|.....|....*|...**|..**.|.**..|**...|*....|.....'
Row8 '.....|.....|.....|.....|.....|.....|.....|.....|.....|.....'
}
}
Widget Squirrel {
class 'Icon'
speed 100
Bitmap {
Row1 '.....|.....|.....|.....|.....|.....'
Row2 '.....|.....|.....|.....|.....|.....'
Row3 '.....|.....|.....|.....|.....|.....'
Row4 '**...|.**..|..**.|...**|....*|.....'
Row5 '*****|*****|*****|*****|*****|*****'
Row6 '...**|..**.|.**..|**...|*....|.....'
Row7 '.....|.....|.....|.....|.....|.....'
Row8 '.....|.....|.....|.....|.....|.....'
}
}
Widget Lightning {
class 'icon'
speed 100
visible cpu('busy', 500)-50
bitmap {
row1 '...***'
row2 '..***.'
row3 '.***..'
row4 '.****.'
row5 '..**..'
row6 '.**...'
row7 '**....'
row8 '*.....'
}
}
Widget Rain {
class 'icon'
speed 200
bitmap {
row1 '...*.|.....|.....|.*...|....*|..*..|.....|*....'
row2 '*....|...*.|.....|.....|.*...|....*|..*..|.....'
row3 '.....|*....|...*.|.....|.....|.*...|....*|..*..'
row4 '..*..|.....|*....|...*.|.....|.....|.*...|....*'
row5 '....*|..*..|.....|*....|...*.|.....|.....|.*...'
row6 '.*...|....*|..*..|.....|*....|...*.|.....|.....'
row7 '.....|.*...|....*|..*..|.....|*....|...*.|.....'
row8 '.....|.....|.*...|....*|..*..|.....|*....|...*.'
}
}
Widget Test {
class 'Text'
expression '1234567890123456789012345678901234567890'
width 40
foreground 'ff0000ff'
}
Widget Test1 {
class 'Text'
expression 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
width 40
align 'M'
speed 100
}
Widget Test2 {
class 'Text'
expression '1234567890abcdefghijklmnopqrstuvwxyz'
width 40
align 'M'
speed 150
}
Widget GPO_Val1 {
class 'Text'
expression LCD::GPO(1)
prefix 'GPO#1'
width 10
precision 0
align 'R'
update tick
}
Widget GPI_Val1 {
class 'Text'
expression LCD::GPI(1)
prefix 'GPI#1'
width 10
precision 0
align 'R'
update tick
}
Widget GPO_Val4 {
class 'Text'
expression LCD::GPO(4)
prefix 'GPO#4'
width 10
precision 0
align 'R'
update tick
}
Widget GPO_Test1 {
class 'GPO'
expression 255*test::onoff(1)
update 300
}
Widget GPO_Test255 {
class 'GPO'
expression test::bar(0,255, 0, 1)
update 100
}
Widget ImageTest {
class 'Image'
file 'tux.png'
update 1000
visible 1
inverted 0
}
Widget KVV {
class 'Text'
expression kvv::line(0).' '.kvv::station(0)
width 11
align 'L'
update tick
Foreground 'ffff00'
style 'bold'
}
Widget KVV_TIME {
class 'Text'
expression kvv::time_str(0)
width 2
align 'R'
update tick
foreground kvv::time(0) < 2 ? 'FF0000' : ( kvv::time(0) < 5 ? 'FFFF00' : '00FF00' )
style 'bold'
}
Layout Default {
Row1 {
Col1 'OS'
}
Row2 {
Col1 'CPU'
Col10 'RAM'
}
Row3 {
Col1 'Busy'
Col10 'Rain'
Col11 'BusyBar'
}
Row4 {
Col1 'Load'
Col11 'LoadBar'
}
Row5 {
Col1 'Disk'
Col11 'DiskBar'
}
Row6 {
Col1 'Eth0'
Col11 'Eth0Bar'
}
}
Layout TestLayer {
Row1 {
Col1 'OS'
}
Row2 {
Col1 'CPU'
Col10 'RAM'
}
Row3 {
Col1 'Busy'
Col10 'Rain'
Col11 'BusyBar'
}
Row4 {
Col1 'Load'
Col11 'LoadBar'
}
Row5 {
Col1 'Disk'
Col11 'DiskBar'
}
Row6 {
Col1 'Eth0'
Col11 'Eth0Bar'
}
Layer 2 {
X1.Y1 'ImageTest'
}
}
Layout TestImage {
Layer 2 {
X1.Y1 'ImageTest'
}
}
Layout L40x2 {
Row1 {
Col1 'OS'
Col21 'Busy'
Col31 'BusyBar'
}
Row2 {
Col1 'CPU'
Col10 'RAM'
Col21 'Load'
Col31 'LoadBar'
}
}
Layout Test {
Row01.Col1 'Test'
Row02.Col1 'Test'
Row03.Col1 'Test'
Row04.Col1 'Test'
Row05.Col1 'Test1'
Row06.Col1 'Test1'
Row07.Col1 'Test1'
Row08.Col1 'Test1'
Row09.Col1 'Test1'
Row10.Col1 'Test1'
Row11.Col1 'Test1'
Row12.Col1 'Test1'
Row13.Col1 'Test1'
Row14.Col1 'Test1'
Row15.Col1 'Test1'
Row16.Col1 'Test1'
Row17.Col1 'Test1'
Row18.Col1 'Test1'
Row19.Col1 'Test1'
Row20.Col1 'Test1'
Row21.Col1 'Test1'
Row22.Col1 'Test1'
Row23.Col1 'Test1'
Row24.Col1 'Test1'
}
Layout Test2 {
Row01.Col1 'Test1'
#Row02.Col1 'Rain'
Row02.Col1 'Test2'
Row03.Col1 'Test1'
Row04.Col1 'Test2'
Row05.Col1 'Test1'
Row06.Col1 'Test2'
Row07.Col1 'Test1'
Row08.Col1 'Test2'
}
Layout TestGPO {
Row1.Col1 'GPO_Val1'
Row1.Col10 'GPI_Val1'
Row2.Col1 'GPO_Val4'
GPO1 'GPO_Test255'
GPO4 'GPO_Test1'
}
Layout testMySQL {
Row1 {
Col1 'MySQLtest1'
}
Row2 {
Col1 'MySQLtest2'
}
}
Layout Debug {
#Row09.Col1 'Test'
Row09.Col1 'Heartbeat'
}
Display 'LCD2USB'
Layout 'Default'
|
Bilder
1.Das Gehirn
2. Gerhin und Anzeige
3. Anzeige im Betrieb
So dass ist erst mal genug für heute.
Das Config File vom LCD4LINUX stell ich die Tage online.
Bilder des Funktionierenden Display bleibe ich noch schuldig.
Wer sonst noch Fragen hat, schreibt einfach ne PM.
Also schon mal viel Spaß beim nachbauen.
Edit 26.6.09 Config File und Bilder sind nun Online _________________
Hardware: ASUS M4A78Pro, AMD Athlon X2 2,5 GHz (ondemand govenor), 4GB
Systemplatte: WD3200BEKT
Datenplatten: 4 x WD10EADS im mdadm RAID5, 1 Platte als spare, 1 x DVD-ROM
NICs: EXTERN = 2 x DLINK DGE-530T
INTERN = 1 x Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)
Gehäuse: Codegen 4U-600 19" Zoll im 26HE Rack
Software: ctsrv-4.1, Xen 3.4.1
(Dom0 & DomUs): Endian 2.3 geerntet nach http://www.ctserver.org/ftopic2825.html , Fileserver (Samba, PS3MediaServer)
|
|