Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 January 16, 2023 01:23AM |
Registered: 7 years ago Posts: 181 |
auxdisplay { compatible = "hit,hd44780"; data-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>, <&gpio1 26 GPIO_ACTIVE_HIGH>, <&gpio1 27 GPIO_ACTIVE_HIGH>, <&gpio1 29 GPIO_ACTIVE_HIGH>; enable-gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; rs-gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; rw-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; backlight-gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; display-height-chars = <2>; display-width-chars = <16>; };
root@rn104:~# ls -alF /dev/char/2:16 lrwxrwxrwx 1 root root 8 Jan 14 19:04 /dev/char/2:16 -> ../ptyq0 root@rn104:~# ls -alF /dev/ptyq0 crw------- 1 root root 2, 16 Jan 14 21:00 /dev/ptyq0 root@drodle:~#
root@rn104:~# echo Hello world > /dev/char/2:16but it does nothing:
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 January 16, 2023 09:47PM |
Registered: 9 years ago Posts: 454 |
charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*Linux-" UTS_RELEASE "\n");This should print the linux version on the display if the module loaded correctly.
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 January 17, 2023 02:44AM |
Registered: 7 years ago Posts: 181 |
tme@rn102:~$ sudo apt install -y lcd4linux tme@rn102:~$ sudo lcd4linux -l | egrep -i 'Winstar|WH1602G|hd44780|hit' BWCT : BWCT USB to HD44780 interface HD44780 : generic Noritake Soekris HD66712 LCM-162 LCD2USB : LCD2USB homebrew USB interface for HD44780 text displays LCDTerm : LCDTerm serial-to-HD44780 adapter board PHAnderson : PHAnderson serial-to-HD44780 adapter RouterBoard : HD44780 HD66712
tme@rn102:~$ sudo dmesg | grep -i lcd tme@rn102:~$
tme@rn102:~$ egrep -i 'lcd|backlight' /boot/config-5.19.2-mvebu-370xp-tld-1 # CONFIG_MFD_ATMEL_HLCDC is not set # CONFIG_DRM_HDLCD is not set # CONFIG_DRM_TILCDC is not set # CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set CONFIG_FB_BACKLIGHT=m # Backlight & LCD device support # CONFIG_LCD_CLASS_DEVICE is not set CONFIG_BACKLIGHT_CLASS_DEVICE=y # CONFIG_BACKLIGHT_KTD253 is not set # CONFIG_BACKLIGHT_PWM is not set # CONFIG_BACKLIGHT_QCOM_WLED is not set # CONFIG_BACKLIGHT_ADP8860 is not set # CONFIG_BACKLIGHT_ADP8870 is not set # CONFIG_BACKLIGHT_PCF50633 is not set # CONFIG_BACKLIGHT_LM3630A is not set # CONFIG_BACKLIGHT_LM3639 is not set # CONFIG_BACKLIGHT_LP855X is not set # CONFIG_BACKLIGHT_GPIO is not set # CONFIG_BACKLIGHT_LV5207LP is not set # CONFIG_BACKLIGHT_BD6107 is not set # CONFIG_BACKLIGHT_ARCXCNN is not set # CONFIG_BACKLIGHT_LED is not set # end of Backlight & LCD device support CONFIG_HID_PICOLCD=m CONFIG_HID_PICOLCD_FB=y CONFIG_HID_PICOLCD_BACKLIGHT=y CONFIG_HID_PICOLCD_LEDS=y # CONFIG_HID_PICOLCD_CIR is not set CONFIG_USB_LCD=m CONFIG_LEDS_TRIGGER_BACKLIGHT=m CONFIG_FB_TFT_TINYLCD=m
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 January 17, 2023 09:08PM |
Registered: 9 years ago Posts: 454 |
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 08:32AM |
Registered: 7 years ago Posts: 181 |
root@rn104:~# egrep 'AUXDISPLAY|44780' /boot/config-6.1.8-mvebu-370xp-tld-1 CONFIG_AUXDISPLAY=y CONFIG_HD44780_COMMON=y CONFIG_HD44780=y
root@rn104:~# for i in /proc/device-tree/auxdisplay/*; do echo $i; hexdump -C $i; done /proc/device-tree/auxdisplay/backlight-gpios 00000000 00 00 00 17 00 00 00 15 00 00 00 01 |............| 0000000c /proc/device-tree/auxdisplay/compatible 00000000 68 69 74 2c 68 64 34 34 37 38 30 00 |hit,hd44780.| 0000000c /proc/device-tree/auxdisplay/data-gpios 00000000 00 00 00 17 00 00 00 19 00 00 00 00 00 00 00 17 |................| 00000010 00 00 00 1a 00 00 00 00 00 00 00 17 00 00 00 1b |................| 00000020 00 00 00 00 00 00 00 17 00 00 00 1d 00 00 00 00 |................| 00000030 /proc/device-tree/auxdisplay/display-height-chars 00000000 00 00 00 02 |....| 00000004 /proc/device-tree/auxdisplay/display-width-chars 00000000 00 00 00 10 |....| 00000004 /proc/device-tree/auxdisplay/enable-gpios 00000000 00 00 00 17 00 00 00 18 00 00 00 00 |............| 0000000c /proc/device-tree/auxdisplay/name 00000000 61 75 78 64 69 73 70 6c 61 79 00 |auxdisplay.| 0000000b /proc/device-tree/auxdisplay/rs-gpios 00000000 00 00 00 17 00 00 00 16 00 00 00 00 |............| 0000000c /proc/device-tree/auxdisplay/rw-gpios 00000000 00 00 00 17 00 00 00 17 00 00 00 00 |............| 0000000c
root@rn104:~# cat /etc/lcd4linux.conf Display HD44780-16x2 { Driver 'HD44780' Model 'generic' UseBusy 1 Port '/dev/parport0' Size '16x2' Wire { RW 'AUTOFD' RS 'INIT' ENABLE 'STROBE' ENABLE2 'GND' GPO 'GND' } } # generic HD44780 display (WinAmp wiring) Display HD44780-winamp-16x2 { Driver 'HD44780' Model 'generic' UseBusy 1 Port '/dev/parports/0' Size '16x2' asc255bug 1 Wire { RW 'AUTOFD' RS 'INIT' ENABLE 'STROBE' ENABLE2 'GND' GPO 'GND' POWER 'GND' } Timing { # fuzz timings by value (100 = no change) fuzz 100 # low-level communication [ns] CY 1000 # Enable cycle time PW 450 # Enable pulse width AS 140 # Address setup time AH 20 # Address hold time # HD44780 execution timings [us] INIT1 4100 # first init sequence: 4.1 msec INIT2 100 # second init sequence: 100 usec EXEC 80 # normal execution time WRCG 120 # CG RAM Write CLEAR 2250 # Clear Display HOME 2250 # Return Cursor Home ONOFF 2250 # Display On/Off Control # GPO timing [ns] GPO_ST 20 # 74HCT573 set-up time GPO_PW 230 # 74HCT573 enable pulse width # Power supply timing [ms] POWER 500 # power-on delay } } Display SC1602D { Driver 'HD44780' Port '/dev/parports/0' Bits '8' Size '16x2' asc255bug 0 Icons 1 Wire { RW 'GND' RS 'AUTOFD' ENABLE 'STROBE' GPO 'INIT' POWER 'GND' } } Widget CPU { class 'Text' expression uname('machine') prefix 'CPU ' width 9 align 'L' update tick } Layout Default { Row1 { Col1 'CPU' } } Variables { tick 500 } Display 'HD44780-16x2' #Display 'HD44780-winamp-16x2' #Display 'SC1602D' Layout 'Default'
root@rn104:~# mknod /dev/parport0 c 99 0 root@rn104:~# mkdir /dev/parports root@rn104:~# mknod /dev/parports/0 c 99 0 root@rn104:~# chgrp lp /dev/parport0 /dev/parports/0 root@rn104:~# chmod g+rw /dev/parport0 /dev/parports/0 root@rn104:~# ls -AlF /dev/parp* crw-rw-r-- 1 root lp 99, 0 Feb 11 12:07 /dev/parport0 /dev/parports: total 0 crw-rw-r-- 1 root lp 99, 0 Feb 11 13:13 0
root@rn104:~# grep '^Display' /etc/lcd4linux.conf | grep -v '{' Display 'HD44780-16x2' root@rn104:~# lcd4linux -Fv LCD4Linux 0.11.0-SVN-1193 starting [DBus] Error connecting to the dbus session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 [MPD] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin) [raspi] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin) HD44780: $Rev: 1202 $ HD44780: using model 'generic' HD44780: using parallel port HD44780: using 1 Controller(s) HD44780: using 8 bit mode udelay: using gettimeofday() delay loop HD44780: using ppdev /dev/parport0 HD44780: open(/dev/parport0) failed: No such device or address HD44780: could not initialize parallel port! HD44780: start display failed! Error initializing driver HD44780: Exit! root@rn104:~# nano /etc/lcd4linux.conf root@rn104:~# grep '^Display' /etc/lcd4linux.conf | grep -v '{' Display 'HD44780-winamp-16x2' root@rn104:~# lcd4linux -Fv LCD4Linux 0.11.0-SVN-1193 starting [DBus] Error connecting to the dbus session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 [MPD] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin) [raspi] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin) HD44780: $Rev: 1202 $ HD44780: using model 'generic' HD44780: using parallel port HD44780: using 1 Controller(s) HD44780: using 8 bit mode udelay: using gettimeofday() delay loop HD44780: using ppdev /dev/parports/0 HD44780: open(/dev/parports/0) failed: No such device or address HD44780: could not initialize parallel port! HD44780: start display failed! Error initializing driver HD44780: Exit! root@rn104:~# nano /etc/lcd4linux.conf root@rn104:~# grep '^Display' /etc/lcd4linux.conf | grep -v '{' Display 'SC1602D' root@rn104:~# lcd4linux -Fv LCD4Linux 0.11.0-SVN-1193 starting [DBus] Error connecting to the dbus session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 [MPD] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin) [raspi] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin) HD44780: $Rev: 1202 $ HD44780: using model 'generic' HD44780: using parallel port HD44780: using 1 Controller(s) HD44780: using 8 bit mode udelay: using gettimeofday() delay loop HD44780: using ppdev /dev/parports/0 HD44780: open(/dev/parports/0) failed: No such device or address HD44780: could not initialize parallel port! HD44780: start display failed! Error initializing driver HD44780: Exit!
root@rn104:~# grep -ie 'parport*=m' /boot/config-6.1.8-mvebu-370xp-tld-1
CONFIG_PARPORT=m
CONFIG_PPS_CLIENT_PARPORT=m
root@rn104:~# insmod /lib/modules/5.19.2-mvebu-370xp-tld-1/kernel/drivers/parport/parport.ko
insmod: ERROR: could not insert module /lib/modules/5.19.2-mvebu-370xp-tld-1/kernel/drivers/parport/parport.ko: Invalid module format
root@rn104:~# dmesg | tail -1
[10666.430896] parport: disagrees about version of symbol module_layout
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 09:47AM |
Registered: 2 years ago Posts: 82 |
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 10:06AM |
Registered: 7 years ago Posts: 181 |
root@drodle:~# lcd4linux -Fv
LCD4Linux 0.11.0-SVN-1193 starting
[DBus] Error connecting to the dbus session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[MPD] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin)
[raspi] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin)
HD44780: $Rev: 1202 $
HD44780: using model 'generic'
HD44780: using parallel port
HD44780: using 1 Controller(s)
HD44780: using 8 bit mode
udelay: using gettimeofday() delay loop
HD44780: using ppdev /dev/lcd
HD44780: open(/dev/lcd) failed: Operation not permitted
HD44780: could not initialize parallel port!
HD44780: start display failed!
Error initializing driver HD44780: Exit!
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 10:31AM |
Registered: 7 years ago Posts: 181 |
root@rn104:~# ls -AlF /dev/lcd*
crw-rw---- 1 root lp 10, 156 Feb 11 12:04 /dev/lcd
root@rn104:~# head -8 /etc/lcd4linux.conf
Display BWCT-16x2 {
Driver 'BWCT'
Size '16x2'
Contrast 220
asc255bug 1
Icons 1
# Port 'libusb'
}
root@rn104:~# lcd4linux -Fv
LCD4Linux 0.11.0-SVN-1193 starting
[DBus] Error connecting to the dbus session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[MPD] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin)
[raspi] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin)
BWCT: $Rev: 975 $
BWCT: scanning USB for BWCT LCD...
BWCT: could not find a BWCT USB LCD
Error initializing driver BWCT: Exit!
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 10:39AM |
Registered: 2 years ago Posts: 82 |
What does 'ls -l /dev/lcd*' say?Quote
HD44780: open(/dev/lcd) failed: Operation not permitted
It's not a patallel port device. What was the last time you saw a parallel port? It could be usb, or i2c, or gpio connected, or... . The driver should take care for that.Quote
What indicates that the LCD display on the RN104 is a USB device and not a parallel port device?
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 10:58AM |
Registered: 7 years ago Posts: 181 |
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 01:35PM |
Registered: 9 years ago Posts: 454 |
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 03:05PM |
Admin Registered: 13 years ago Posts: 18,898 |
Quote
config HD44780
tristate "HD44780 Character LCD support"
depends on GPIOLIB
Quote
The Netgear ReadyNAS RN104 has a 2 by 16 character display. It's a Winstar WH1602G LCD. Pictures here. U-boot (v2011.12) writes "NETGEAR Storage Welcome" on the display when it starts, and "Booting.." before booting Linux. This latter text sticks since Linux makes no effort to change it.
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 04:36PM |
Registered: 9 years ago Posts: 454 |
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 04:45PM |
Admin Registered: 13 years ago Posts: 18,898 |
auxdisplay { compatible = "hit,hd44780"; data-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>, <&gpio1 26 GPIO_ACTIVE_HIGH>, <&gpio1 27 GPIO_ACTIVE_HIGH>, <&gpio1 29 GPIO_ACTIVE_HIGH>; enable-gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; rs-gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; rw-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; backlight-gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; display-height-chars = <2>; display-width-chars = <16>; };
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 11, 2023 05:05PM |
Admin Registered: 13 years ago Posts: 18,898 |
>Quote
Now that the
> hard part — configuring the kernel and the
> device tree — is done, we can very easily print
> stuff on the screen by just writing to the
> /dev/lcd file.
>
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 12, 2023 06:16AM |
Registered: 7 years ago Posts: 181 |
Quote
Arnaud Ebalard
The LCD module consumes 8 GPIO of the SoC. In order to get additional GPIOs to connect to front buttons and LEDs, NETGEAR has added on the main board an iomuxer connected to the I2C bus, namely a NXP PCA9554. It provides eight additional GPIOs.
tme@rn104:~$ tail /etc/rc.local # Running on a box with an LCD display? if [ -w /dev/lcd ]; then # Say something optimistic and switch on the backlight /usr/bin/printf '-New boot, new\npossibilities!\n' > /dev/lcd /usr/bin/printf '\x1b[L+' > /dev/lcd fi exit 0
tme@rn104:~$ sudo crontab -l | tail -1 * * * * * /root/lcd-uptime.sh tme@rn104:~$ sudo cat /root/lcd-uptime.sh #!/bin/bash # # Script updating the LCD # To be run by crontab every minute # Size of display ncols=16 nrows=2 # Up time exceeds 10 minutes? up=$( /usr/bin/cut -d. -f1 /proc/uptime ) if (( $up > 600 )); then # Info to be displayed boot=$( /usr/bin/uptime -s | /usr/bin/cut -c -$ncols ) curr=$( /bin/date -Im | /usr/bin/tr 'T' ' ' | /usr/bin/cut -c -$ncols ) # Print info on the display if (( $nrows > 1 )); then printf "$boot\n" > /dev/lcd fi printf "$curr\n" > /dev/lcd fi exit 0
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 12, 2023 07:36AM |
Registered: 7 years ago Posts: 181 |
tme@rn104:/tmp$ wget https://github.com/torvalds/linux/raw/master/drivers/auxdisplay/charlcd.c tme@rn104:/tmp$ grep "case.**/" charlcd.c case 'D': /* Display ON */ case 'd': /* Display OFF */ case 'C': /* Cursor ON */ case 'c': /* Cursor OFF */ case 'B': /* Blink ON */ case 'b': /* Blink OFF */ case '+': /* Back light ON */ case '-': /* Back light OFF */ case '*': /* Flash back light */ case 'f': /* Small Font */ case 'F': /* Large Font */ case 'n': /* One Line */ case 'N': /* Two Lines */ case 'l': /* Shift Cursor Left */ case 'r': /* shift cursor right */ case 'L': /* shift display left */ case 'R': /* shift display right */ case 'k': { /* kill end of line */ case 'I': /* reinitialize display */ case 'x': /* gotoxy : LxXXX[yYYY]; */ case 'y': /* gotoxy : LyYYY[xXXX]; */
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 12, 2023 02:32PM |
Admin Registered: 13 years ago Posts: 18,898 |
Re: Build-in 2 by 16 character front display on Netgear ReadyNAS RN104 February 13, 2023 09:38PM |
Admin Registered: 13 years ago Posts: 18,898 |
Quote
Display
dpf-ax
Tritton USB2VGA
HP T5325 X11 GUI (LXDE)
LED daemon for Pogoplug Debian
Netgear ReadyNAS RN104 Front LCD Display