Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 13 of 13

Thread: TouchscreenUSB.release(finger), Touch freezes, bug with Linux??

  1. #1
    Junior Member
    Join Date
    Apr 2017
    Posts
    18

    TouchscreenUSB.release(finger), Touch freezes, bug with Linux??

    Hello,
    on teensy 3.2 there are two USB HID Touchscreen Emulator functions:
    TouchscreenUSB.press(finger, x, y);
    TouchscreenUSB.release(finger);

    see also:
    https://forum.pjrc.com/threads/32331...support-needed

    Unfortunately that works for me only on Windows, but I need it for the Raspberry, Raspbian Jessie (Linux).
    On Raspbian Jessie (Linux) as long no Release happen the touch works - but as soon as I release the touch freezes...

    Is there something on the Descriptor/Teensy Code I could adapt to make it work on Linux?
    I don't need it for Windows...

    thank you for any help or advise.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,218
    You must post a complete program. Even if it's trivial, this is an absolute requirement. I will not investigate this problem, I won't even put it on my list of possible issues, until a complete program is posted.

    Please double check that the program you post really does reproduce the problem. Yeah, obvious as that sounds, often we get cases like this were someone quickly writes something that "should" work, but then doesn't for some reason.

    Also be specific about the PC side setup. So far you've only said "Linux", not even which distro, not to mention which version. If you want this problem investigated and fixed, the best way to get that to happen is posting detailed info so I can reproduce the issue.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,218
    Also, if you are not using 1.41-beta3, please do so *BEFORE* you post the program. Any testing and any changes will be applied with the latest code, so please make sure you are not running an older version when it comes to reporting a problem.

  4. #4
    Junior Member
    Join Date
    Apr 2017
    Posts
    18
    Quote Originally Posted by PaulStoffregen View Post
    Also, if you are not using 1.41-beta3, please do so *BEFORE* you post the program. Any testing and any changes will be applied with the latest code, so please make sure you are not running an older version when it comes to reporting a problem.
    oh :-) now I am very happy to get a feedback. I use Arduino 1.8.2 Software / Teensyduino 1.36
    My Code/your USB Touchscreen Functions works properly with Windows 10. With Ubuntu 17.04 on a x86, 32bit System the touch/mouse symbol freezes after the first release.
    With current Raspian Jessie (with Desktop) on a Raspberry Pi 3 the Touch freeze as soon as I release but interesting: If I start the browser chromium and a javascript drawing program (for multitouch) touches freezes only after several releases (so not after the first).


    And please find below my Code. With that Code I can read every Focaltech Controller per I2C and transfer the X, Y Data to your USB HID Touchscreen Functions.
    So it's a simple I2C Touchscreen Interface to USB HID Touchscreen Interface Converter:

    //Code deleted, please see more simple code next reply
    Last edited by epikao; 01-12-2018 at 10:41 PM.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,218
    Quote Originally Posted by epikao View Post
    I use Arduino 1.8.2 Software / Teensyduino 1.36
    Please confirm whether this problem happens with Arduino 1.8.5 and Teensyduino 1.41-beta3 (the most recent code).

    There's no point for anyone to waste time investigating a problem that only happens with an old version of the software.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,218
    If the problem is present with 1.41-beta3, I will also need a link to the website with this javascript, and specific info about where to get the "Focaltech Controller per I2C" hardware.

    Please try to imagine if you had to read this message and needed to duplicate the test. Would you know which hardware to buy? What would you do for the javascript code?

    Can you understand how leaving out these details means I can not recreate the test here?

    If you want this problem properly investigated, please try to imagine any other details, any other specific info or steps needed to recreate the problem. Remember, I can not see your screen. I do not know anything about this javascript program. I can not know what you actually do with it. Try to imagine someone who knows the USB code but nothing about what you are actually doing, will try to fill in missing info and very likely do something different (perhaps not reproducing the problem). Do not leave these details to chance. Be specific. Include all info needed for anyone not familiar with your project to precisely follow the same steps and be sure to recreate the problem.

    I do not wish to be difficult about this, but you really must understand we get these sorts of incomplete problem reports regularly. When details are missing, I almost never manage to reproduce the problem (even after wasting quite a lot of time). I know it requires extra effort on your part to provide this info, but it really is in your interest. I can only fix problems that I'm able to reproduce.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,218
    Please also understand your program's requirement for a specific piece of hardware means I will need to buy that hardware. This is (probably) not a problem. I do have a small budget for buying hardware to test bug reports. I only need you to show me exactly which hardware to buy. Again, please be specific... recently someone asked about a I2C LCD and gave the wrong display in their link, causing me to buy a different model than they were actually using. Don't do that!

    But buying the correct Focaltech Controller will require time for the hardware to arrive. If it is a display ordered from a Chinese vendor, I will have to wait for the package to arrive by international mail.

    In your other message, you wrote "It's URGENT". One thing you can do to expedite this process is to write a different program that reproduces the problem using only simple hardware, like a pushbutton connected to a digital pin or a pot connected to an analog pin. Or use of any of the hardware PJRC sells would be quick, since that hardware is already here.

    Likewise, if there is a simpler way to recreate the lockup (not using specific javascript), the simpler and faster I can recreate the problem, the sooner I can work on a solution.

  8. #8
    Junior Member
    Join Date
    Apr 2017
    Posts
    18
    so now I have updated to 1.8.5, 1.41-beta3.

    Still the same, and you don't need a Hardware / Touchscreen to test it, with follow code it's the same (just Touch Emulating):

    const int LED = 13;
    float mtmax = 32767.0;
    float screenW = 2560.0;
    float screenH = 1440.0;
    int i=0;

    void setup() {
    // put your setup code here, to run once:
    digitalWrite(LED,LOW);
    TouchscreenUSB.begin();


    }

    void loop() {

    for (i=0; i<40; i++) {
    //Mouse.move(2, -1);
    TouchscreenUSB.press(0, mtmax/2 + mtmax/screenW * i * 2, mtmax/2 + mtmax/screenH * i * -1);
    TouchscreenUSB.press(1, 1000 + mtmax/2 + mtmax/screenW * i * 2, -500 + mtmax/2 + mtmax/screenH * i * -1);
    delay(25);
    }
    TouchscreenUSB.release(0);
    //TouchscreenUSB.release(1);

    // put your main code here, to run repeatedly:
    delay(3000);

    }

    on windows 10 it works perfectly, on linux ubuntu 17.04 first touch than it freezes
    You can also test it with http://www.repaa.net/draw.html

    I use teensy 3.2 (I have bought 15pcs of them for the raspberry)

    Additional: with Windows IOT 10 on Raspberry it also works perfect - so it has something to do with linux!
    Maybe Linux need only Touchscreen data (without Keyboard, Mouse, Serial or something... I don't know??)
    Last edited by epikao; 01-12-2018 at 10:52 PM.

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,218
    Ok, I will look into this, using the code from message #8.

  10. #10
    Junior Member
    Join Date
    Apr 2017
    Posts
    18
    Quote Originally Posted by PaulStoffregen View Post
    Ok, I will look into this, using the code from message #8.
    Ok. hope you will find a solution because I think with that I can make every capacitive Touchscreen working on every Platform without the need of build kernel and adapt driver etc.
    Please let me know if you need more infos or if I can test something more?

    thanks.

  11. #11
    Junior Member
    Join Date
    Apr 2017
    Posts
    18
    Dear Paul, could you already reproduce my problem?

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,218
    I'm running it now on a Teensy 3.6 and watching the USB communication with a protocol analyzer.

    I can see the Teensy keeps communicating. But for some reason, Linux stops moving the cursor after the first run. Windows keeps responding by moving the cursor. I do not know why the 2 systems respond differently.

  13. #13
    Junior Member
    Join Date
    Apr 2017
    Posts
    18
    Quote Originally Posted by PaulStoffregen View Post
    I'm running it now on a Teensy 3.6 and watching the USB communication with a protocol analyzer.

    I can see the Teensy keeps communicating. But for some reason, Linux stops moving the cursor after the first run. Windows keeps responding by moving the cursor. I do not know why the 2 systems respond differently.

    hmm thankyou, in May 2016 in the other USB Touch Thread Member "Ivartaim" reports follow:

    Hi!
    I have been playing around with the following code using the new functions. Using a teensy 3.0 and samsung galaxy s6 with android 6
    I have one possible bug report and two possible suggestions. it could be that there is something wrong in my code also.

    1) BUG
    The release function doesn't release the finger properly in my case.

    After calling "TouchscreenUSB.release(1);"

    I cant call TouchscreenUSB.press again before i have restarted my phone. Even the disconnection of the usb doesn't help.

    2) SUGGESTION
    Instead of keyboard+touchscreen I would like to have touchscreen+serial. Because when teensy identifies itself as a keybord, then there is no way to use the androids touchscreens keyboard. And serial would be useful for printing out info.

    3) SUGGESTION
    Have some kind of aspect ratio input for coordinate remapping in the API. Of course this can be done before sending in commands to the API, but maybe through the API it would be cleaner?



    Is there maybe a way to only select touchscreen? without keyboard, without serial and without mouse?

    Elmue use another touch code which is working with all systems according codeproject page, but unfortunately only single-touch:
    https://www.codeproject.com/Articles...-emulator-with

    Anyway - maybe he can help?
    Last edited by epikao; Yesterday at 10:42 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •