Giter Club home page Giter Club logo

Comments (7)

ImpulseAdventure avatar ImpulseAdventure commented on May 21, 2024 1

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

from guislice.

ImpulseAdventure avatar ImpulseAdventure commented on May 21, 2024 1

@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

from guislice.

ImpulseAdventure avatar ImpulseAdventure commented on May 21, 2024 1

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!

from guislice.

balwantbishnoi27 avatar balwantbishnoi27 commented on May 21, 2024

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.

from guislice.

balwantbishnoi27 avatar balwantbishnoi27 commented on May 21, 2024

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

from guislice.

ImpulseAdventure avatar ImpulseAdventure commented on May 21, 2024

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

from guislice.

balwantbishnoi27 avatar balwantbishnoi27 commented on May 21, 2024

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,

from guislice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.