Git Product home page Git Product logo

huion-linux-drivers's Introduction

User Space Linux Drivers for Huion Tablets


PSA

This project is currently not actively maintained and its future is uncertain. I started it a long time ago in order to fulfill a specific need I had at the time, deciding to make it open and more general in case more people found it useful. But I didn't expect for it to become inmanageable as much for me.

My circumstances have changed and I no longer have the motivation to keep working on this project. For one, my tablet works better now without it that with it, in recent versions of Linux. Many bugs have arised related with the compatilibility between different Python versions and different distributions, which is very frustrating (and this has also contributed to my avoiding of Python AMAP). Plus obscure compatibility problems with many tablets which I can't test nor desire to debug. It also doesn't work with Wayland, and it doesn't support mixing multiple resolutions in multi-monitor mode... The list goes on.

If you believe you want to take care of gthe project and try to fix its multiple issues and keep maintaing it, please contact me and we can arrange some relay.

Thank you, and I'm sorry for the broken expectatives


Table of Contents

Features

  • Supports multiple tablet models
  • Precise cursor positioning
  • Full pressure sensitivity
  • Both stylus buttons
  • Compatible with multi-monitor setups
  • Customizable buttons and scrollbar shortcuts
  • Multiple sets of shortcuts
  • Optional desktop notifications
  • Versatile configuration file

Usage

  • Follow the requirements: Install the dependencies and the xorg extra code.
  • Download this repository (You only need huion-tablet-driver.py and config.ini).
  • Edit config.ini to match your tablet, multi-monitor setup and desired shortcuts.
  • Run sudo ./huion-tablet-driver.py (needs superuser privileges)

Requirements

Dependencies

  • python version 3.5 or greater

  • uclogic-tools (read why)

    # Installation from source: install dependencies, clone, compile & install
    
    $ sudo apt install make automake gcc pkg-config libusb-1.0-0-dev  # For ubuntu
    
    git clone https://github.com/DIGImend/uclogic-tools
    cd uclogic-tools
    autoreconf -i -f && ./configure --prefix=/usr/local/ && make
    sudo make install
    
  • xinput

  • evdev

  • python-evdev

  • pyusb

  • numexpr

  • xdotool (optional, for button shorcuts)

  • notify-send (optional, for desktop notifications)

  • xrandr (optional, for monitor configuration) (and arandr)

Install packages in Archlinux:

$  pacman -S xorg-xinput xf86-input-evdev python-evdev python-pyusb xdotool \
libnotify xorg-xrandr arandr python-numexpr

Install packages in Ubuntu:

$ sudo apt install xinput xserver-xorg-input-evdev python3-evdev python3-usb \
xdotool libnotify-bin arandr python3-numexpr

Xorg Extra Code

You will likely also need to add some code to the Xorg server. Create a new file in /etc/X11/xorg.conf.d/evdev-tablet.conf with the following content:

Section "InputClass"
	Identifier "evdev tablet catchall"
	MatchIsTablet "on"
	MatchDevicePath "/dev/input/event*"
	Driver "evdev"
EndSection

Troubleshooting

My tablet doesn't provide any inputs despite all my debugging efforts

Maybe you're connecting the table through a USV hub, or USB docking station? This is known to have caused problems in the past. Try plugging the tablet directly to the computer.

/usr/local/bin/uclogic-probe: not found

You eiher need to compile uclogic binaries (see Dependencies), or they are installed in a different location. For example Debian 10 automatically installs them under /usr/bin/. Try updating the path in the config.ini file, which by default is: uclogic_bins = /usr/local/bin.

Config Examples

Multi-Monitor

If you have a multi-monitor setup, edit your copy of config.ini with the correct values for your particular setup.

# Multi Monitor Configuration
enable_multi_monitor  = true
enable_xrandr         = false
current_monitor_setup = [monitor_3]

You'll have to customize your current monitor setup, by modifying one of the existing examples in the section 3 of the config.ini file.

More information about multiple monitors in the wiki

Shortcuts

To customize the shortcuts associated with the buttons and the scrollbar, edit the file config.ini, and use the xdotool syntax for the buttons actions.

First, assign the menu you're going to use as the starting menu.

Example with a Single Buttons Menu

start_menu = [menu_simple_10b]

[menu_simple_10b]

# upper buttons
b0 = key Tab           # hide interface
b1 = key r             # rect select (gimp) & pick layer (krita)
b2 = key ctrl+x        # cut
b3 = key ctrl+c        # copy
b4 = key ctrl+v        # paste

# scrollbar
su = click 4           # mouse wheel up
sd = click 5           # mouse wheel down

# lower buttons
b5 = key ctrl+z        # undo
b6 = key ctrl+y        # redo (gimp)
b7 = key ctrl+shift+z  # redo (krita)
b8 = key 4             # turn left (krita)
b9 = key 6             # turn right (krita)

See an example with multiple menus in the wiki

Help Welcomed

I originally started this project for my own simple needs and my single Huion tablet. Now it has grown more than I imagined, and I don't have much time or energy to support all use-cases and fix all the issues.

I'm very open to add additional mantainers, so tell me if you are interested. Or you can take a look to the open issues if you want to help with something.

Thank you!

huion-linux-drivers's People

Contributors

benthor avatar gijsjan avatar joseluis avatar pixeliz3d avatar yayfortrees avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

huion-linux-drivers's Issues

Failure to run xinput during driver start

I've recently gotten the Huion Kamvas Pro 12 tablet, and connected it to my Ubuntu 19.04 desktop as a second monitor. After getting the mulit monitor modes configured, the driver exits.

Below is the run log. Any hints on the next step to debug would be great!

ribos:~/code/huion-linux-drivers(master)> sudo ./huion-tablet-driver.py 
Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 53580
    |                          Max Y: 33640
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M171_190320
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name         GT-116
	Buttons                   ENABLED (4)
	Scrollbar                 ENABLED (1)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    Enabled (1920x1080)
	Current Monitor Setup     [monitor_2]
	Multi Monitor Setup       ENABLED
	Calling xrandr            ENABLED

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 5.0.0-31-generic (x86_64 x86_64)
#33-Ubuntu SMP Mon Sep 30 18:51:59 UTC 2019

DEVICE: /dev/input/event6 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3), ('?', 21)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=53580, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=33640, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=8191, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]
VPEN:
name "Tablet Monitor Pen 092902", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

Setting up multiple monitors. . . 
Running xrandr. . . 
» xrandr --output HDMI-1 --mode 1920x1200 --pos 0x0 --rotate normal --output HDMI-3 --mode 1920x1080 --pos 1920x0 --rotate normal
Running xinput. . . 
» xinput set-prop "Tablet Monitor Pen 092902" --type=float "Coordinate Transformation Matrix" 0.5 0 0.5 0 0.9 0.0 0 0 1
unable to find device Tablet Monitor Pen 092902
ERROR running the following comand:
	xinput set-prop "Tablet Monitor Pen 092902" --type=float "Coordinate Transformation Matrix" 0.5 0 0.5 0 0.9 0.0 0 0 1
RETURN CODE: 1

Stylus is disabled if it hasen't been used before starting the script...

Hi,
It might sounds weird but I noticed that with my Kamvas Pro 13:

When I plug the tablet, if I don't use the stylus at least once before launching the driver (like hover over the screen and make the cursor move), the stylus don't work anymore after the driver is started.

If i exit the script, it doesn't work anymore. I need to reboot the system (or maybe restart xorg should do it) in order to get the stylus functions back.
EDIT : Unplug the USB cable and plugging it again makes the tablet work again without a restart.

I don't know if it does that with other tablets, since I don't have another Huion model to test it out.

Notifications won't display

Hi,
I have no notifications displaying despite that I've activated the option in config.ini.
I've checked the code, it should work.
If I test the notification code in my terminal, it works.
I tried to edit the code to use the Python implementation of libnotify but it doesn't work either.
I'm under Arch with XFCE. I've installed all dependencies, I dunno if I'm missing something...

Cursor moves to lower right corner when pen comes close to screen.

The driver seems to be working but the mouse moves to the lower right corner any time the pen
comes close to the screen. it seems to be registering all of the movements of the pen just fine.

The scrollbar causes the mouse pointer to appear to the left and to move up and down.
after letting go of the scroll bar the pointer jumps to the top of the screen.

Putting the pen close to the screen moves the pointer to the bottom right corner.

This is a fresh install of Arch Linux from last week. 07/07/2019.
I had installed the wacom drivers but have uninstalled them since.

Kernel is 5.1

i made the entry in the xorg. conf as stated in the install guide.
I changed the name to tablet_gt133 and that's the only change i made to
the config.

Here is the startup from the driver log.

Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 58752
    |                          Max Y: 33048
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M182_181206
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name         GT-133
	Buttons                   ENABLED (5)
	Scrollbar                 ENABLED (1)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    Enabled (1920x1080)
	Current Monitor Setup     [monitor_2]
	Multi Monitor Setup       disabled
	Calling xrandr            disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 5.1.15-arch1-1-ARCH (x86_64 )
#1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019

DEVICE: /dev/input/event20 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3), ('?', 21)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=58752, fuzz=0, flat=0, resolution=5080)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=33048, fuzz=0, flat=0, resolution=5080)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=8191, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]
VPEN:
name "Tablet Monitor Pen 143242", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

Huion Kamvas driver should now be running. . .

(Input from the tablet will be printed out)

grep evdev of the xorg.log looks ilke this.

[ 11825.864] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 11825.868] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
[ 11825.869] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 11825.871] (**) Sleep Button: Applying InputClass "evdev keyboard catchall"
[ 11825.873] (**) ErgoDox EZ ErgoDox EZ: Applying InputClass "evdev keyboard catchall"
[ 11825.877] (**) ErgoDox EZ ErgoDox EZ Mouse: Applying InputClass "evdev pointer catchall"
[ 11825.880] (**) ErgoDox EZ ErgoDox EZ System Control: Applying InputClass "evdev keyboard catchall"
[ 11825.883] (**) ErgoDox EZ ErgoDox EZ Consumer Control: Applying InputClass "evdev keyboard catchall"
[ 11825.887] (**) ErgoDox EZ ErgoDox EZ Keyboard: Applying InputClass "evdev keyboard catchall"
[ 11825.893] (**) ErgoDox EZ ErgoDox EZ Consumer Control: Applying InputClass "evdev keyboard catchall"
[ 11873.576] (**) Tablet Monitor Pen 134947: Applying InputClass "evdev tablet catchall"
[ 11873.576] (**) Tablet Monitor Pen 134947: Applying InputClass "evdev tablet catchall"
[ 11873.576] (II) LoadModule: "evdev"
[ 11873.576] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 11873.576] (II) Module evdev: vendor="X.Org Foundation"
[ 11873.576] (II) Using input driver 'evdev' for 'Tablet Monitor Pen 134947'
[ 11873.577] (**) evdev: Tablet Monitor Pen 134947: Device: "/dev/input/event10"
[ 11873.577] (--) evdev: Tablet Monitor Pen 134947: Vendor 0x1 Product 0x1
[ 11873.577] (--) evdev: Tablet Monitor Pen 134947: Found absolute axes
[ 11873.577] (--) evdev: Tablet Monitor Pen 134947: Found x and y absolute axes
[ 11873.577] (--) evdev: Tablet Monitor Pen 134947: Found absolute tablet.
[ 11873.577] (II) evdev: Tablet Monitor Pen 134947: Configuring as tablet
[ 11873.577] (**) evdev: Tablet Monitor Pen 134947: YAxisMapping: buttons 4 and 5
[ 11873.577] (**) evdev: Tablet Monitor Pen 134947: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 11873.577] (II) evdev: Tablet Monitor Pen 134947: initialized for absolute axes

Support for NEW 1060PLUS

Hi,

This is not really a issue, as I was able ton configure the tablette.
Here are the parameters for this model:

[tablet_1060plus]
model_name = 1060 PLUS
pen_max_x = 50800
pen_max_y = 31750
pen_max_z = 8191
resolution = 5080
buttons = 12

Error: uclogic-probe not found [GT-191]

This is the output I get. it's weird, because uclogic-probe works from terminal if called with uclogic-probe, but this driver tries to find it in /usr/local/bin/, where it's not.

Finding USB device. . . Done!
grabbed interface %d 0
grabbed interface %d 1
Reading configuration. . . Done!
hid_uclogic            16384  0
/bin/sh: 1: /usr/local/bin/uclogic-probe: not found
/bin/sh: 1: /usr/local/bin/uclogic-decode: not found
Preparing driver. . . ERROR running the following comand:
	"/usr/local/bin/uclogic-probe" "3" "5" | "/usr/local/bin/uclogic-decode"
RETURN CODE: 127
 

EDIT: FIX IS TO INSTALL uclogic like intstructions in main repo

Huion GT-133 (Kamvas Pro 13) - Cannot open config.ini

Hi,
I'm fairly new at using a graphic tablet under Linux, but, when I launch the .py file using sudo, the terminal outputs that it doesn't find the config.ini file, despite the fact that I've put it in the same folder as the .py script... All the required dependencies are installed. Did I get something wrong ?

The tablet already works as itself, with the default driver, but I want to make the shortcut keys and calibration to work because it is almost unusable as is.

I'm under Arch, with xorg and XFCE for the graphical interface.

Python3 hogging CPU

When shutting off my gt133 (on Elive 3.7.9 using Debian Buster) with the on/off button python3 hogs up to 100% of 1 CPU making CPU temperature rise. Hitting <Ctrl and c> solves the case but this should not be happening.

Huion Kamvas Pro 12(GT-116)

In config.ini current_tablet = [tablet_debug]

Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 53580
    |                          Max Y: 33640
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M171_190122
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
        Tablet model name         DEBUG TABLET
        Buttons                   disabled (0)
        Scrollbar                 disabled (0)
        Notifications:            ENABLED
                for buttons       ENABLED
                for scrollbar     disabled
        Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        < DEBUG MODE ENABLED >
        [Debug mode only]. Input from tablet wont be used, except
        for printing out the information to the console.

        INSTRUCTIONS: briefly touch the four corners of the screen:
                1) Left up 2) Right up 3) Left Down 4) Right Down
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Huion Kamvas driver should now be running

Please slowly and briefly touch the LEFT UP corner of your tablet:
...
data[12] = array('B', [8, 129, 135, 0, 127, 0, 174, 0, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 134, 0, 128, 0, 195, 1, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 133, 0, 126, 0, 153, 2, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 132, 0, 126, 0, 65, 3, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 131, 0, 126, 0, 208, 3, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 130, 0, 126, 0, 80, 4, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 129, 0, 126, 0, 193, 4, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 128, 0, 126, 0, 32, 5, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 127, 0, 126, 0, 111, 5, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 125, 0, 126, 0, 175, 5, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 124, 0, 126, 0, 223, 5, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 124, 0, 125, 0, 255, 5, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 124, 0, 123, 0, 20, 6, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 125, 0, 121, 0, 31, 6, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 127, 0, 118, 0, 29, 6, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 129, 0, 114, 0, 7, 6, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 130, 0, 110, 0, 209, 5, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 132, 0, 106, 0, 118, 5, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 134, 0, 102, 0, 218, 4, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 134, 0, 98, 0, 200, 3, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 134, 0, 98, 0, 117, 2, 0, 0, 0, 0])
data[12] = array('B', [8, 129, 133, 0, 95, 0, 13, 1, 0, 0, 0, 0])
...
Now touch the RIGHT UP corner of your tablet:
data[12] = array('B', [8, 129, 2, 208, 83, 0, 43, 1, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 4, 208, 84, 0, 84, 2, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 5, 208, 84, 0, 75, 3, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 6, 208, 84, 0, 29, 4, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 7, 208, 85, 0, 217, 4, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 8, 208, 86, 0, 141, 5, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 9, 208, 87, 0, 72, 6, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 10, 208, 88, 0, 5, 7, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 11, 208, 88, 0, 186, 7, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 12, 208, 87, 0, 95, 8, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 12, 208, 87, 0, 240, 8, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 12, 208, 88, 0, 103, 9, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 12, 208, 89, 0, 191, 9, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 12, 208, 89, 0, 249, 9, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 12, 208, 88, 0, 28, 10, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 12, 208, 87, 0, 49, 10, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 11, 208, 86, 0, 57, 10, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 10, 208, 86, 0, 60, 10, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 9, 208, 86, 0, 49, 10, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 9, 208, 87, 0, 21, 10, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 9, 208, 88, 0, 225, 9, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 8, 208, 90, 0, 141, 9, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 8, 208, 91, 0, 14, 9, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 7, 208, 92, 0, 82, 8, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 7, 208, 93, 0, 95, 7, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 7, 208, 93, 0, 24, 6, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 5, 208, 92, 0, 117, 4, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 3, 208, 90, 0, 178, 2, 0, 0, 6, 0])
data[12] = array('B', [8, 129, 2, 208, 87, 0, 250, 0, 0, 0, 6, 0])
...
Now touch the LEFT UP corner of your tablet:
data[12] = array('B', [8, 129, 34, 0, 142, 130, 218, 0, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 27, 0, 167, 130, 63, 2, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 19, 0, 190, 130, 53, 3, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 12, 0, 209, 130, 228, 3, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 7, 0, 224, 130, 101, 4, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 3, 0, 235, 130, 188, 4, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 1, 0, 243, 130, 241, 4, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 1, 0, 246, 130, 18, 5, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 2, 0, 244, 130, 38, 5, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 4, 0, 238, 130, 46, 5, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 7, 0, 228, 130, 50, 5, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 13, 0, 217, 130, 28, 5, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 20, 0, 204, 130, 225, 4, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 29, 0, 191, 130, 120, 4, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 38, 0, 177, 130, 205, 3, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 45, 0, 164, 130, 189, 2, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 50, 0, 151, 130, 119, 1, 0, 0, 12, 0])
data[12] = array('B', [8, 129, 54, 0, 138, 130, 44, 0, 0, 0, 12, 0])
...
Now touch the RIGHT DOWN corner of your tablet:
data[12] = array('B', [8, 129, 235, 207, 101, 129, 116, 0, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 237, 207, 101, 129, 74, 1, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 239, 207, 101, 129, 12, 2, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 241, 207, 100, 129, 179, 2, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 243, 207, 100, 129, 66, 3, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 245, 207, 100, 129, 195, 3, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 247, 207, 100, 129, 65, 4, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 248, 207, 100, 129, 199, 4, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 100, 129, 86, 5, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 100, 129, 239, 5, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 101, 129, 142, 6, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 103, 129, 50, 7, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 105, 129, 212, 7, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 108, 129, 105, 8, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 111, 129, 238, 8, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 115, 129, 94, 9, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 119, 129, 186, 9, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 123, 129, 254, 9, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 127, 129, 47, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 249, 207, 130, 129, 82, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 248, 207, 133, 129, 106, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 247, 207, 136, 129, 124, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 246, 207, 139, 129, 136, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 245, 207, 142, 129, 144, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 243, 207, 145, 129, 145, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 241, 207, 148, 129, 125, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 238, 207, 151, 129, 69, 10, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 235, 207, 152, 129, 202, 9, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 231, 207, 152, 129, 250, 8, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 225, 207, 151, 129, 139, 7, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 218, 207, 149, 129, 170, 5, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 212, 207, 144, 129, 156, 3, 0, 0, 16, 252])
data[12] = array('B', [8, 129, 207, 207, 136, 129, 144, 1, 0, 0, 16, 252])

Huion Q11K V2 calibration data

Hi, just wanted to chime in with the data from my Huion Q11k v2.

[tablet_q11kv2]
model_name = Q11K V2
pen_max_x = 55880
pen_max-y = 34925
resolution = 5080
buttons = 8

Huion GT-185

Hardware: Inspiron 7577
Operating System: Xubuntu 18.04.1 x86_64
Console output:

Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 64 |        Params block #1: ??????
    |                          Max X: 64400
    |                          Max Y: 36240
    |                   Max pressure: 2047
    |                     Resolution: 4000
    |
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 64400
    |                          Max Y: 36240
    |                   Max pressure: 2047
    |                     Resolution: 4000
    |
 c9 |      Unknown string #1: HUION_M163_161017
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name     GT-221 PRO
	Buttons               ENABLED (10)
	Scrollbar             ENABLED (1)
	Desktop notifications ENABLED
	Multi Monitor Setup   disabled

Huion Kamvas driver should now be running

% Main Menu %
button 0 = [menu_krita]
button 1 = [menu_gimp]
button 2 = [menu_darktable]
button 3 = 
button 4 = 
button 5 = 
button 6 = 
button 7 = 
button 8 = key Return
button 9 = key Escape
Traceback (most recent call last):
  File "./huion-tablet-driver.py", line 476, in <module>
    main.run()
  File "./huion-tablet-driver.py", line 32, in run
    main_loop()
  File "./huion-tablet-driver.py", line 268, in main_loop
    X = (data[8] << 16) + (data[3] << 8) + data[2]
IndexError: array index out of range

Only monitors are the laptop display and the Huion.

Cursor not moving

The click of the pen is working but the cursor does not move with the pen. Thanks!

Linux mint 18.3
Directory /etc/X11/xorg.conf.d/ did not exist => created with the file evdev-tablet.conf
Output of sudo ./huion-tablet-driver.py with the monitor_3 config.

Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 64 |        Params block #1: ??????
    |                          Max X: 37540
    |                          Max Y: 21120
    |                   Max pressure: 8191
    |                     Resolution: 2000
    |
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 95352
    |                          Max Y: 53645
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |      Unknown string #1: HUION_M167_170623
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name     GT-221 PRO
	Buttons               ENABLED (10)
	Scrollbar             ENABLED (1)
	Desktop notifications ENABLED
	Multi Monitor Setup   ENABLED
Setting up multiple monitors. . . Done!
	Mapped tablet area to "1920x1080 + 4480x0"

Huion Kamvas driver should now be running`

HUION 1060PLUS parameters

Hi @joseluis , thank you for your help on the Huion tablets.
As per your request, here are the parameters for the Huion 1060PLUS drawing tablet:

--------------------------------------------------------------------------------
    |                Product: 1060PRO
 64 |        Params block #1: ??????
    |                          Max X: 40000
    |                          Max Y: 25000
    |                   Max pressure: 2047
    |                     Resolution: 4000
    |
 79 |         Internal model: HA60-F400
 7b |         Buttons status: HK On
--------------------------------------------------------------------------------
`

Support for HUion HS64

sudo ./huion-tablet-driver.py 
Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |           Manufacturer: HUION
    |                Product: Huion Tablet
 64 |        Params block #1: ???????????????????????????????????????????????????????????????????????????????????????????????????
    |                          Max X: 8192
    |                          Max Y: 357
    |                   Max pressure: 2301
    |                     Resolution: 2048
    |
 79 |         Internal model: ???????????????????????????????????????????????????????????????????????????????????????????????????
 7b |         Buttons status: ???????????????????????????????????????????????????????????????????????????????????????????????????
 c8 |        Params block #2: ??O?????
    |                          Max X: 32000
    |                          Max Y: 20400
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_T193_190307
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name         DEBUG TABLET
	Buttons                   disabled (0)
	Scrollbar                 disabled (0)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 5.0.0-29-generic (x86_64 x86_64)
#31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019

DEVICE: /dev/input/event21 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]
VPEN:
name "Tablet Monitor Pen 064648", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

Huion Kamvas driver should now be running. . .

(Input from the tablet will ONLY be used to print it out)

...
08 81 00 00 59 01 3a 00 00 00 00 00 | X:00000 Y:00345 PRES:0058 TILT_X:000 TILT_Y:000
08 81 00 00 5b 01 d2 00 00 00 00 00 | X:00000 Y:00347 PRES:0210 TILT_X:000 TILT_Y:000
08 81 00 00 5d 01 71 01 00 00 00 00 | X:00000 Y:00349 PRES:0369 TILT_X:000 TILT_Y:000
08 81 00 00 5f 01 1c 02 00 00 00 00 | X:00000 Y:00351 PRES:0540 TILT_X:000 TILT_Y:000
08 81 00 00 60 01 d3 02 00 00 00 00 | X:00000 Y:00352 PRES:0723 TILT_X:000 TILT_Y:000
08 81 00 00 61 01 92 03 00 00 00 00 | X:00000 Y:00353 PRES:0914 TILT_X:000 TILT_Y:000
08 81 00 00 60 01 51 04 00 00 00 00 | X:00000 Y:00352 PRES:1105 TILT_X:000 TILT_Y:000
08 81 00 00 5f 01 0f 05 00 00 00 00 | X:00000 Y:00351 PRES:1295 TILT_X:000 TILT_Y:000
08 81 00 00 5e 01 c6 05 00 00 00 00 | X:00000 Y:00350 PRES:1478 TILT_X:000 TILT_Y:000
08 81 00 00 5e 01 72 06 00 00 00 00 | X:00000 Y:00350 PRES:1650 TILT_X:000 TILT_Y:000
08 81 00 00 5f 01 0a 07 00 00 00 00 | X:00000 Y:00351 PRES:1802 TILT_X:000 TILT_Y:000
08 81 00 00 5f 01 8d 07 00 00 00 00 | X:00000 Y:00351 PRES:1933 TILT_X:000 TILT_Y:000
08 81 00 00 5f 01 fa 07 00 00 00 00 | X:00000 Y:00351 PRES:2042 TILT_X:000 TILT_Y:000
08 81 00 00 5f 01 50 08 00 00 00 00 | X:00000 Y:00351 PRES:2128 TILT_X:000 TILT_Y:000
08 81 00 00 5f 01 91 08 00 00 00 00 | X:00000 Y:00351 PRES:2193 TILT_X:000 TILT_Y:000
08 81 00 00 60 01 c2 08 00 00 00 00 | X:00000 Y:00352 PRES:2242 TILT_X:000 TILT_Y:000
08 81 00 00 62 01 e4 08 00 00 00 00 | X:00000 Y:00354 PRES:2276 TILT_X:000 TILT_Y:000
08 81 00 00 64 01 fa 08 00 00 00 00 | X:00000 Y:00356 PRES:2298 TILT_X:000 TILT_Y:000
08 81 00 00 66 01 09 09 00 00 00 00 | X:00000 Y:00358 PRES:2313 TILT_X:000 TILT_Y:000
08 81 00 00 67 01 11 09 00 00 00 00 | X:00000 Y:00359 PRES:2321 TILT_X:000 TILT_Y:000
08 81 00 00 66 01 11 09 00 00 00 00 | X:00000 Y:00358 PRES:2321 TILT_X:000 TILT_Y:000
08 81 00 00 67 01 0b 09 00 00 00 00 | X:00000 Y:00359 PRES:2315 TILT_X:000 TILT_Y:000
08 81 00 00 67 01 fe 08 00 00 00 00 | X:00000 Y:00359 PRES:2302 TILT_X:000 TILT_Y:000
08 81 00 00 68 01 e9 08 00 00 00 00 | X:00000 Y:00360 PRES:2281 TILT_X:000 TILT_Y:000
08 81 00 00 69 01 ca 08 00 00 00 00 | X:00000 Y:00361 PRES:2250 TILT_X:000 TILT_Y:000
08 81 00 00 69 01 a2 08 00 00 00 00 | X:00000 Y:00361 PRES:2210 TILT_X:000 TILT_Y:000
08 81 00 00 6a 01 6d 08 00 00 00 00 | X:00000 Y:00362 PRES:2157 TILT_X:000 TILT_Y:000
08 81 00 00 6b 01 2d 08 00 00 00 00 | X:00000 Y:00363 PRES:2093 TILT_X:000 TILT_Y:000
08 81 00 00 6c 01 e0 07 00 00 00 00 | X:00000 Y:00364 PRES:2016 TILT_X:000 TILT_Y:000
08 81 00 00 6b 01 81 07 00 00 00 00 | X:00000 Y:00363 PRES:1921 TILT_X:000 TILT_Y:000
08 81 00 00 69 01 07 07 00 00 00 00 | X:00000 Y:00361 PRES:1799 TILT_X:000 TILT_Y:000
08 81 00 00 65 01 69 06 00 00 00 00 | X:00000 Y:00357 PRES:1641 TILT_X:000 TILT_Y:000
08 81 00 00 65 01 99 05 00 00 00 00 | X:00000 Y:00357 PRES:1433 TILT_X:000 TILT_Y:000
08 81 00 00 5c 01 83 04 00 00 00 00 | X:00000 Y:00348 PRES:1155 TILT_X:000 TILT_Y:000
08 81 00 00 5c 01 2c 03 00 00 00 00 | X:00000 Y:00348 PRES:0812 TILT_X:000 TILT_Y:000
08 81 00 00 5c 01 af 01 00 00 00 00 | X:00000 Y:00348 PRES:0431 TILT_X:000 TILT_Y:000
08 81 00 00 4a 01 29 00 00 00 00 00 | X:00000 Y:00330 PRES:0041 TILT_X:000 TILT_Y:000
...
08 81 00 7d 1d 01 1d 00 00 00 00 00 | X:32000 Y:00285 PRES:0029 TILT_X:000 TILT_Y:000
08 81 00 7d 21 01 61 00 00 00 00 00 | X:32000 Y:00289 PRES:0097 TILT_X:000 TILT_Y:000
08 81 00 7d 24 01 9d 00 00 00 00 00 | X:32000 Y:00292 PRES:0157 TILT_X:000 TILT_Y:000
08 81 00 7d 27 01 d2 00 00 00 00 00 | X:32000 Y:00295 PRES:0210 TILT_X:000 TILT_Y:000
08 81 00 7d 29 01 ff 00 00 00 00 00 | X:32000 Y:00297 PRES:0255 TILT_X:000 TILT_Y:000
08 81 00 7d 2a 01 24 01 00 00 00 00 | X:32000 Y:00298 PRES:0292 TILT_X:000 TILT_Y:000
08 81 00 7d 2b 01 41 01 00 00 00 00 | X:32000 Y:00299 PRES:0321 TILT_X:000 TILT_Y:000
08 81 00 7d 2a 01 57 01 00 00 00 00 | X:32000 Y:00298 PRES:0343 TILT_X:000 TILT_Y:000
08 81 00 7d 29 01 68 01 00 00 00 00 | X:32000 Y:00297 PRES:0360 TILT_X:000 TILT_Y:000
08 81 00 7d 28 01 75 01 00 00 00 00 | X:32000 Y:00296 PRES:0373 TILT_X:000 TILT_Y:000
08 81 00 7d 28 01 7f 01 00 00 00 00 | X:32000 Y:00296 PRES:0383 TILT_X:000 TILT_Y:000
08 81 00 7d 27 01 88 01 00 00 00 00 | X:32000 Y:00295 PRES:0392 TILT_X:000 TILT_Y:000
08 81 00 7d 27 01 93 01 00 00 00 00 | X:32000 Y:00295 PRES:0403 TILT_X:000 TILT_Y:000
08 81 00 7d 26 01 9d 01 00 00 00 00 | X:32000 Y:00294 PRES:0413 TILT_X:000 TILT_Y:000
08 81 00 7d 24 01 a7 01 00 00 00 00 | X:32000 Y:00292 PRES:0423 TILT_X:000 TILT_Y:000
08 81 00 7d 21 01 b2 01 00 00 00 00 | X:32000 Y:00289 PRES:0434 TILT_X:000 TILT_Y:000
08 81 00 7d 1e 01 bf 01 00 00 00 00 | X:32000 Y:00286 PRES:0447 TILT_X:000 TILT_Y:000
08 81 00 7d 1a 01 cf 01 00 00 00 00 | X:32000 Y:00282 PRES:0463 TILT_X:000 TILT_Y:000
08 81 00 7d 15 01 e2 01 00 00 00 00 | X:32000 Y:00277 PRES:0482 TILT_X:000 TILT_Y:000
08 81 00 7d 10 01 f1 01 00 00 00 00 | X:32000 Y:00272 PRES:0497 TILT_X:000 TILT_Y:000
08 81 00 7d 0b 01 ff 01 00 00 00 00 | X:32000 Y:00267 PRES:0511 TILT_X:000 TILT_Y:000
08 81 00 7d 06 01 0c 02 00 00 00 00 | X:32000 Y:00262 PRES:0524 TILT_X:000 TILT_Y:000
08 81 00 7d 01 01 18 02 00 00 00 00 | X:32000 Y:00257 PRES:0536 TILT_X:000 TILT_Y:000
08 81 00 7d fc 00 23 02 00 00 00 00 | X:32000 Y:00252 PRES:0547 TILT_X:000 TILT_Y:000
08 81 00 7d f7 00 2c 02 00 00 00 00 | X:32000 Y:00247 PRES:0556 TILT_X:000 TILT_Y:000
08 81 00 7d f3 00 32 02 00 00 00 00 | X:32000 Y:00243 PRES:0562 TILT_X:000 TILT_Y:000
08 81 00 7d ef 00 36 02 00 00 00 00 | X:32000 Y:00239 PRES:0566 TILT_X:000 TILT_Y:000
08 81 00 7d ec 00 37 02 00 00 00 00 | X:32000 Y:00236 PRES:0567 TILT_X:000 TILT_Y:000
08 81 00 7d eb 00 38 02 00 00 00 00 | X:32000 Y:00235 PRES:0568 TILT_X:000 TILT_Y:000
08 81 00 7d ea 00 38 02 00 00 00 00 | X:32000 Y:00234 PRES:0568 TILT_X:000 TILT_Y:000
08 81 00 7d e9 00 37 02 00 00 00 00 | X:32000 Y:00233 PRES:0567 TILT_X:000 TILT_Y:000
08 81 00 7d e7 00 32 02 00 00 00 00 | X:32000 Y:00231 PRES:0562 TILT_X:000 TILT_Y:000
08 81 00 7d e5 00 25 02 00 00 00 00 | X:32000 Y:00229 PRES:0549 TILT_X:000 TILT_Y:000
08 81 00 7d e4 00 0c 02 00 00 00 00 | X:32000 Y:00228 PRES:0524 TILT_X:000 TILT_Y:000
08 81 00 7d e2 00 e0 01 00 00 00 00 | X:32000 Y:00226 PRES:0480 TILT_X:000 TILT_Y:000
08 81 00 7d e2 00 9d 01 00 00 00 00 | X:32000 Y:00226 PRES:0413 TILT_X:000 TILT_Y:000
08 81 00 7d e2 00 34 01 00 00 00 00 | X:32000 Y:00226 PRES:0308 TILT_X:000 TILT_Y:000
08 81 00 7d dc 00 8d 00 00 00 00 00 | X:32000 Y:00220 PRES:0141 TILT_X:000 TILT_Y:000
...
08 81 00 00 50 4f 1b 00 00 00 00 00 | X:00000 Y:20304 PRES:0027 TILT_X:000 TILT_Y:000
08 81 00 00 4f 4f 81 00 00 00 00 00 | X:00000 Y:20303 PRES:0129 TILT_X:000 TILT_Y:000
08 81 00 00 50 4f fe 00 00 00 00 00 | X:00000 Y:20304 PRES:0254 TILT_X:000 TILT_Y:000
08 81 00 00 55 4f 96 01 00 00 00 00 | X:00000 Y:20309 PRES:0406 TILT_X:000 TILT_Y:000
08 81 00 00 5d 4f 46 02 00 00 00 00 | X:00000 Y:20317 PRES:0582 TILT_X:000 TILT_Y:000
08 81 00 00 67 4f 0b 03 00 00 00 00 | X:00000 Y:20327 PRES:0779 TILT_X:000 TILT_Y:000
08 81 00 00 70 4f d9 03 00 00 00 00 | X:00000 Y:20336 PRES:0985 TILT_X:000 TILT_Y:000
08 81 00 00 76 4f a6 04 00 00 00 00 | X:00000 Y:20342 PRES:1190 TILT_X:000 TILT_Y:000
08 81 00 00 7a 4f 70 05 00 00 00 00 | X:00000 Y:20346 PRES:1392 TILT_X:000 TILT_Y:000
08 81 00 00 7b 4f 2e 06 00 00 00 00 | X:00000 Y:20347 PRES:1582 TILT_X:000 TILT_Y:000
08 81 00 00 7a 4f df 06 00 00 00 00 | X:00000 Y:20346 PRES:1759 TILT_X:000 TILT_Y:000
08 81 00 00 77 4f 7c 07 00 00 00 00 | X:00000 Y:20343 PRES:1916 TILT_X:000 TILT_Y:000
08 81 00 00 74 4f 03 08 00 00 00 00 | X:00000 Y:20340 PRES:2051 TILT_X:000 TILT_Y:000
08 81 00 00 72 4f 78 08 00 00 00 00 | X:00000 Y:20338 PRES:2168 TILT_X:000 TILT_Y:000
08 81 00 00 71 4f dc 08 00 00 00 00 | X:00000 Y:20337 PRES:2268 TILT_X:000 TILT_Y:000
08 81 00 00 72 4f 31 09 00 00 00 00 | X:00000 Y:20338 PRES:2353 TILT_X:000 TILT_Y:000
08 81 00 00 73 4f 7c 09 00 00 00 00 | X:00000 Y:20339 PRES:2428 TILT_X:000 TILT_Y:000
08 81 00 00 74 4f bc 09 00 00 00 00 | X:00000 Y:20340 PRES:2492 TILT_X:000 TILT_Y:000
08 81 00 00 75 4f f0 09 00 00 00 00 | X:00000 Y:20341 PRES:2544 TILT_X:000 TILT_Y:000
08 81 00 00 76 4f 1b 0a 00 00 00 00 | X:00000 Y:20342 PRES:2587 TILT_X:000 TILT_Y:000
08 81 00 00 77 4f 3c 0a 00 00 00 00 | X:00000 Y:20343 PRES:2620 TILT_X:000 TILT_Y:000
08 81 00 00 78 4f 56 0a 00 00 00 00 | X:00000 Y:20344 PRES:2646 TILT_X:000 TILT_Y:000
08 81 00 00 78 4f 69 0a 00 00 00 00 | X:00000 Y:20344 PRES:2665 TILT_X:000 TILT_Y:000
08 81 00 00 79 4f 78 0a 00 00 00 00 | X:00000 Y:20345 PRES:2680 TILT_X:000 TILT_Y:000
08 81 00 00 78 4f 84 0a 00 00 00 00 | X:00000 Y:20344 PRES:2692 TILT_X:000 TILT_Y:000
08 81 00 00 78 4f 8b 0a 00 00 00 00 | X:00000 Y:20344 PRES:2699 TILT_X:000 TILT_Y:000
08 81 00 00 79 4f 89 0a 00 00 00 00 | X:00000 Y:20345 PRES:2697 TILT_X:000 TILT_Y:000
08 81 00 00 79 4f 7e 0a 00 00 00 00 | X:00000 Y:20345 PRES:2686 TILT_X:000 TILT_Y:000
08 81 00 00 7b 4f 6a 0a 00 00 00 00 | X:00000 Y:20347 PRES:2666 TILT_X:000 TILT_Y:000
08 81 00 00 7e 4f 49 0a 00 00 00 00 | X:00000 Y:20350 PRES:2633 TILT_X:000 TILT_Y:000
08 81 00 00 80 4f 1d 0a 00 00 00 00 | X:00000 Y:20352 PRES:2589 TILT_X:000 TILT_Y:000
08 81 00 00 82 4f de 09 00 00 00 00 | X:00000 Y:20354 PRES:2526 TILT_X:000 TILT_Y:000
08 81 00 00 81 4f 84 09 00 00 00 00 | X:00000 Y:20353 PRES:2436 TILT_X:000 TILT_Y:000
08 81 00 00 7d 4f f9 08 00 00 00 00 | X:00000 Y:20349 PRES:2297 TILT_X:000 TILT_Y:000
08 81 00 00 7c 4f 28 08 00 00 00 00 | X:00000 Y:20348 PRES:2088 TILT_X:000 TILT_Y:000
08 81 00 00 74 4f f2 06 00 00 00 00 | X:00000 Y:20340 PRES:1778 TILT_X:000 TILT_Y:000
08 81 00 00 74 4f 62 05 00 00 00 00 | X:00000 Y:20340 PRES:1378 TILT_X:000 TILT_Y:000
08 81 00 00 74 4f a4 03 00 00 00 00 | X:00000 Y:20340 PRES:0932 TILT_X:000 TILT_Y:000
08 81 00 00 74 4f d4 01 00 00 00 00 | X:00000 Y:20340 PRES:0468 TILT_X:000 TILT_Y:000
08 81 00 00 74 4f 04 00 00 00 00 00 | X:00000 Y:20340 PRES:0004 TILT_X:000 TILT_Y:000
...
08 81 5e 7c b0 4f 9b 00 00 00 00 00 | X:31838 Y:20400 PRES:0155 TILT_X:000 TILT_Y:000
08 81 58 7c b0 4f 35 01 00 00 00 00 | X:31832 Y:20400 PRES:0309 TILT_X:000 TILT_Y:000
08 81 53 7c b0 4f c6 01 00 00 00 00 | X:31827 Y:20400 PRES:0454 TILT_X:000 TILT_Y:000
08 81 4f 7c b0 4f 4d 02 00 00 00 00 | X:31823 Y:20400 PRES:0589 TILT_X:000 TILT_Y:000
08 81 4c 7c b0 4f c3 02 00 00 00 00 | X:31820 Y:20400 PRES:0707 TILT_X:000 TILT_Y:000
08 81 4a 7c b0 4f 2a 03 00 00 00 00 | X:31818 Y:20400 PRES:0810 TILT_X:000 TILT_Y:000
08 81 48 7c b0 4f 81 03 00 00 00 00 | X:31816 Y:20400 PRES:0897 TILT_X:000 TILT_Y:000
08 81 47 7c b0 4f c7 03 00 00 00 00 | X:31815 Y:20400 PRES:0967 TILT_X:000 TILT_Y:000
08 81 48 7c b0 4f fd 03 00 00 00 00 | X:31816 Y:20400 PRES:1021 TILT_X:000 TILT_Y:000
08 81 48 7c b0 4f 22 04 00 00 00 00 | X:31816 Y:20400 PRES:1058 TILT_X:000 TILT_Y:000
08 81 49 7c b0 4f 3a 04 00 00 00 00 | X:31817 Y:20400 PRES:1082 TILT_X:000 TILT_Y:000
08 81 4a 7c b0 4f 46 04 00 00 00 00 | X:31818 Y:20400 PRES:1094 TILT_X:000 TILT_Y:000
08 81 4b 7c b0 4f 4c 04 00 00 00 00 | X:31819 Y:20400 PRES:1100 TILT_X:000 TILT_Y:000
08 81 4d 7c b0 4f 4f 04 00 00 00 00 | X:31821 Y:20400 PRES:1103 TILT_X:000 TILT_Y:000
08 81 4f 7c b0 4f 50 04 00 00 00 00 | X:31823 Y:20400 PRES:1104 TILT_X:000 TILT_Y:000
08 81 52 7c b0 4f 51 04 00 00 00 00 | X:31826 Y:20400 PRES:1105 TILT_X:000 TILT_Y:000
08 81 56 7c b0 4f 51 04 00 00 00 00 | X:31830 Y:20400 PRES:1105 TILT_X:000 TILT_Y:000
08 81 5a 7c b0 4f 52 04 00 00 00 00 | X:31834 Y:20400 PRES:1106 TILT_X:000 TILT_Y:000
08 81 5f 7c b0 4f 53 04 00 00 00 00 | X:31839 Y:20400 PRES:1107 TILT_X:000 TILT_Y:000
08 81 63 7c b0 4f 55 04 00 00 00 00 | X:31843 Y:20400 PRES:1109 TILT_X:000 TILT_Y:000
08 81 67 7c b0 4f 57 04 00 00 00 00 | X:31847 Y:20400 PRES:1111 TILT_X:000 TILT_Y:000
08 81 6b 7c b0 4f 59 04 00 00 00 00 | X:31851 Y:20400 PRES:1113 TILT_X:000 TILT_Y:000
08 81 6e 7c b0 4f 59 04 00 00 00 00 | X:31854 Y:20400 PRES:1113 TILT_X:000 TILT_Y:000
08 81 70 7c b0 4f 58 04 00 00 00 00 | X:31856 Y:20400 PRES:1112 TILT_X:000 TILT_Y:000
08 81 72 7c b0 4f 4f 04 00 00 00 00 | X:31858 Y:20400 PRES:1103 TILT_X:000 TILT_Y:000
08 81 74 7c b0 4f 33 04 00 00 00 00 | X:31860 Y:20400 PRES:1075 TILT_X:000 TILT_Y:000
08 81 76 7c b0 4f fa 03 00 00 00 00 | X:31862 Y:20400 PRES:1018 TILT_X:000 TILT_Y:000
08 81 76 7c b0 4f 91 03 00 00 00 00 | X:31862 Y:20400 PRES:0913 TILT_X:000 TILT_Y:000
08 81 76 7c b0 4f d4 02 00 00 00 00 | X:31862 Y:20400 PRES:0724 TILT_X:000 TILT_Y:000
08 81 76 7c b0 4f b6 01 00 00 00 00 | X:31862 Y:20400 PRES:0438 TILT_X:000 TILT_Y:000
08 81 76 7c b0 4f 57 00 00 00 00 00 | X:31862 Y:20400 PRES:0087 TILT_X:000 TILT_Y:000
...

Kamvas 16 pro support for config

Hi, first great thanks for such a piece of genious 😍

[tablet_kamvas_pro16]
model_name    = KAMVAS PRO 16
screen        = true
screen_width  = 1920
screen_height = 1080
pen_max_x     = 68840
pen_max_y     = 38720
pen_max_z     = 8191
resolution    = 5080
buttons       = 10
scrollbar     = 1

Could you add it to the config defaults please?

It take me a while to understand that those settings where necessary to make the tablet work...I was focused on monitor handling...Maybe you could emphasise the fact that the main thing to change in config is the tablet name :)

Map input to graphics monitor and calibrate using `xinput map-to-output`

I had difficulty calibrating my tablet via xinput_calibrator, since the calibration screen always appeared on my primary monitory instead of the graphic tablet's monitor. I wanted to confine the pen to my tablet's monitor. One solution appears to be xinput map-to-output <device> <output>. The result confines the pen and appears calibrated on my Kamvas Pro 12.

I added this functionality to the main script by adding the below function to huion-tablet-driver.py. This code may need to be touched up for generality, especially if you're using anything other than the [monitor_1] setting. It assumes your primary display comes up first in xrandr and that the graphics monitor comes up second.

This works with the automatic loader #35 by @yayfortrees, but you need to change the service Type=idle, else I believe the system tries to prematurely run xrandr before the second display is live.

XINPUT_DEVICE_KEYWORD = "Tablet Monitor Pen"

def calibrate_mapping(xinput_device_keyword=XINPUT_DEVICE_KEYWORD):

    try:
        # Locate tablet pen device number
        xinput_device = os.popen("xinput | grep '%s' | cut -f 2" % xinput_device_keyword).read()
        xinput_device = xinput_device.split('\n')[0][3:]   # chooses the first instance of keyword, strips off "id=""

        # Locate output device names
        xoutput_devices = os.popen("xrandr --listactivemonitors | sort | cut -f 6 -d ' '").read()
        xoutput_devices = list(filter(None,xoutput_devices.split('\n')))    
		# assumes the first device is the main monitor and the second is the graphics monitor

        # Calibrate by mapping input to graphics pad output
        os.system("xinput map-to-output %s %s" % (xinput_device, xoutput_devices[1]))
        print()
        sys.stdout.write("Calibrating graphics monitor via xinput mapping. . . ")
    except:
        print("Error with calibrate_mapping")

    print("Done!") 
    print("xinput_device = %s" % xinput_device)
    print("xoutput_device = %s" % xoutput_devices[1]) 
    print("xoutput_mainscreen = %s" % xoutput_devices[0]) 

where the calibrate_mapping function is added to the main() class before the finishing loop.

class main():
    """
    """
    settings = {'pen_device_name':'Tablet Monitor Pen' # must be defined here
                + strftime(" %H%M%S", gmtime())}       # for pressure to work
    dev = None
    endpoint = None
    vpen = None
    current_menu = None

    def run():	
        find_usb_device()
        read_config()
        #prepare_driver()
        setup_driver()
        calibrate()
        multi_monitor()
        calibrate_mapping()        
        main_loop()

Feedback appreciated!

Output for GT156 v2

sudo ./huion-tablet-driver.py 
Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 64 |        Params block #1: ??????
    |                          Max X: 54200
    |                          Max Y: 30480
    |                   Max pressure: 2047
    |                     Resolution: 4000
    |
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 68834
    |                          Max Y: 38710
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M174_170925
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name     GT-191
	Buttons               disabled (0)
	Scrollbar             disabled (0)
	Desktop notifications ENABLED
	Multi Monitor Setup   disabled

Huion Kamvas driver should now be running

GT-191 reported as Tablet model name is from me changing around in the config.ini.

Huion Kanvas 16 Pro - Calibration values

I did play around with calibrating my tablet yesterday. I came up with slightly different values. Maybe they help you, too. I'm not sure if this is just my setup.

[tablet_gt156v2]
model_name    = GT-156 v2
screen        = true
screen_width  = 1920 
screen_height = 1080 
# pen_max_x     = 68834
pen_max_x     = 68665
# pen_max_y     = 38720
pen_max_y     = 38650
pen_max_z     = 8191
# resolution    = 5080
resolution    = 5050
buttons       = 14  
scrollbar     = 1   

Multi Monitor

Opening this issue due to the drivers not working with multi monitor anymore, they used to before but now I just can't.

The drivers still work if I only use 1 monitor.

Otherwise if enable_multi_monitor = true I get the following:

> [chu@nest huion-linux-drivers]$ sudo python3 huion-tablet-driver.py
> Finding USB device. . . Done!
> Reading configuration. . . Done!
> Preparing driver. . . Done!
> --------------------------------------------------------------------------------
>  c8 |        Params block #2: ????????
>     |                          Max X: 86970
>     |                          Max Y: 47752
>     |                   Max pressure: 8191
>     |                     Resolution: 5080
>     |
>  c9 |       Firmware version: HUION_M168_171103
>  ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
> --------------------------------------------------------------------------------
> Setting up driver. . . Done!
> 	Tablet model name         GT-191
> 	Buttons                   disabled (0)
> 	Scrollbar                 disabled (0)
> 	Notifications:            ENABLED
> 		for buttons       ENABLED
> 		for scrollbar     disabled
> 	Screen                    Enabled (1920x1080)
> 	Current Monitor Setup     [monitor_2]
> 	Multi Monitor Setup       ENABLED
> 	Calling xrandr            disabled
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 			< DEBUG MODE ENABLED >
> Enabled by default. You can disable it by setting debug_mode = false
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> SYSTEM: Linux 5.2.14-arch2-1-ARCH (x86_64 )
> #1 SMP PREEMPT Thu Sep 12 10:42:38 UTC 2019
> 
> DEVICE: /dev/input/event13 (py-evdev-uinput)
> bus: 0003, vendor 0001, product 0001, version 0003
> 
>       ENDPOINT 0x81: Interrupt IN ==========================
>        bLength          :    0x7 (7 bytes)
>        bDescriptorType  :    0x5 Endpoint
>        bEndpointAddress :   0x81 IN
>        bmAttributes     :    0x3 Interrupt
>        wMaxPacketSize   :   0x40 (64 bytes)
>        bInterval        :    0x2
> 
> TABLET CAPABILITIES:
> [('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3), ('?', 21)]
> [(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
> [(('ABS_X', 0), AbsInfo(value=0, min=0, max=86970, fuzz=0, flat=0, resolution=5080)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=47752, fuzz=0, flat=0, resolution=5080)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=8191, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]
> VPEN:
> name "Tablet Monitor Pen 004707", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
> event types: EV_SYN EV_KEY EV_ABS
> 
> Setting up multiple monitors. . .
> Running xinput. . .
> » xinput set-prop "Tablet Monitor Pen 004707" --type=float "Coordinate Transformation Matrix" 0.6521739130434783 0 0.34782608695652173 0 1.0 0.0 0 0 1
> X Error of failed request:  BadMatch (invalid parameter attributes)
>   Major opcode of failed request:  131 (XInputExtension)
>   Minor opcode of failed request:  57 ()
>   Serial number of failed request:  20
>   Current serial number in output stream:  21
> ERROR running the following comand:
> 	xinput set-prop "Tablet Monitor Pen 004707" --type=float "Coordinate Transformation Matrix" 0.6521739130434783 0 0.34782608695652173 0 1.0 0.0 0 0 1
> RETURN CODE: 1

Script disables tablet

System Information

Tablet: HUION H420
Monitors: HDMI-0 FullHD & DVI-D-0 FullHD which are arranged
Kernel: 4.12.14-lp151.28.16-default

Symptoms

  • My tablet is H420, which is not supported yet.
  • Script has disabled my tablet completely
  • Same problem as #40 .

I have:

  • installed all dependencies as it said in README
  • added extra code to Xorg
  • changed config.ini up to my system

There's output of xinput before running script, script output and xinput output after script fails.

chertila@openSUSE-PC ~/sources/huion-linux-drivers-master $ xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ COMPANY  USB Device                       id=15   [slave  pointer  (2)]
⎜   ↳ COMPANY  USB Device                       id=16   [slave  pointer  (2)]
⎜   ↳ COMPANY USB Device                        id=19   [slave  pointer  (2)]
⎜   ↳ COMPANY USB Device                        id=20   [slave  pointer  (2)]
⎜   ↳ HUION H420 Consumer Control               id=10   [slave  pointer  (2)]
⎜   ↳ HUION H420 Pen                            id=12   [slave  pointer  (2)]
⎜   ↳ HUION H420 Pad                            id=13   [slave  pointer  (2)]
⎜   ↳ HUION H420 Mouse                          id=22   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ COMPANY  USB Device                       id=14   [slave  keyboard (3)]
    ↳ UVC Camera (046d:0804)                    id=17   [slave  keyboard (3)]
    ↳ COMPANY USB Device                        id=18   [slave  keyboard (3)]
    ↳ Eee PC WMI hotkeys                        id=21   [slave  keyboard (3)]
    ↳ COMPANY  USB Device                       id=23   [slave  keyboard (3)]
    ↳ COMPANY USB Device                        id=24   [slave  keyboard (3)]
    ↳ HUION H420 System Control                 id=8    [slave  keyboard (3)]
    ↳ HUION H420 Keyboard                       id=9    [slave  keyboard (3)]
    ↳ HUION H420 Consumer Control               id=11   [slave  keyboard (3)]
chertila@openSUSE-PC ~/sources/huion-linux-drivers-master $ sudo ./huion-tablet-driver.py 
Finding USB device. . . Done!
grabbed interface %d 0
grabbed interface %d 1
grabbed interface %d 2
Reading configuration. . . Done!
Setting up driver. . . Done!
        Tablet model name         DEBUG TABLET
        Buttons                   disabled (0)
        Scrollbar                 disabled (0)
        Notifications             disabled
        Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        < DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 4.12.14-lp151.28.16-default (x86_64 x86_64)
#1 SMP Wed Sep 18 05:32:19 UTC 2019 (3e458e0)

DEVICE: /dev/input/event0 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :    0x8 (8 bytes)
       bInterval        :    0x4

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3), ('?', 21)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]

VPEN:
name "Tablet Monitor Pen 004437", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

XINPUT:
Unable to connect to X server
ERROR running the following comand:
        xinput list --short | grep "Tablet Monitor Pen"
RETURN CODE: 1
chertila@openSUSE-PC ~/sources/huion-linux-drivers-master $ xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ COMPANY  USB Device                       id=15   [slave  pointer  (2)]
⎜   ↳ COMPANY  USB Device                       id=16   [slave  pointer  (2)]
⎜   ↳ COMPANY USB Device                        id=19   [slave  pointer  (2)]
⎜   ↳ COMPANY USB Device                        id=20   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ COMPANY  USB Device                       id=14   [slave  keyboard (3)]
    ↳ UVC Camera (046d:0804)                    id=17   [slave  keyboard (3)]
    ↳ COMPANY USB Device                        id=18   [slave  keyboard (3)]
    ↳ Eee PC WMI hotkeys                        id=21   [slave  keyboard (3)]
    ↳ COMPANY  USB Device                       id=23   [slave  keyboard (3)]
    ↳ COMPANY USB Device                        id=24   [slave  keyboard (3)]

Huion HS64 doesnt work

Finding USB device. . . Done!
Reading configuration. . . Done!
Setting up driver. . . Done!
        Tablet model name         DEBUG TABLET
        Buttons                   disabled (0)
        Scrollbar                 disabled (0)
        Notifications:            ENABLED
                for buttons       ENABLED
                for scrollbar     disabled
        Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        < DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 5.0.0-37-generic (x86_64 x86_64)
#40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019

DEVICE: /dev/input/event21 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]

VPEN:
name "Tablet Monitor Pen 153024", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

XINPUT:
ERROR running the following comand:
        xinput list --short | grep "Tablet Monitor Pen"
RETURN CODE: 1

that is my [tablet_debug] output

Automatic driver loading/unloading

I was able to setup automatic driver loading/unloading with udev and systemd. It required some minor changes to the code (exit on disconnect), so I'm opening this issue for those changes and adding details on how to setup udev/systemd in case anyone else wants to.

Create a systemd service file for the driver:

/etc/systemd/system/huion-driver.service

[Unit]
Description=Huion Tablet Driver

[Service]
Type=simple
Environment=DISPLAY=:1
Environment=XAUTHORITY=/run/user/1000/gdm/Xauthority
WorkingDirectory=/opt/huion-linux-drivers/
ExecStart=/usr/bin/python3 huion-tablet-driver.py

Replace the DISPLAY and XAUTHORITY variables with ones for your system. Set the WorkingDirectory to the location with the driver files.

Run systemctl daemon-reload to make the change effective.

Next create a udev rule to start the service:

/etc/udev/rules.d/99-huion.rules

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idProduct}=="006e", ATTRS{idVendor}=="256c", RUN+="/usr/bin/systemctl --no-block start huion-driver.service"

Change the product and vendor IDs to match your device. They can be found with lsusb.
Make sure the path to systemctl is correct, it may be in /bin on your system, use which systemctl to find out.

Run udevadm control --reload to make the change effective.

I initially tried having udev start and stop the service on removal, but the driver triggers a removal of the usb device during initialization, udev would then stop the service before it got rolling. I modified the driver code to exit on USB disconnect so I wouldn't have to have udev do it, and it works great.

I'll attach a pull request for the changes, if I can figure this out. ;)

Thanks, the driver is working great!

No need to build uclogic, it's available as package.

That was the good news, the bad news is:
Debian10 Buster "uclogic-tools.deb" installs "uclogic-probe" and "uclogic-decode" in /usr/bin/, so not in /us/local/bin/ as set in config.ini.
It will need to be found now.

H610 Pro

Thank you for this work, which will be very useful to me.
I don't see the H610Pro in the config file. I'm thinking buying it.

Thank you again.

Support for GT-156HD V2

Hi @joseluis, thank you for the hard work you have put into this repository.

The tablet model I am attempting to run is GT-156HD V2 and attached below is the console output that appears just after executing the driver.

--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 64 |        Params block #1: ??????
    |                          Max X: 54200
    |                          Max Y: 30480
    |                   Max pressure: 2047
    |                     Resolution: 4000
    |
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 68834
    |                          Max Y: 38710
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M174_170925
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------

After installing the dependencies and running sudo ./huion-tablet-driver.py, the tablet model is detected to be GT-221 Pro. The tablet pen is unable to move the cursor on the tablet monitor but the pressure input seems to be working. In other words, I can select with the tablet pen but I cannot move the cursor at all. Same issue as #1.

Please help.

Feel free to ask if you require more information. Thank you.

Kamvas Pro 16: Tilt does not work in applications

2: Tilt is doesn't work in applications

Driver debug reports tilt functioning

...
08 00 d1 06 af 05 00 00 00 00 10 fd | X:01745 Y:01455 PRES:0000 TILT_X:016 TILT_Y:-253
...
08 00 cb bc 9e 4c 00 00 00 00 2b 0b | X:48331 Y:19614 PRES:0000 TILT_X:043 TILT_Y:-11
...
08 00 48 b5 c5 5d 00 00 00 00 2d 1d | X:46408 Y:24005 PRES:0000 TILT_X:045 TILT_Y:-29
...
08 00 96 ae 79 3f 00 00 00 00 08 db | X:44694 Y:16249 PRES:0000 TILT_X:008 TILT_Y:-219
...
08 00 99 b4 5c 3f 00 00 00 00 04 da | X:46233 Y:16220 PRES:0000 TILT_X:004 TILT_Y:-218
...
08 00 83 bc 55 5c 00 00 00 00 30 05 | X:48259 Y:23637 PRES:0000 TILT_X:048 TILT_Y:-05
...
08 00 40 ce 18 31 00 00 00 00 f9 d0 | X:52800 Y:12568 PRES:0000 TILT_X:249 TILT_Y:-208
...
08 00 f1 c6 7f 43 00 00 00 00 2d 01 | X:50929 Y:17279 PRES:0000 TILT_X:045 TILT_Y:-01
...
08 00 12 cb b2 3f 00 00 00 00 22 f3 | X:51986 Y:16306 PRES:0000 TILT_X:034 TILT_Y:-243
...
08 00 22 cf 22 44 00 00 00 00 26 f5 | X:53026 Y:17442 PRES:0000 TILT_X:038 TILT_Y:-245
...
08 00 d7 de be 3f 00 00 00 00 f5 dd | X:57047 Y:16318 PRES:0000 TILT_X:245 TILT_Y:-221
...
08 00 60 ce 1f 64 00 00 00 00 0f 10 | X:52832 Y:25631 PRES:0000 TILT_X:015 TILT_Y:-16
...
08 00 80 cb 65 5b 00 00 00 00 2e 0d | X:52096 Y:23397 PRES:0000 TILT_X:046 TILT_Y:-13
...
08 00 f7 cb 92 52 00 00 00 00 32 02 | X:52215 Y:21138 PRES:0000 TILT_X:050 TILT_Y:-02
...
08 00 20 e0 25 44 00 00 00 00 f4 e0 | X:57376 Y:17445 PRES:0000 TILT_X:244 TILT_Y:-224

But in applications like krita and gimp, tilt brush functionality doesn't work.

5.0.0-29-generic #31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Seems to happens with all configs, but here's the current wip: https://gist.github.com/floopfloopfloopfloopfloop/3bf329e1bdfedcbc4e16c2c8d1d0b907

Inspiroy H320M

Hi, trying to get the Inspiroy H320M to work on Ubuntu. Here is the output I get when running the script in debug mode. Can you advise on next steps? I am not getting asked to touch corners as readme suggests. Thanks.

Finding USB device. . . Done!
grabbed interface %d 0
grabbed interface %d 1
Reading configuration. . . Done!
Setting up driver. . . Done!
	Tablet model name         Unnamed Tablet
	Buttons                   disabled (0)
	Scrollbar                 disabled (0)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 4.15.0-72-generic (x86_64 x86_64)
#81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019

DEVICE: /dev/input/event16 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]

VPEN:
name "Tablet Monitor Pen 111615", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

XINPUT:
⎜   ↳ Tablet Monitor Pen 111615               	id=14	[slave  pointer  (2)]

Huion Kamvas driver should now be running. . .```

No response for H610Pro

I've used tablet_debug as current tablet on Ubuntu 18.04.2 LTS.
Last line from output was "Please slowly and briefly touch the LEFT UP corner of your tablet:"
Did that and nothing was printed. Tablet itself responds to pen by green light. Kindly find output below
Output:

Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
 c8 |        Params block #2: ??|?????
    |                          Max X: 50800
    |                          Max Y: 31750
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_T175_170520
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name         DEBUG TABLET
	Buttons                   disabled (0)
	Scrollbar                 disabled (0)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 4.15.0-47-generic (x86_64 x86_64)
#50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019

DEVICE: /dev/input/event10 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x10 (16 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]
VPEN:
name "Tablet Monitor Pen 110558", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

Huion Kamvas driver should now be running. . .

(Input from the tablet will ONLY be used to print it out)

Please slowly and briefly touch the LEFT UP corner of your tablet:

Pen positioning changing when tilting the pen

The cursors position on the screen changes when the pen is tilted. Luckily I was able to find a solution. The values that I have used for '''pen_sensor_length''' works for my specific pen and tablet: Huion Kamvas Pro 13, linux sees it as GT-133.

# compensate positions with tilt
pen_sensor_length = 100
if(TILT_X > 100):
    pen_sensor_length = 300
    X = X + int(pen_sensor_length*atan(TILT_X*1.40625))
else: 
    X = X - int(pen_sensor_length*atan(TILT_X*1.40625))
if(abs(TILT_Y) > 100):
    pen_sensor_length = 50
    Y = Y - int(pen_sensor_length*atan(abs(TILT_Y*1.40625)))
else: 
    pen_sensor_length = 50
    Y = Y + int(pen_sensor_length*atan(abs(TILT_Y*1.40625)))

This is not the best solution, as it needs to be implemented to work for all tablets, but the math is there and it works almost perfectly. I used 1.40625 as a multiplier as the tilt goes from 0 to 255, but degrees are from 1 to 360, so i had to bind 1 tilt to 1.40625 degrees. The pen_sensor_length are arbitrary, and every single tablet will be needed to be calibrated by hand.

Kamvas Pro 13

Hello, I have recently got a Huion Kamvas Pro 13 and I've been looking everywhere for something that works for configuring buttons. But still there is nothing, I got the pen to work with the screen but that's about it.

This looks really promising! Although It Did not work with the Kamvas 13. I saw that I should post this in the issues section for a module. Really looking for help, everything appreciated! ;)

(running Linux mint 19)

--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 58752
    |                          Max Y: 33048
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |      Unknown string #1: HUION_M182_180725
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------

Driver should not require sudo

The driver should not require being run with sudo. Instead, README should include instructions to set up udev rules (e.g. creating /etc/udev/rules.d/99-huion-tablet.rules that sets mode = 0664 to a specific group, e.g. plugdev or dialout).

I would create a pull request, but I'm not very familiar with the udev syntax. My rule:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="dialout"

gives write access to USB devices period. I think something like
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0664", GROUP="dialout"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006e", MODE="0664", GROUP="dialout"
might work.

Kamvas Pro 16: Enabling on-tablet buttons hangs the driver

wip config: https://gist.github.com/floopfloopfloopfloopfloop/3bf329e1bdfedcbc4e16c2c8d1d0b907

output:

$ sudo ./huion-tablet-driver.py 
Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
 c8 |        Params block #2: ????????
    |                          Max X: 68840
    |                          Max Y: 38720
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M183_190806
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
        Tablet model name         KAMVAS PRO 16
        Buttons                   ENABLED (7)
        Scrollbar                 ENABLED (1)
        Notifications:            ENABLED
                for buttons       ENABLED
                for scrollbar     ENABLED
        Screen                    Enabled (1920x1080)
        Current Monitor Setup     [monitor_2]
        Multi Monitor Setup       ENABLED
        Calling xrandr            ENABLED

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        < DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 5.0.0-29-generic (x86_64 x86_64)
#31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019

DEVICE: /dev/input/event15 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=68840, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=38720, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=8191, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]
VPEN:
name "Tablet Monitor Pen 194525", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS
Calibrating. . . Done!

Setting up multiple monitors. . . 
Running xrandr. . . 
» xrandr --output HDMI-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-4 --mode 1920x1080 --pos 1920x0 --rotate normal
Running xinput. . . 
» xinput set-prop "Tablet Monitor Pen 194525" --type=float "Coordinate Transformation Matrix" 0.5 0 0.0 0 1.0 0.0 0 0 1
Mapped tablet area to "1920x1080 + 0x0"

Huion Kamvas driver should now be running. . .

(Input from the tablet will be printed out)

[menu_simple_7b]
button 0 = key Tab           # hide interface
button 1 = key ctrl+c        # copy
button 2 = key ctrl+v        # paste
button 3 = key ctrl+z        # undo
button 4 = key ctrl+y        # redo (gimp)
button 5 = key ctrl+shift+z  # redo (krita)
button 6 = key e             # toggle eraser (krita)

tablet is non-responsive to all input from this point forward

commenting out start_menu = [...] section makes tablet responsive to pen input + pen buttons.

Could it be possible to add support to GT-190?

What would be required in order to add support to this tablet? I've tried using debug mode but all I get is:

Error, Could not find device, maybe already opened?
Finding USB device. . .

Huion gt191 missing tablet capabilities: resolution.

Hello

We have an HUION GT-191 that is not working.

We try to use it on Debian buster, below have I listed some output.
It seems that the input driver is missing tablet capabilities: resolution.
Any idea how debug it or make it working?

lsub:

lsusb -v -d  256c:006e

Bus 002 Device 009: ID 256c:006e  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x256c 
  idProduct          0x006e 
  bcdDevice            0.00
  iManufacturer           5 (error)
  iProduct                6 (error)
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              480mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      18
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               2
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      83
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               2

xinput -list

⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SONiX USB Device Mouse                  	id=10	[slave  pointer  (2)]
⎜   ↳ Telink Wireless Receiver Mouse          	id=13	[slave  pointer  (2)]
⎜   ↳ Telink Wireless Receiver Consumer Control	id=14	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ↳ UVC Camera (046d:0808)                  	id=8	[slave  keyboard (3)]
    ↳ SONiX USB Device                        	id=9	[slave  keyboard (3)]
    ↳ SONiX USB Device System Control         	id=11	[slave  keyboard (3)]
    ↳ Telink Wireless Receiver                	id=12	[slave  keyboard (3)]
    ↳ Telink Wireless Receiver System Control 	id=15	[slave  keyboard (3)]
    ↳ Eee PC WMI hotkeys                      	id=16	[slave  keyboard (3)]
    ↳ Telink Wireless Receiver Consumer Control	id=17	[slave  keyboard (3)]

And then xorg log file:

[    50.704] (II) config/udev: Adding input device Tablet Monitor Pen 172738 (/dev/input/event23)
[    50.704] (**) Tablet Monitor Pen 172738: Applying InputClass "evdev tablet catchall"
[    50.704] (**) Tablet Monitor Pen 172738: Applying InputClass "libinput tablet catchall"
[    50.704] (II) Using input driver 'libinput' for 'Tablet Monitor Pen 172738'
[    50.704] (**) Tablet Monitor Pen 172738: always reports core events
[    50.705] (**) Option "Device" "/dev/input/event23"
[    50.705] (**) Option "_source" "server/udev"
[    50.706] (II) event23 - Tablet Monitor Pen 172738: is tagged by udev as: Tablet
[    50.706] (EE) event23 - Tablet Monitor Pen 172738: libinput bug: missing tablet capabilities: resolution. Ignoring this device.
[    50.706] (II) event23 - Tablet Monitor Pen 172738: device is a tablet
[    50.739] (II) event23 - failed to create input device '/dev/input/event23'.
[    50.739] (EE) libinput: Tablet Monitor Pen 172738: Failed to create a device for /dev/input/event23
[    50.739] (EE) PreInit returned 2 for "Tablet Monitor Pen 172738"
[    50.739] (II) UnloadModule: "libinput"

HUION GT190

I got the Huion GT190 almost working. I would like some guidance on how obtain the different parameters:

[tablet_gt190]
model_name    = GT-190
screen        = true
screen_width  = 1400
screen_height = 900
pen_max_x     = 86970
pen_max_y     = 47752
pen_max_z     = 8191
resolution    = 5080

The width and height I could easily change, but what are pen_max_x and in what units and how can I figure out that value? Same thing with y,z and resolution.

Apart from that the tablet seems to be working, but only for the X axis (any idea what could be making the pen to react to the X axis but not the Y axis, could it just be the wrong pen_max_y numbers?

Thank you for the guidance and support!

Wayland support

Hi!

I would love to use this in wayland. I'm down to help and contribute. Did you have any though on this?

I guess that xrand won't be an option in wayland.

DWH69

Product: PenTablet
Params block #1: ?????
Max X: 36000
Max Y: 22500
Max pressure: 2047
Resolution: 4000
79 Internal model: HA60-F400
7b Buttons status: HK On

GT-221 Pro - Tablet does not respond to input.

Hello!

Just for quick reference: I'm running KDE neon 5.14 with the x86_64 Linux 4.15.0-39-generic kernel and am attempting to get my GT-221 Pro working under it. I am by no means an expert and, in fact, have very little experience with this sort of thing as I've only recently begun trying to use linux to get away from Windows.

I've been struggling to get my GT-221 Pro working under linux and I've exhausted just about everything I could try. Basically no matter how I set up my config.ini it either spits out an error (because I think I'm setting the monitor setup wrong for multi-monitor) or it runs, but I can't get the tablet to respond to either pen input or by pressing any buttons. Also, yes, I have all my dependencies installed and yes, I added the /etc/X11/xorg.conf.d/evdev-tablet.conf

FYI: When I try to use one of the pre-made monitor configurations (or even not bother with multi-monitor at all and only have the tablet plugged in), the driver 'works' but the tablet still refuses to notice the pen or when I press any buttons.

Anyway. I'll attach the full config.ini but here's the part I wrote myself.


[monitor_4]
# 2 monitors arranged vertically with the tablet being the lower one.

screen_1W = 1920
screen_1H = 1080
screen_2W = 1920
screen_2H = 1080

total_screen_width   = ${screen_1W}
total_screen_height  = ${screen_1H} + ${screen_2H}
tablet_offset_x      = 0
tablet_offset_y      = {screen_1H}

xrandr_output1 = --output HDMI-A-0 --primary --mode 1920x1080 --pos 0x1080 --rotate normal
xrandr_output22 = --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rotate normal
xrandr_args = ${xrandr_output1} ${xrandr_output2}

Here's the information for my monitors that I got from arandr:

#!/bin/sh
xrandr --output DisplayPort-0 --off --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-1 --off --output HDMI-A-0 --primary --mode 1920x1080 --pos 0x1080 --rotate normal

Here's the output I get when I try to use [monitor_4]:

den@Ignition2:~/huion-linux-drivers$ sudo ./huion-tablet-driver.py
Finding USB device. . . Done!
Reading configuration. . . Traceback (most recent call last):
  File "./huion-tablet-driver.py", line 476, in <module>
    main.run()
  File "./huion-tablet-driver.py", line 27, in run
    read_config()
  File "./huion-tablet-driver.py", line 419, in read_config
    'xrandr_args').split("#",1)[0].strip()
  File "/usr/lib/python3.6/configparser.py", line 800, in get
    d)
  File "/usr/lib/python3.6/configparser.py", line 455, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib/python3.6/configparser.py", line 507, in _interpolate_some
    option, section, rawval, ":".join(path)) from None
configparser.InterpolationMissingOptionError: Bad value substitution: option 'xrandr_args' in section 'monitor_2' contains an interpolation key 'xrandr_output2' which is not a valid option name. Raw value: '${xrandr_output1} ${xrandr_output2}'

And here's the output when the driver successfully runs (either from not using multimonitor or by using one of the pre-made configurations.)


den@Ignition2:~/huion-linux-drivers$ sudo ./huion-tablet-driver.py 
Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 64 |        Params block #1: ??????
    |                          Max X: 37540
    |                          Max Y: 21120
    |                   Max pressure: 8191
    |                     Resolution: 2000
    |
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 95352
    |                          Max Y: 53645
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M167_170623
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
        Tablet model name     GT-221 PRO
        Buttons               ENABLED (10)
        Scrollbar             ENABLED (1)
        Desktop notifications ENABLED
        Multi Monitor Setup   disabled

Huion Kamvas driver should now be running

% Main Menu %
button 0 = [menu_krita]
button 1 = [menu_gimp]
button 2 = [menu_darktable]
button 3 = 
button 4 = 
button 5 = 
button 6 = 
button 7 = 
button 8 = key Return
button 9 = key Escape

Thanks for any help you can provide.

I'd like to note that using https://github.com/joseluis/HuionKamvasGT221PROLinuxDriver works, but I get no pen pressure.

arandr_output.txt
config.txt

Failure to start in ubuntu 19.04

Hi!

I had the driver working wonderfully in Ubuntu 18.10. Once I updated to 19.04 it stoped working with this Error:

Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
Setting up driver. . . Done!
	Tablet model name         GT-191
	Buttons                   disabled (0)
	Scrollbar                 disabled (0)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    Enabled (1920x1080)
	Current Monitor Setup     [monitor_3]
	Multi Monitor Setup       ENABLED
	Calling xrandr            ENABLED

Setting up multiple monitors. . . 
Running xrandr. . . 
Traceback (most recent call last):
  File "./huion-tablet-driver.py", line 743, in <module>
    main.run()
  File "./huion-tablet-driver.py", line 33, in run
    multi_monitor()
  File "./huion-tablet-driver.py", line 223, in multi_monitor
    cmd='xrandr {}'.format(main.settings['xrandr_args'])
KeyError: 'xrandr_args'

I traced back the error to the line 663:
main.settings['total_screen_width'] = ast.literal_eval(config.get(current_monitor_setup, 'total_screen_width').split("#",1)[0].strip())

I tested a bit and seems that ast.literal_eval fails to eval the string "2560 + 2560 + 1920". I researched a bit and seems that literal_eval shouln't eval expressions bit it was doing it because of compatibility reasons. (https://stackoverflow.com/questions/40584417/why-does-ast-literal-eval5-7-fail)

I changed it to a normal (and more dangerous) eval and it works now. I wond't suggest to use eval in a driver that runs with sudo, but maybe you can find another way to make the maths there. I'm not an expert in python.

HUION 1060PRO+ parameters

Hello Jose Luis, firts of all very thanks for your help making this huion drivers, now the output in the console was this:

--------------------------------------------------------------------------------
    |           Manufacturer: HUION???
    |                Product: PenTablet?
 64 |        Params block #1: ??????
    |                          Max X: 40000
    |                          Max Y: 25000
    |                   Max pressure: 2047
    |                     Resolution: 4000
    |
 79 |         Internal model: HA60?????
 7b |         Buttons status: HK On
 c8 |        Params block #2: HVAN?
    |                          Max X: 5636168
    |                          Max Y: 16640
    |                   Max pressure: 78
    |                     Resolution: 0
    |
 c9 |      Unknown string #1: HVAN?
 ca |  Internal manufacturer: HVAN?
--------------------------------------------------------------------------------

Kamvas Pro 16: [tablet_debug] config does not complete

$ sudo ./huion-tablet-driver.py 
[sudo] password for [redacted]: 
Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
 c8 |        Params block #2: ????????
    |                          Max X: 68840
    |                          Max Y: 38720
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M183_190806
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
        Tablet model name         DEBUG TABLET
        Buttons                   disabled (0)
        Scrollbar                 disabled (0)
        Notifications:            ENABLED
                for buttons       ENABLED
                for scrollbar     ENABLED
        Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        < DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 5.0.0-29-generic (x86_64 x86_64)
#31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019

DEVICE: /dev/input/event15 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]
VPEN:
name "Tablet Monitor Pen 192413", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS
Calibrating. . . Done!

Huion Kamvas driver should now be running. . .

(Input from the tablet will ONLY be used to print it out)

Please slowly and briefly touch the LEFT UP corner of your tablet:
...
08 81 00 00 3d 01 39 01 00 00 1f f5 | X:00000 Y:00317 PRES:0313 TILT_X:031 TILT_Y:-245
08 81 00 00 45 01 04 03 00 00 1f f5 | X:00000 Y:00325 PRES:0772 TILT_X:031 TILT_Y:-245
08 81 00 00 4b 01 02 05 00 00 1f f5 | X:00000 Y:00331 PRES:1282 TILT_X:031 TILT_Y:-245
08 81 00 00 4f 01 2e 07 00 00 1f f5 | X:00000 Y:00335 PRES:1838 TILT_X:031 TILT_Y:-245
08 81 00 00 52 01 9e 08 00 00 1f f5 | X:00000 Y:00338 PRES:2206 TILT_X:031 TILT_Y:-245
08 81 00 00 55 01 a3 09 00 00 1f f5 | X:00000 Y:00341 PRES:2467 TILT_X:031 TILT_Y:-245
08 81 00 00 57 01 7d 0a 00 00 1f f5 | X:00000 Y:00343 PRES:2685 TILT_X:031 TILT_Y:-245
[...snip...]

No other corners are requested to be touched.

gt191 v2 detected as gt22 pro

Thanx Jose Luis.

All is working fine. I only wanted to report, in case others have same issue. That my gt191 v2 was detected as a gt221 pro.

All I had to do was to tweak the config.ini so that the pen_max_x, y, z in the gt220 pro section match the ones for gt191. Once I ddi that no shift observed whatsoever.

Also had to tweak the folder for uclogic tools to "/usr/bin". This is where the uclogic deb installs them at least.

Otherwise, plain sailing.

Support for Huion-h1161

Hello, I am using a Huion-H1611. It is not in the list and this is the stack-trace I've received. Thanks in advance.

Finding USB device. . . Done!
grabbed interface %d 0
grabbed interface %d 1
Reading configuration. . . Done!
Setting up driver. . . Done!
	Tablet model name         DEBUG TABLET
	Buttons                   disabled (0)
	Scrollbar                 disabled (0)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 4.15.0-72-generic (x86_64 x86_64)
#81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019

DEVICE: /dev/input/event6 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3), ('?', 21)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]

VPEN:
name "Tablet Monitor Pen 183507", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

XINPUT:
ERROR running the following comand:
	xinput list --short | grep "Tablet Monitor Pen"
RETURN CODE: 1

GT-220 v2 - Cursor does not respond to input

Hi!

Thanks for all the work. I am on ubuntu 16.04 and I have a Huion GT-220 v2. I followed all the instructions carefully. When I launch the driver all seem to work except that the pen does not make the mouse move at all. The click seem to work though. I ran the debug script and here is my output:

Finding USB device. . . Done!
Reading configuration. . . Done!
Preparing driver. . . Done!
--------------------------------------------------------------------------------
    |                Product: Tablet Monitor
 64 |        Params block #1: ??????
    |                          Max X: 37540
    |                          Max Y: 21120
    |                   Max pressure: 8191
    |                     Resolution: 2000
    |
 79 |         Internal model: 
 7b |         Buttons status: HK On
 c8 |        Params block #2: ????????
    |                          Max X: 95352
    |                          Max Y: 53645
    |                   Max pressure: 8191
    |                     Resolution: 5080
    |
 c9 |       Firmware version: HUION_M165_170518
 ca |  Internal manufacturer: HUION Animation Technology Co.,ltd
--------------------------------------------------------------------------------
Setting up driver. . . Done!
	Tablet model name         GT-220 v2
	Buttons                   disabled (0)
	Scrollbar                 disabled (0)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     disabled
	Screen                    Enabled (1920x1080)
	Current Monitor Setup     [monitor_3]
	Multi Monitor Setup       ENABLED
	Calling xrandr            ENABLED

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 4.16.3-041603-generic (x86_64 x86_64)
#201804190730 SMP Thu Apr 19 07:32:02 UTC 2018

DEVICE: /dev/input/event31 ()
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=95352, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=53645, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=8191, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=0, fuzz=255, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=0, fuzz=255, flat=0, resolution=0))]
VPEN:
name "Tablet Monitor Pen 135001", bus "BUS_USB", vendor "0001", product "0001", version "0003"
event types: EV_SYN EV_KEY EV_ABS

Setting up multiple monitors. . . 
Running xrandr. . . 
» xrandr --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-6 --mode 3840x2160 --pos 1920x0 --rotate normal --output DP-0 --mode 3840x2160 --pos 5760x0 --rotate left
Running xinput. . . 
» xinput set-prop "Tablet Monitor Pen 135001" --type=float "Coordinate Transformation Matrix" 0.2 0 0.0 0 1.0 0.0 0 0 1
Mapped tablet area to "1920x1080 + 0x0"

Huion Kamvas driver should now be running. . .

(Input from the tablet will be printed out)

08 81 d9 14 ab 79 66 01 01 00 00 00 | X:70873 Y:31147 PRES:0358 TILT_X:000 TILT_Y:000
08 81 80 14 9a 79 65 01 01 00 00 00 | X:70784 Y:31130 PRES:0357 TILT_X:000 TILT_Y:000
08 81 50 14 9e 79 67 01 01 00 00 00 | X:70736 Y:31134 PRES:0359 TILT_X:000 TILT_Y:000
08 81 1e 14 a1 79 65 01 01 00 00 00 | X:70686 Y:31137 PRES:0357 TILT_X:000 TILT_Y:000
08 81 ba 13 a5 79 65 01 01 00 00 00 | X:70586 Y:31141 PRES:0357 TILT_X:000 TILT_Y:000
08 81 4c 13 a2 79 67 01 01 00 00 00 | X:70476 Y:31138 PRES:0359 TILT_X:000 TILT_Y:000
08 81 d6 12 98 79 67 01 01 00 00 00 | X:70358 Y:31128 PRES:0359 TILT_X:000 TILT_Y:000
08 81 57 12 89 79 67 01 01 00 00 00 | X:70231 Y:31113 PRES:0359 TILT_X:000 TILT_Y:000
08 81 ce 11 74 79 67 01 01 00 00 00 | X:70094 Y:31092 PRES:0359 TILT_X:000 TILT_Y:000
08 81 46 11 59 79 69 01 01 00 00 00 | X:69958 Y:31065 PRES:0361 TILT_X:000 TILT_Y:000
08 81 bf 10 3b 79 6a 01 01 00 00 00 | X:69823 Y:31035 PRES:0362 TILT_X:000 TILT_Y:000
08 81 3e 10 19 79 6c 01 01 00 00 00 | X:69694 Y:31001 PRES:0364 TILT_X:000 TILT_Y:000
08 81 c7 0f f4 78 6d 01 01 00 00 00 | X:69575 Y:30964 PRES:0365 TILT_X:000 TILT_Y:000
08 81 74 0f dd 78 6f 01 01 00 00 00 | X:69492 Y:30941 PRES:0367 TILT_X:000 TILT_Y:000

Also I need to mention that I had to create the xorg.conf.d folder in /etc/X11/.
My configuration is with 3 screens although I tried only with the Huion as main screen and had the same result.

Thanks for your help!

[Help] Huion GT-133 / Kamvas pro 13 with Debian Buster

Hello, i'm a noob in this domain, so maybe i forget do do something...

Installed prequisites: ok

sudo apt install xinput xserver-xorg-input-evdev python3-evdev python3-usb \
> xdotool libnotify-bin arandr python3-numexpr
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
arandr est déjà la version la plus récente (0.1.9-2).
libnotify-bin est déjà la version la plus récente (0.7.7-4).
python3-numexpr est déjà la version la plus récente (2.6.9-1).
python3-evdev est déjà la version la plus récente (1.1.2+dfsg-1+b10).
python3-usb est déjà la version la plus récente (1.0.2-1).
xdotool est déjà la version la plus récente (1:3.20160805.1-4).
xinput est déjà la version la plus récente (1.6.2-1+b1).
xserver-xorg-input-evdev est déjà la version la plus récente (1:2.10.6-1).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.

And /etc/X11/xorg.conf.d/evdev-tablet.conf set too.

Configuration: laptop running Debian 10 (Xorg not wayland), screen eDP-1 1920x1080,
Device: Huion GT-133, I tried to set it in config, but nothing happened, so I tried debug tablet :

Finding USB device. . . Done!
grabbed interface %d 0
grabbed interface %d 1
Reading configuration. . . Done!
Setting up driver. . . Done!
	Tablet model name         DEBUG TABLET
	Buttons                   disabled (0)
	Scrollbar                 disabled (0)
	Notifications:            ENABLED
		for buttons       ENABLED
		for scrollbar     ENABLED
	Screen                    disabled

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			< DEBUG MODE ENABLED >
Enabled by default. You can disable it by setting debug_mode = false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SYSTEM: Linux 4.19.0-6-amd64 (x86_64 )
#1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11)

DEVICE: /dev/input/event6 (py-evdev-uinput)
bus: 0003, vendor 0001, product 0001, version 0003

      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x2

TABLET CAPABILITIES:
[('SYN_REPORT', 0), ('SYN_CONFIG', 1), ('SYN_DROPPED', 3), ('?', 21)]
[(['BTN_DIGI', 'BTN_TOOL_PEN'], 320), ('BTN_TOUCH', 330), ('BTN_STYLUS', 331), ('BTN_STYLUS2', 332)]
[(('ABS_X', 0), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_Y', 1), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_PRESSURE', 24), AbsInfo(value=0, min=0, max=0, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_X', 26), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0)), (('ABS_TILT_Y', 27), AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, resolution=0))]

VPEN:
name "Tablet Monitor Pen 170053", bus "BUS_USB", vendor "0001", product "0001", version "0003", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS

XINPUT:
⎜   ↳ Tablet Monitor Pen 170053               	id=17	[slave  pointer  (2)]
Calibrating. . . Done!

Huion Kamvas driver should now be running. . .

(Input from the tablet will ONLY be used to print it out)

Nothing... I have to exit with CtrlC:

^CTraceback (most recent call last):
  File "./huion-tablet-driver.py", line 755, in <module>
    main.run()
  File "./huion-tablet-driver.py", line 35, in run
    main_loop()
  File "./huion-tablet-driver.py", line 313, in main_loop
    data = main.dev.read(main.endpoint.bEndpointAddress, main.endpoint.wMaxPacketSize)
  File "/usr/lib/python3/dist-packages/usb/core.py", line 988, in read
    self.__get_timeout(timeout))
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 851, in intr_read
    timeout)
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 933, in __read
    timeout)
KeyboardInterrupt

Any idea what went wrong?

When I restart tablet (ie without starting script), it works well in duplicated (1+1 monitor) mode but with an offset in 2 monitors 😞

Huion Kamvas GT 221 Pro on Linux Mint 19.1 not running

Hi @joseluis,
I try to setup my recently bought Huion Kamvas GT 221 Pro on Linux Mint 19.1 but I can't get it running properly.
Sorry, I'm far away of being a programmer
maybe you can help me..
I have a 3 Monitor Setup

<stefan@stefan-Precision-M6700:~$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Tablet Monitor Pen                      	id=11	[slave  pointer  (2)]
⎜   ↳ Logitech M510                           	id=13	[slave  pointer  (2)]
⎜   ↳ Logitech K540/K545                      	id=14	[slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS DualPoint Stick           	id=18	[slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS DualPoint TouchPad        	id=19	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ Power Button                            	id=9	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=10	[slave  keyboard (3)]
    ↳ Tablet Monitor Pad                      	id=12	[slave  keyboard (3)]
    ↳ Laptop_Integrated_Webcam_E4HD:          	id=15	[slave  keyboard (3)]
    ↳ Dell WMI hotkeys                        	id=16	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=17	[slave  keyboard (3)]
    ↳ Logitech K540/K545                      	id=20	[slave  keyboard (3)]
stefan@stefan-Precision-M6700:~$ grep evdev /var/log/Xorg*.log | tail -20
[  3060.351] (II) Using input driver 'evdev' for 'Tablet Monitor Pad'
[  3060.351] (**) evdev: Tablet Monitor Pad: Device: "/dev/input/event13"
[  3060.408] (--) evdev: Tablet Monitor Pad: Vendor 0x256c Product 0x6e
[  3060.408] (--) evdev: Tablet Monitor Pad: Found 12 mouse buttons
[  3060.408] (II) evdev: Tablet Monitor Pad: Forcing relative x/y axes to exist.
[  3060.408] (II) evdev: Tablet Monitor Pad: Configuring as mouse
[  3060.408] (**) evdev: Tablet Monitor Pad: YAxisMapping: buttons 4 and 5
[  3060.408] (**) evdev: Tablet Monitor Pad: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[  3060.412] (**) Tablet Monitor Pen: Applying InputClass "evdev tablet catchall"
[  3060.412] (**) Tablet Monitor Pen: Applying InputClass "evdev tablet catchall"
[  3060.412] (II) Using input driver 'evdev' for 'Tablet Monitor Pen'
[  3060.412] (**) evdev: Tablet Monitor Pen: Device: "/dev/input/event12"
[  3060.412] (--) evdev: Tablet Monitor Pen: Vendor 0x256c Product 0x6e
[  3060.412] (--) evdev: Tablet Monitor Pen: Found absolute axes
[  3060.412] (--) evdev: Tablet Monitor Pen: Found x and y absolute axes
[  3060.412] (--) evdev: Tablet Monitor Pen: Found absolute tablet.
[  3060.412] (II) evdev: Tablet Monitor Pen: Configuring as tablet
[  3060.412] (**) evdev: Tablet Monitor Pen: YAxisMapping: buttons 4 and 5
[  3060.412] (**) evdev: Tablet Monitor Pen: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[  3060.412] (II) evdev: Tablet Monitor Pen: initialized for absolute axes.>

I downloaded your code, installed the dependecies and the extra code but get the following:

<stefan@stefan-Precision-M6700:~$ sudo ./huion-tablet-driver.py
[sudo] Passwort für stefan:          
sudo: ./huion-tablet-driver.py: Befehl nicht gefunden>

I have no clue whats going on..

Please tell me what information you need and how to get them..

Thank you in advance
Stefan

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.