Project

General

Profile

Actions

Feature #1031

closed

Switch functions optimizeTouchscreen and optimizeBoard to use config include files instead of multiple edits to config.txt

Added by Hammel over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
04 - Root File System
Target version:
Start date:
31 Aug 2023
Due date:
% Done:

100%

Estimated time:
Severity:
02 - High

Description

The optimizeTouchscreen() and optimizeBoard() functions in the functions shell script under the Buildroot skeleton tree check for hardware and then update the config.txt with specific features.

This should be changed to include board-config.txt and include touchscreen-config.txt in config.txt, if appropriate and these functions should simply copy in the appropriate configs from /usr/share/pibox/configs. The board and screen specific configs currently in the functions should be hard coded to config files under that directory.

This would make it easier to switch to a different board on boot by just copying the apropriate board/screen config to /media/boot/{board,touchscreen}-config.txt and only adding or removing the include files as necessary from config.txt.

This is effectively the same thing that was done with lcdshow's opkg.

While doing this all the commented out options currently in config.txt should be considered for movement to board or screen specific configurations. There should be a comment left in config.txt that points to where the board and screen specific configs live (/usr/share/pibox/configs).

Actions #1

Updated by Hammel over 1 year ago

  • Description updated (diff)
Actions #2

Updated by Hammel over 1 year ago

optimizeBoard() is updated and working on rpi3 and rpi4. Others are not tested yet but the general functionality is there.

optimizeTouchscreen() does not work. For some reason the pbtouchstate call does not return the correct value so it falls through to "Not a touchscreen".
The problem is that I moved the

dtoverlay=rpi-ft5406-overlay

into the Display-RPiLCD.txt config file, which firstboot is now supposed to copy into display-config.txt and include in config.txt. But it doesn't do that because the overlay is needed to be able to identify the LCD by pbtouchstate.

So I need to move the overlay back into config.txt. It won't hurt anything since it just loads some drivers which would get unloaded later by firstboot if it's NOT an RPi LCD.

Actions #3

Updated by Hammel over 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
Actions #4

Updated by Hammel over 1 year ago

See RM #948 - it want to use EDIDs to determine which overlay to load but I don't think TFT devices have EDIDs (those are HDMI things).
I don't think there is any way to do these overlays without having ALL overlays for specific displays loaded in the default config.txt.

Also see RM #950. But again, that only works for HDMI.

Actions #5

Updated by Hammel over 1 year ago

For the Raspbery Pi LCD, it turns out we can identify it during firstboot without the overlays working. A test shows

Jan  1 00:00:22 (none) user.warn kernel: [   22.105925] ### Output from pbtouchstate: No touchscreen found
Jan  1 00:00:22 (none) user.warn kernel: [   22.111811] ### Output from tvservice: device_name=Ras-LCD Panel

So tvservice -n will identify the LCD panel. I need to verify this again without the overlays installed, however.

Update

Verified - I can use the output from tvservice -n for the Raspberry Pi 7" to load the external config file.

Actions #6

Updated by Hammel over 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 50 to 100

Fixed - tested on 7" display. Rotation works and kiosk works though there are issues with pipics (see RM #1034) which will be fixed later.

Changes committed and pushed.

Closing issue.

Actions

Also available in: Atom PDF