Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waveshare 7inch HDMI LCD #50

Closed
balwantbishnoi27 opened this issue Jun 23, 2018 · 7 comments
Closed

Waveshare 7inch HDMI LCD #50

balwantbishnoi27 opened this issue Jun 23, 2018 · 7 comments

Comments

@balwantbishnoi27
Copy link

Hii,
I am using GUIslice to built UI for my Project and i am using Waveshare 7inch HDMI LCD.
When i tried to built Using MAKEFILE present in linux
For First case : No Touchscreen enabled it works fine
But when I run Second program i am getting this error
ERROR : DrvInit() error in SDL_Init(): Unable to open /dev/fb1
ERROR : Init() failed

@ImpulseAdventure
Copy link
Owner

Hi @balwantbishnoi27 --

Thanks for letting me know about your error message. To help narrow down the cause for you, could you let me know a couple details:

  • Could you clarify which two programs you were running? eg. test-sdl1, test-sdl2, gslc-ex01, etc.
  • In GUIslice_config_linux.h, what option was enabled for DRV_DISP_*?
  • What option was enabled for DRV_TOUCH_*?

thx

@balwantbishnoi27
Copy link
Author

balwantbishnoi27 commented Jun 25, 2018

Hi @ImpulseAdventure

I have tslib and SDL library installed and i done test for both libraries.
TSLIB :
sudo TSLIB_FBDEVICE =/dev/fb1 ts_print WORKING
sudo TSLIB_TSDEVICE=/dev/input/touchscreen ts_print WORKING
sudo TSLIB_FBDEVICE=/dev/fb1 ts_test NOT WORKING
sudo TSLIB_TSDEVICE=/dev/input/touchscreen WORKING

Now i use Makefile to compile example programs

Case 1:
#define DRV_DISP_SDL1
#define DRV_TOUCH_NONE
Result for gslc-ex01, ..gslc-ex02......gslc-ex11
ERROR : DrvInit() error in SDL_Init(): Unable to open /dev/fb1
ERROR : Init() failed

But for ./test-sdl1 it is working and getting pattern.

Case 2:
#define DRV_DISP_SDL1
#define DRV_TOUCH_TSLIB
Result for gslc-ex01, ..gslc-ex02......gslc-ex11
ERROR : DrvInit() error in SDL_Init(): Unable to open /dev/fb1
ERROR : Init() failed

But for ./test-sdl1 it is working and getting pattern.

Case 3:
#define DRV_DISP_SDL1
#define DRV_TOUCH_SDL
Result for gslc-ex01, ..gslc-ex02......gslc-ex11
ERROR : DrvInit() error in SDL_Init(): Unable to open /dev/fb1
ERROR : Init() failed

But for ./test-sdl1 it is working and getting pattern.

Case 4:
#define DRV_DISP_SDL1
#define DRV_TOUCH_NONE
and I Commented UserInitEnv();
Result for gslc-ex01 :
A black rectangle box in left hand side . Working fine.

Result for gslc-ex02:
ERROR: DrvFontAdd(/usr/share/fonts/truetype/droid/DroidSans.tft) failed in TFT_OpenFont failed
Segmentation fault

Thanks.

@ImpulseAdventure
Copy link
Owner

@balwantbishnoi27 -- thank you for the detailed report.

It looks like you are encountering two setup issues:

  1. SDL config setting for SDL_VIDEODRIVER
  2. Missing font installation

Can you indicate what device model and LINUX distribution you are using? eg. Raspberry Pi with Raspbian, etc. Some of the configuration will be dependent upon your particular environment.

For Issue1)

  • It appears that the default setting for SDL_VIDEODRIVER of fbcon isn't correct for your Waveshare LINUX installation. You can probably avoid the error (in gslc-ex01) by commenting out the following line in UserInitEnv():
    setenv((char*)"SDL_VIDEODRIVER","fbcon",1);
  • Can you tell me what is output from the following at the command prompt?
    printenv | egrep SDL_VIDEODRIVER
    printenv | egrep FRAMEBUFFER

For Issue2)

  • As for the TTF_OpenFont() error, it appears that you don't have the DroidSans font installed in your LINUX environment.
  • I believe this font is normally installed in the Raspberry Pi Raspbian distribution, but perhaps you are using a different LINUX distribution?
  • If you run fc-list at the command prompt you should see a listing of all your installed fonts. You can either substitute the #define FONT_DROID_SANS ... path with another existing font, or else install the DroidSans font manually. I think you can install it with sudo apt-get install droid-fonts

@balwantbishnoi27
Copy link
Author

balwantbishnoi27 commented Jun 27, 2018

Hi @ImpulseAdventure

First i would like to Thank you for help you provided.

I am using Raspberry pi with following
Device : WAVESHARE 7inch HDMI LCD (C). USB Capacitive Touch Screen 1024 x 600 Pixel. Rev2.2
Distributor ID : Raspbian
Description : RASPBIAN GNU/Linux 9.4
Release : 9.4
Codename : Stretch.

Result for issue 1

  • Issue Resolved when I commented setenv((char*)"SDL_VIDEODRIVER","fbcon",1); in UserInitEnv() and all code are running fine with following configuration
    #define DRV_DISP_SDL1
    #define DRV_TOUCH_SDL

  • I get NO Output from following at command prompt
    printenv | egrep SDL_VIDEODRIVER
    printenv | egrep FRAMEBUFFER

Result for issue 2

  • Issue Resolved. I replace path of FONT_DROID_SANS with another existing font.

Issue Noticed

  • When i am using following cofiguration in GUIslice_config_linux.h
    #define DRV_DISP_SDL1
    #define DRV_TOUCH_TSLIB

I am getting following error :
ERROR: TsOpen() failed.
ERROR: InitTouch() failed to touch driver init
ERROR: Init() failed

Thanks @ImpulseAdventure

@ImpulseAdventure
Copy link
Owner

Glad to hear that the updates worked!

As for TsOpen(), it seems possible that the TSLIB_TSDEVICE config parameter might not be matching your particular environment setup.

  • When you installed tslib, was it from sources? (please refer to the steps on my Installing tslib page).
  • Could you report the output of the following from the command-line?
    ls -l /dev/input/

It may be easiest to email me directly at guislice at impulseadventure (.com) so that I can determine how your setup might be different from the typical RPI defaults. For the benefit of others, I could then summarize the updates here later.

thanks!

@ImpulseAdventure
Copy link
Owner

A quick update: I understand from @balwantbishnoi27 that a change to the touch configuration resolved the Waveshare touchscreen functionality. In his case, with multiple USB device enumerations, the touch device (GSLC_DEV_TOUCH) configuration needed to be mapped to "/dev/input/event2"

Closing

@balwantbishnoi27
Copy link
Author

Hi, @ImpulseAdventure
Thanks for your help to resolve issue faced by me for Waveshare Touchscreen Functionality. I would like to thank you for this amazing library you created with touchscreen Functionality for Raspberry Pi. I am loving it man Awesome..

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants