terminal+touch input without X
-
- Posts: 205
- Joined: Sun Jun 05, 2016 11:04 pm
- languages_spoken: english
- ODROIDs: C2, HC1, H2
- Contact:
terminal+touch input without X
The Wiki shows how to redirect a text terminal and how to do X.
I would like to have a simple text terminal (with selectable monospace font) and touch input (reporting of cell touched with stylus).
Is this possible with a minimal server configuration, and without installing all the X packages and dependencies?
It seems according to the Wiki xinput_calibrator is required to enable touch input...
I would like to have a simple text terminal (with selectable monospace font) and touch input (reporting of cell touched with stylus).
Is this possible with a minimal server configuration, and without installing all the X packages and dependencies?
It seems according to the Wiki xinput_calibrator is required to enable touch input...
- mad_ady
- Posts: 5229
- Joined: Wed Jul 15, 2015 5:00 pm
- languages_spoken: english
- ODROIDs: XU4, C1+, C2, N1
- Location: Bucharest, Romania
- Contact:
Re: terminal+touch input without X
The input registers as a /dev/input device and you can find it with evtest:
Back in the day there was a thing called gpm which would provide a console mouse for things like mc: https://wiki.archlinux.org/index.php/co ... se_support
See if it does the job for you.
Code: Select all
sudo evtest
No device specified, trying to scan all of /dev/input/event
Available devices:
/dev/input/event0: C-Media USB Headphone Set
/dev/input/event1: cec_input
/dev/input/event2: vt-input
/dev/input/event3: SX865X Touchscreen
/dev/input/event4: USB 2.0 Camera
/dev/input/event5: meson-ir
See if it does the job for you.
-
- Posts: 205
- Joined: Sun Jun 05, 2016 11:04 pm
- languages_spoken: english
- ODROIDs: C2, HC1, H2
- Contact:
Re: terminal+touch input without X
ok, with 18.04 out, let's try this again.
What I've figured out so far:
1) boot.ini: nographics 1 -> disables X, gives a textconsole
2) load LCD kernel modules
3) switch on LCD
4) chvt 1 -> switch from log to console 1
5) setfont /usr/share/consolefonts/Uni2-Terminus12x6.psf.gz
6) systemctl restart getty@tty1
7) login by USB keyboard
8) start a program manually
What is still missing, I only want a minimal server with a touch/status display for some interaction.
* Does this also work with the minimal image?
* do all the necessary init above on boot automatically
* instead of text console that waits for user login start automatically a program of my choosing on the terminal
* allow my program touch interaction, the 4 buttons are not enough (only use one button for display on/off)
* touches on display border/corners are enough, doesn't have to be cell accurate
* switch USB keyboard to different layout than US (if USB keyboard connected on rare occasions)
...anyone with experiences?
What I've figured out so far:
1) boot.ini: nographics 1 -> disables X, gives a textconsole
2) load LCD kernel modules
3) switch on LCD
4) chvt 1 -> switch from log to console 1
5) setfont /usr/share/consolefonts/Uni2-Terminus12x6.psf.gz
6) systemctl restart getty@tty1
7) login by USB keyboard
8) start a program manually
What is still missing, I only want a minimal server with a touch/status display for some interaction.
* Does this also work with the minimal image?
* do all the necessary init above on boot automatically
* instead of text console that waits for user login start automatically a program of my choosing on the terminal
* allow my program touch interaction, the 4 buttons are not enough (only use one button for display on/off)
* touches on display border/corners are enough, doesn't have to be cell accurate
* switch USB keyboard to different layout than US (if USB keyboard connected on rare occasions)
...anyone with experiences?

- Attachments
-
- lcd_mc.jpg (104.87 KiB) Viewed 606 times
- mad_ady
- Posts: 5229
- Joined: Wed Jul 15, 2015 5:00 pm
- languages_spoken: english
- ODROIDs: XU4, C1+, C2, N1
- Location: Bucharest, Romania
- Contact:
Re: terminal+touch input without X
You can place the modules in /etc/modules-load.d/modules.conffvolk wrote:ok, with 18.04 out, let's try this again.
What I've figured out so far:
1) boot.ini: nographics 1 -> disables X, gives a textconsole
2) load LCD kernel modules
It should work, yes.3) switch on LCD
4) chvt 1 -> switch from log to console 1
5) setfont /usr/share/consolefonts/Uni2-Terminus12x6.psf.gz
6) systemctl restart getty@tty1
7) login by USB keyboard
8) start a program manually
What is still missing, I only want a minimal server with a touch/status display for some interaction.
* Does this also work with the minimal image?
You can create a systemd service that runs the commands for you* do all the necessary init above on boot automatically
You will need to edit the getty service for vty 1 to log you in and run a program. This might help, though it's not for systemd: https://askubuntu.com/questions/175248/ ... -text-mode* instead of text console that waits for user login start automatically a program of my choosing on the terminal
* allow my program touch interaction, the 4 buttons are not enough (only use one button for display on/off)
* touches on display border/corners are enough, doesn't have to be cell accurate
You can extend the functions of the buttons to support double/triple click or key combinations, longpress with this script: https://github.com/mad-ady/multibutton
For touch support, enable gpm: https://wiki.archlinux.org/index.php/Ge ... pose_mouse
Try this: https://askubuntu.com/questions/342066/ ... e-keyboard* switch USB keyboard to different layout than US (if USB keyboard connected on rare occasions)
...anyone with experiences?
-
- Posts: 205
- Joined: Sun Jun 05, 2016 11:04 pm
- languages_spoken: english
- ODROIDs: C2, HC1, H2
- Contact:
Re: terminal+touch input without X
Thank you for your suggestions. Insights so far:
The minimal image works for the LCD fine.
Changing console fonts in '/etc/default/console-setup' and then run 'setupcon' once works.
Changing '/etc/default/keyboard' and then run 'dpkg-reconfigure keyboard-configuration' once works.
Install of gpm -> I do get a mouse-like interaction in 'mc', but it seems to be very coarse and/or not calibrated, so not very reliable - I have to test this some more.
If I login via SSH and load the LCD kernel modules manually and enable them, I get a login screen - see picture.
If I put the modules in /etc/modules-load.d/modules.conf for autoload I get... a shutdown/reboot screen? - see picture.
Attaching keyboard does not seem to do anything, no usable console.
The minimal image works for the LCD fine.
Changing console fonts in '/etc/default/console-setup' and then run 'setupcon' once works.
Changing '/etc/default/keyboard' and then run 'dpkg-reconfigure keyboard-configuration' once works.
Install of gpm -> I do get a mouse-like interaction in 'mc', but it seems to be very coarse and/or not calibrated, so not very reliable - I have to test this some more.
If I login via SSH and load the LCD kernel modules manually and enable them, I get a login screen - see picture.
If I put the modules in /etc/modules-load.d/modules.conf for autoload I get... a shutdown/reboot screen? - see picture.
Attaching keyboard does not seem to do anything, no usable console.
- Attachments
-
- lcd_auto.png (122.61 KiB) Viewed 547 times
-
- lcd_noauto.png (39.93 KiB) Viewed 547 times
- mad_ady
- Posts: 5229
- Joined: Wed Jul 15, 2015 5:00 pm
- languages_spoken: english
- ODROIDs: XU4, C1+, C2, N1
- Location: Bucharest, Romania
- Contact:
Re: terminal+touch input without X
Very strange. Can you try @fourdee's install script for the screen?
-
- Posts: 205
- Joined: Sun Jun 05, 2016 11:04 pm
- languages_spoken: english
- ODROIDs: C2, HC1, H2
- Contact:
Re: terminal+touch input without X
Fourdee's script is outdated as the path for the controls have changed and I have no X.
But looking what's done there:
Only the modules go into /etc/modules:
but the module parameters are in /etc/modprobe.d/odroid-lcd35.conf
The fixed /etc/systemd/system/odroid-lcd35.service is:
Note that I had to comment out some things, otherwise - see screenshot. What does -powersave additionally do, blank 0 seems to be enough to prevent sleep without input? con2fbmap does not seem to be needed because I have no X?
Remaining challenges:
* Sometimes I get additional log output on console (from systemd?)
* Autostart my program instead of login console.
* Some way to calibrate the LCD without X, mouse provided by gpm seems to be several cells off - however for human finger in LCD corner/edge detection it is probably good enough...
FYI, C2 idle with LCD on -> 2.6W, LCD off -> 2.35W
But looking what's done there:
Only the modules go into /etc/modules:
Code: Select all
aml_i2c
pwm-meson
pwm-ctrl
fbtft_device
flexfb
sx865x
Code: Select all
options fbtft_device name=flexpfb rotate=270
options flexfb chip=ili9488
Code: Select all
[Unit]
Description=Odroid LCD 3.5
[Path]
PathExists=/dev/fb2
[Service]
Type=oneshot
RemainAfterExit=yes
StandardOutput=tty
ExecStart=/bin/bash -c 'echo 500000 > /sys/devices/pwm-ctrl/freq0'
ExecStart=/bin/bash -c 'echo 1 > /sys/devices/pwm-ctrl/enable0'
ExecStart=/bin/bash -c 'echo 1023 > /sys/devices/pwm-ctrl/duty0'
ExecStart=/usr/bin/setterm -blank 0
# -powersave off
#ExecStart=/bin/con2fbmap 1 2
ExecStop=/bin/bash -c 'echo 0 > /sys/devices/pwm-ctrl/duty0'
[Install]
WantedBy=multi-user.target
Remaining challenges:
* Sometimes I get additional log output on console (from systemd?)
* Autostart my program instead of login console.
* Some way to calibrate the LCD without X, mouse provided by gpm seems to be several cells off - however for human finger in LCD corner/edge detection it is probably good enough...
FYI, C2 idle with LCD on -> 2.6W, LCD off -> 2.35W
- Attachments
-
- lcd_con2fbmap.png (54.67 KiB) Viewed 520 times
- mad_ady
- Posts: 5229
- Joined: Wed Jul 15, 2015 5:00 pm
- languages_spoken: english
- ODROIDs: XU4, C1+, C2, N1
- Location: Bucharest, Romania
- Contact:
Re: terminal+touch input without X
I haven't tried fourdee's script on 18.04. You should also post the fix to fourdee's thread.
Regarding suppressing log messages - you need to change in boot.ini and point console from
Regarding starting a program instead of login - try this:
https://lists.debian.org/debian-user/20 ... 01026.html
Regarding suppressing log messages - you need to change in boot.ini and point console from
setenv condev "console=ttyS0,115200n8 console=tty0"
to setenv condev "console=ttyS0,115200n8 console=tty4"
instead.Regarding starting a program instead of login - try this:
https://lists.debian.org/debian-user/20 ... 01026.html
Who is online
Users browsing this forum: No registered users and 1 guest