Comments (22)
@Uup115 Can you share what you changed to make it working?
I am in the same boat now. Using RPI OS Lite
from lv_port_linux.
Any help appreciated @kisvegabor @Uup115
Device/OS : Raspberry Pi with Desktop
SDL version working fine - Display & Touch
Device/OS : Raspberry Pi Lite
Display : Working
Touch : Not working yet
Getting the following compiler error with touch is enabled using evdev
/usr/bin/ld: ./main.o: in function `main':
main.c:(.text.startup+0x74): undefined reference to `evdev_init'
/usr/bin/ld: main.c:(.text.startup+0x80): undefined reference to `evdev_read'
/usr/bin/ld: main.c:(.text.startup+0x90): undefined reference to `evdev_read'
collect2: error: ld returned 1 exit status
make: *** [Makefile:38: default] Error 1
Full Project is here for review
https://github.com/sukesh-ak/LINUX-LVGL-FRAME-BUFFER
Code for touch here
from lv_port_linux.
@Uup115 Can you share what you changed to make it working? I am in the same boat now. Using RPI OS Lite
The simplest route:
- Start with the Linux port: https://github.com/lvgl/lv_port_linux_frame_buffer
- Replace the two attached modified files: main.c and lv_conf.h ( modification(s) are below commented line(s))
- Edit the file: /boot/config.txt and comment the line: vc4-fkms-v3d
You can edit the appropriate make files to shorten build time.
Embedded GUI Using Linux Frame Buffer Device with LVGL.tar.gz
from lv_port_linux.
@sukesh-ak Looks like you're using the main repository for lvgl. I think it's best to clone from the Linux port:
https://github.com/lvgl/lv_port_linux_frame_buffer
Kisvegabor already setup everything for Linux. You can edit the make files as needed.
from lv_port_linux.
@Uup115 thanks for your help.
My sample project is a clone of that project itself with few changes.
-
Local lv_drv_conf.h is still old which does not have the latest SDL (SDL display & touch works already now) and other updates from drivers folder. So the latest is copied from drivers repo.
-
I removed the demos since that repo is deprecated and have a label+2 buttons inside main.c for testing. Display works already.
I will check the attached files and revert soon.
from lv_port_linux.
@Uup115 Looks like the file you attached only has display and not touch. Like I mentioned above display is already working.
I need help to get touch working. Compiler error is when touch is enabled.
from lv_port_linux.
I've have updated both the blog post and this rrepo.
It uses lvgl v8.2 (last release) but you can update to latest master without any issues.
from lv_port_linux.
Thank you @kisvegabor
Will test and revert soon.
from lv_port_linux.
@kisvegabor Thanks for the updates.
@sukesh-ak Run evtest to find where your touchscreen is mapped.
In my case: /dev/input/event1. This needs to be set in file: "lv_drv_conf.h" @ line #397.
Be sure to #define USE_EVDEV 1 @ line #389.
In addition, I needed to #define EVDEV_CALIBRATE 1 @ line #400.
See attached "lv_drv_conf.h".
lv_drv_conf.h.gz
from lv_port_linux.
Any idea why this could be happening with colors?
This happens if I use the instructions for Bullseye branch.
Surprisingly, someone updated the Wiki page yesterday.
https://www.waveshare.com/wiki/2.8inch_DPI_LCD
from lv_port_linux.
@kisvegabor Thanks for the updates.
@sukesh-ak Run evtest to find where your touchscreen is mapped. In my case: /dev/input/event1. This needs to be set in file: "lv_drv_conf.h" @ line #397. Be sure to #define USE_EVDEV 1 @ line #389. In addition, I needed to #define EVDEV_CALIBRATE 1 @ line #400.
See attached "lv_drv_conf.h". lv_drv_conf.h.gz
Thank you @Uup115
Do you know why touch screen changes between event0 and event1 after reboot? How do I fix it?
from lv_port_linux.
Current status
evtest output
Available devices:
/dev/input/event0: Goodix Capacitive TouchScreen
Display: working
Touch:
unable to open evdev interface:: No such file or directory
If I run like below, this error doesn't show up but touch doesn't work
DISPLAY=:0 ./demo
If I run evtest, it detects touch so hardware is fine.
from lv_port_linux.
Any idea why this could be happening with colors?
This happens if I use the instructions for Bullseye branch. Surprisingly, someone updated the Wiki page yesterday.
As explained here:
Edit the file: /boot/config.txt and comment the line which has: vc4-fkms-v3d
from lv_port_linux.
As explained here: Edit the file: /boot/config.txt and comment the line which has: vc4-fkms-v3d
I don't have the 'f'kms but have dtoverlay=vc4-kms-v3d
as per Waveshare documentation. I have written to them as well and waiting.
With the new OS version (Raspberry Pi OS Bullseye branch) if I disable kms nothing shows up. It was a workaround for legacy version as I understand discussed here
from lv_port_linux.
Have now reverted to Raspberry Pi OS Buster branch
now, so that display works as expected.
How do I rotate the touch?
Tried enabling this but does not work.
# define EVDEV_SWAP_AXES 1 /*Swap the x and y axes of the touchscreen*/
from lv_port_linux.
Have now reverted to
Raspberry Pi OS Buster branch
now, so that display works as expected.How do I rotate the touch? Tried enabling this but does not work.
# define EVDEV_SWAP_AXES 1 /*Swap the x and y axes of the touchscreen*/
Maybe this (see comments):
# define EVDEV_CALIBRATE 1 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
# if EVDEV_CALIBRATE
# define EVDEV_HOR_MIN 0 /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/
# define EVDEV_HOR_MAX 4096 /*"evtest" Linux tool can help to get the correct calibraion values>*/
# define EVDEV_VER_MIN 0
# define EVDEV_VER_MAX 4096
# endif /*EVDEV_CALIBRATE*/
from lv_port_linux.
@Uup115
Yes I have already tried changing it. Its still won't swap.
I also tried
# define EVDEV_SWAP_AXES 1 /*Swap the x and y axes of the touchscreen*/
Reviewing this now
https://github.com/lvgl/lv_drivers/blob/af07f57390ec50fb8cd2a52590141c2ab3ce6bee/indev/evdev.c#L112
Output of evtest. What should be the values of EVDEV_HOR_MIN
etc?
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min 0
Max 639
Event code 1 (ABS_Y)
Value 0
Min 0
Max 479
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 4
Event code 48 (ABS_MT_TOUCH_MAJOR)
Value 0
Min 0
Max 255
Event code 50 (ABS_MT_WIDTH_MAJOR)
Value 0
Min 0
Max 255
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 639
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 479
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Btw, other than swapped X & Y, touch works
from lv_port_linux.
@sukesh-ak Not sure. This is the output when I touch my screen:
Event: time 1648425830.433049, -------------- SYN_REPORT ------------
Event: time 1648425830.441088, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1836
Event: time 1648425830.441088, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 444
Event: time 1648425830.441088, type 3 (EV_ABS), code 60 (ABS_MT_TOOL_X), value 1836
Event: time 1648425830.441088, type 3 (EV_ABS), code 61 (ABS_MT_TOOL_Y), value 444
Event: time 1648425830.441088, type 3 (EV_ABS), code 0 (ABS_X), value 1836
Event: time 1648425830.441088, type 3 (EV_ABS), code 1 (ABS_Y), value 444
Event: time 1648425830.441088, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 1336100
from lv_port_linux.
@Uup115 Thanks for the details.
I think there is an issue with hardware/driver itself.
Not sure how this gets fixed in the RPI Desktop UI.
Scenario:
- OS: Raspberry Pi 64 Lite
- Default : Portrait with top on the side of USB/Ethernet
- No rotation applied in config
- No touch configured
When display is in portrait (default), X max should be 480 and Y max should be 640
. Isn’t it?
But as per output of evtest command, its switched. See below output
Output of evtest
Available devices:
/dev/input/event0: Goodix Capacitive TouchScreen
Select the device event number [0-0]: 0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x416 product 0x38f version 0x1060
Input device name: "Goodix Capacitive TouchScreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 59 (KEY_F1)
Event code 60 (KEY_F2)
Event code 61 (KEY_F3)
Event code 62 (KEY_F4)
Event code 63 (KEY_F5)
Event code 64 (KEY_F6)
Event code 125 (KEY_LEFTMETA)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X
)
Value 0
Min 0
Max 639
Event code 1 (ABS_Y
)
Value 0
Min 0
Max 479
I am working with Waveshare support to figure this out first.
from lv_port_linux.
This is how the touch cordinates from evtest looks like right now.
@kisvegabor
Is this supposed to fix it? Because I tried and it does not work. A bug?
# define EVDEV_SWAP_AXES 1 /*Swap the x and y axes of the touchscreen*/
from lv_port_linux.
@sukesh-ak Touch resolution isn't necessarily equal to the resolution of the display. My display resolution is configured to 800x600. Per evtest, the touch resolution is higher. In my case, I use the following settings:
# define EVDEV_CALIBRATE 1 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
# if EVDEV_CALIBRATE
# define EVDEV_HOR_MIN 0 /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/
# define EVDEV_HOR_MAX 4096 /*"evtest" Linux tool can help to get the correct calibraion values>*/
# define EVDEV_VER_MIN 0
# define EVDEV_VER_MAX 4096
# endif /*EVDEV_CALIBRATE*/
from lv_port_linux.
I think we can close this since the original issue has been resolved.
from lv_port_linux.
Related Issues (20)
- how do i run this repo HOT 7
- Compilation fails with Clang 15 HOT 1
- Alpha Blending in Wayland HOT 4
- Using 3rd-party lib qr-code shows "undefined reference"-error HOT 6
- Run on Raspberry pi zero but get two same contents in one frame HOT 1
- when I add the code in my linux systerm and cross compile , errors HOT 2
- sos HOT 1
- how can I run this project on my ubuntu computer? HOT 2
- Makefile HOT 1
- unable to open evdev interface:: No such file or directory HOT 3
- evdev_read callback denies non-zero ABS_MT_TRACKING_ID in touchscreen. HOT 3
- Error during make HOT 5
- exclude binaries from source code ! HOT 1
- How do use touch in v9? HOT 4
- Some bug-like issues HOT 11
- Documentation : cross compilation for arm HOT 41
- How to add nativeapp to Cmakelist? HOT 3
- How to implement a right-angled box through lv_obj HOT 1
- SDL2、Libdrm_LIBRARY HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lv_port_linux.