lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

USB Wacom tablets with Raspbian Jessie

Sun Oct 04, 2015 4:39 pm

I've previously posted instructions on how to build the linux wacom project's wacom kernel driver for Raspbian - viewtopic.php?f=63&t=8709&hilit=wacom - with the recent upgrade to Jessie, I found that my previously compiled Wacom tablet kernel no longer worked. After some experimentation I've been able to build a new version of the wacom kernel module, but I found that my previous instructions needed some updating, so I'm sharing a revised procedure here.

The current version of Raspbian Jessie uses version 4.1.7-v7 of the linux kernel. You can verify this for yourself with the following command:

Code: Select all

uname -a
this version of the kernel was built using gcc version 4.8.3, which you can check by looking in the /proc/version file:

Code: Select all

cat /proc/version
Now, Raspbian Jessie ships with gcc 4.9.2, but it's necessary to use the same gcc version used for kernel compilation to build compatible kernel modules. Fortunately, it's easy to install gcc version 4.8 on Jessie:

Code: Select all

sudo apt-get install gcc-4.8 g++-4.8
Having install gcc-4.8, we now need to make this version the default version when using the gcc command:

Code: Select all

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
It's then easy to revert to gcc-4.9 afterwards by using the following command:

Code: Select all

sudo update-alternatives --config gcc
Stay with gcc-4.8 as your default version of gcc for now. You can check the default version of gcc as follows:

Code: Select all

gcc --version
Having installed the correct version of gcc, you can now proceed to install the required linux kernel source. You should do this by using the rpi-source script from here: https://github.com/notro/rpi-source

Once you've downloaded the rpi-source code from github, go ahead and run the script:

Code: Select all

rpi-source
Once that's finished, run the following incantations to provide links to where the linux-wacom code will expect to find the kernel source:

Code: Select all

sudo ln -s /root/linux /usr/src/linux
sudo chmod 755 /root
sudo chmod 755 /root/linux
sudo chmod 755 /usr/src/linux
Then we need to perform the following operation to set the source code up properly:

Code: Select all

cd /usr/src/linux
sudo make scripts
Next, you need to download the latest version of the linux-wacom driver source code from here: http://sourceforge.net/projects/linuxwa ... put-wacom/. I used the code in input-wacom-0.29.0.tar.bz2 to compile on Raspbian Jessie. Use a browser to get the code from the sourceforge site, then unpack the tarball:

Code: Select all

tar -xvf input-wacom-0.29.0.tar.bz2
Now go into the input-wacom-0.29.0 directory:

Code: Select all

cd input-wacom-0.29.0
Since version 0.28.0 of the input-wacom code there has been a problem with the input-wacom configure script on Raspbian. The issue seems to boil down to the location of some linux kernel header files, and also the format of the kernel version number in some of the header files. The kernel version is 4.1.7-v7+ but in some of the kernel header files the version is given as 4.1.7+-v7. These problems cause the input-wacom configure script to declare that the required kernel source is not installed. I haven't found an elegant solution to this problem, but we can force the configure script to run to completion and generate the Makefiles that we need by making a simple change to the configure script. This is a total kludge, and not to be recommended as a general solution, but it works for now:

Code: Select all

nano configure
Use ctrl-W and locate the relevant section of code by searching for the word "development" - above the line of code

Code: Select all

if test "$WCM_ENV_KERNEL" = "no"; then
enter the following line of code on a line by itself:

Code: Select all

WCM_ENV_KERNEL=yes
save the modified file (ctrl-X then enter) and then run the configure script:

Code: Select all

./configure
Now go into the 3.17 directory and build the driver!

Code: Select all

cd 3.17
make
The compilation should proceed without problems. You can ignore the warning about an unused variable. You should end up with the magic wacom.ko file in this directory once the compilation finishes. Install the kernel module as follows:

Code: Select all

sudo mkdir /lib/modules/4.1.7-v7+/kernel/drivers/input/tablet
sudo cp wacom.ko /lib/modules/4.1.7-v7+/kernel/drivers/input/tablet
Now load the new module into the kernel, and you should have a working USB wacom tablet once again!

Code: Select all

sudo depmod -a
You can check that things are as they should be by using the dmesg and lsmod commands.

Hopefully this will help someone else out there.

Good luck!

rook92
Posts: 4
Joined: Sat Dec 12, 2015 2:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sat Dec 12, 2015 4:25 pm

i did every thing like you said but after you said :Once you've downloaded the rpi-source code from github, go ahead and run the script.
i did but its says Linux failed to create a symbolic link ,and :sudo chmod 755 /root/linux
chmod: cannot access ‘/root/linux’: No such file or directory
i did every thing you said so why isn't the file showing up in my directory ?
also my tablet isn't a bamboo its a Intuos so could that be the problem ?

lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sat Dec 12, 2015 9:27 pm

Hello rook32,

sorry you're having trouble - I've had a delve into what may be causing your trouble -

it seems that there have been some changes to the rpi-source script since I posted my updated instructions

in fact, the rpi-source script no longer runs for me - I get the following output when I run rpi-source on a fresh install of Raspbian Jessie:

Code: Select all

[email protected]:~/rpi-source $ python rpi-source

 *** Updating rpi-source
--2015-12-12 20:40:25--  https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 213.120.234.130, 213.120.234.122
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|213.120.234.130|:443... connected.
GnuTLS: A TLS fatal alert has been received.
GnuTLS: received alert [0]: Close notify
Unable to establish SSL connection.
Traceback (most recent call last):
  File "rpi-source", line 303, in <module>
    
  File "rpi-source", line 160, in do_update
    
  File "rpi-source", line 85, in sh
    
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'sudo wget  https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O rpi-source' returned non-zero exit status 4
All very puzzling. I don't know if you got this error too?

What's happening here is that rpi-source is attempting a self-update by downloading a fresh copy of itself from github - this ensures that running rpi-source will always result in the most recent version of the script being executed; unfortunately some kind of SSL security issue has arisen here.

Anyhow, we can bypass this issue by simply commenting out the offending wget - simply comment out (using a #) line 160 of the rpi-source python script - use any text editor to do this (such as nano etc)

Having done this I can now run the rpi-source script without error. And now I see that the current version of the script puts the linux source code into the users home directory. Previous versions of the rpi-source script put the source code into /root/linux, and so that's what my instructions related to.

Perhaps the rpi-source script worked for you? In that case you should have a directory called linux in your home directory?
If so, you can just use a symbolic link to connect the linux source in your home directory to /usr/src/linux which is where the Linux Wacom Project code expects to find the linux source. So, assuming you are logged in as user pi:

Code: Select all

sudo ln -s /home/pi/linux /usr/src/linux
will now ensure that you have the linux source code available for building the wacom kernel module.

Lastly, the wacom kernel module should work fine with your Intuos tablet!

Let me know if this solves your problem and if you get things working - good luck!

lcww1

lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sat Dec 12, 2015 9:41 pm

Also, just to add one further change since I posted my updated build instructions - the Linux Wacom Project has updated its driver code - I've just downloaded the latest version - input-wacom-0.30.1.tar.bz2 - and the configure issues that I mentioned in my post at the top have now been resolved! So, with the code in input-wacom-0.30.1.tar.bz2 you can just go ahead and run the configure script as supplied, without making any edits!

Having unpacked the input-wacom-0.30.1.tar.bz2 tarball, cd into the resulting directory and run configure:

Code: Select all

tar xvf input-wacom-0.30.1.tar.bz2
cd input-wacom-0.30.1
./confugure
cd 3.17
make
You should now find the magic wacom.ko file in the 3.17 directory. Just follow the rest of the instructions from my post at the top to copy this file into the correct location for loading into the kernel and you should be good to go!

lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sat Dec 12, 2015 10:04 pm

OK, my problem with rpi-source has been fixed with a simple sudo apt-get update and sudo apt-get upgrade!

There were new versions of libssl1.0.0 and openssl waiting for me, and with these installed rpi-source runs as expected, so no need for the kludgey edit mentioned above!

I'm afraid that the recipe for building the kernel module is a bit brittle, as changes in Raspbian, rpi-source, and the Linux Wacom Project code bases are liable to result in the recipe going awry! I don't have the leisure to keep up with these changes, so I'm afraid that it's just going to be a case of fixing things each time they're found to have broken........

Anyhow, it seems like things should all be working smoothly now, with up to date software.

Lastly, remember that the location that you need to copy the wacom.ko file to will vary according to your kernel version, so remember to check this using the

Code: Select all

uname -a
command

e.g.

Code: Select all

[email protected]:~/input-wacom-0.30.1/3.17 $ uname -a
Linux raspizero 4.1.13+ #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015 armv6l GNU/Linux
So in this case, on a Pi using kernel version 4.1.13+, I will need to copy the wacom.ko module from the input-wacom directory as follows:

Code: Select all

sudo mkdir /lib/modules/4.1.13+/kernel/drivers/input/tablet
sudo cp wacom.ko /lib/modules/4.1.13+/kernel/drivers/input/tablet/.

rook92
Posts: 4
Joined: Sat Dec 12, 2015 2:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sun Dec 13, 2015 9:18 am

am i supposed to be using my terminal for this ?
thats all ive really been using.
i mean ive donwloaded the softwar that was posted , then deleted what i didnt need because of the updates , but now im just lost .
im gonna level with you . . . im really new to this and its getting terribly complicated just to get a tablet to work .
any way .
how does one : comment out (using a #)? also : line 160 of the rpi-source python script - use any text editor to do this (such as nano etc).
is it alright if im using my terminal for that or do i need to use the python or would wolfram work ?
im sorry for the hassel but this isnt even the end of my questions this is just the only one i could cohesivly put together .

lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sun Dec 13, 2015 2:58 pm

Ok rook92, I'm happy to help, but I need to know more specifically what your confusion is.

There's no doubt that compiling a linux kernel module isn't the easiest thing to do as a new linux user, however if you can work your way through this you'll learn a lot! I'm afraid that all this is necessary as the wacom kernel module isn't a standard part of the Raspberry Pi kernel for some reason.

As you seem to be new to the command line, I'll recommend that you take a look at the Foundation's recently released "Conquer the command line" ebook - you can download this as a free pdf:

https://www.raspberrypi.org/magpi/issue ... bash-vol1/

Take a look at this, and some of my instructions might make more sense to you. You don't need to use Wolfram for any of this stuff!

Now, to answer your specific question, all of the instructions and commands in my recipe are intended to be issued at the terminal command line. If you're logged into the graphical desktop, then that means using the Terminal program that you can launch by clicking on the Terminal icon on the menubar at the top of the screen.

I'm sorry if my instructions in reply to your earlier query were confusing, but I had some trouble myself, and I only resolved things after my first reply to you.

In essence, you need to make sure you're running an up to date version of the current release of Raspbian. You may already be doing this, but ensure you're up to date using the following commands:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
That should prevent you running into the problem that I had with the rpi-source script.

Now, you seem to have managed to download the rpi-source script? If so, then just run the script:

Code: Select all

python rpi-source
You don't need to worry about editing the rpi-source script if your system is up to date. The rpi-source script will download a load of linux kernel source code that you need to build the wacom driver. This code will appear in your home directory in a folder called linux. Take a look and check that it's there - if it's not then you can't proceed further. If it is, then give the following command line instructions (I'm just repeating my instructions from above to avoid any confusion):

Code: Select all

sudo ln -s /home/pi/linux /usr/src/linux
cd /usr/src/linux
sudo make scripts
cd
tar xvf input-wacom-0.30.1.tar.bz2
cd input-wacom-0.30.1
./confugure
cd 3.17
make
sudo mkdir /lib/modules/4.1.13+/kernel/drivers/input/tablet
sudo cp wacom.ko /lib/modules/4.1.13+/kernel/drivers/input/tablet/.
This assumes that you've downloaded the linux wacom project code (the input-wacom-0.30.1.tar.bz2 file) to your home directory on your pi. This also assumes that you're using kernel version 4.1.13+ if you're using a different version, then you'll need to modify the location where the wacom.ko driver is copied to. Check your systems linux kernel version using the following command

Code: Select all

uname -a
In terms of the Linux Wacom Project code - I've checked on their website and I can confirm that the input-wacom-0.30.1.tar.bz2 version contains support for the Intuos tablet. I've built this myself and it works nicely with my old Bamboo tablet.

If you're really stuck, then you can download the wacom.ko file that I built whilst I was looking into your difficulties - I've put the file in my dropbox:

https://www.dropbox.com/s/rhhxj3ymi7wg4wn/wacom.ko?dl=0

this was built for kernel version 4.1.13+, so you'll still need to check that this is right for your system, and you'll still need to move this wacom.ko file into the right location before you can start using it on your pi:

Code: Select all

sudo mkdir /lib/modules/4.1.13+/kernel/drivers/input/tablet
sudo cp wacom.ko /lib/modules/4.1.13+/kernel/drivers/input/tablet/.
Now restart your Pi with your Intuos tablet plugged into a USB port - it should function as a mouse when you're logged into the desktop.

Good luck! I'm happy to keep trying to help if none of this has helped you get any further.

rook92
Posts: 4
Joined: Sat Dec 12, 2015 2:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sun Dec 13, 2015 5:38 pm

i got : xf86-input-wacom-0.32.0.tar.bz2 (594.1 kB) ,and i even have input-wacom-0.30.1.tar.bz2.sig ,and input-wacom-0.30.1.tar.bz2 .
and when i put in python rpi-source i get : python: can't open file 'rpi-source': [Errno 2] No such file or directory .
did i not get the proper program or file ?
also id just like to say thank you .
your a tremendous help , and thanks for the link to the book .

lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Sun Dec 13, 2015 10:18 pm

Hello again rook92 - glad you're sticking with it!

It looks like you've got the only file you need from the Linux Wacom Project, which is the file called input-wacom-0.30.1.tar.bz2

You can get rid of the other files that you've downloaded from the Linux Wacom Project. Now, you need to unpack the input-wacom-0.30.1.tar.bz2 file using the following command, at the Terminal command line, making sure that you're in the same directory as the input-wacom-0.30.1.tar.bz2 file, when you give the command:

Code: Select all

tar xvf input-wacom-0.30.1.tar.bz2
After giving this command, you should find a new folder called input-wacom-0.30.1 in your directory - this is the code you need to build the wacom.ko kernel module.

Now, none of the above has anything to do with the rpi-source script, which you need to get from github. The rpi-source program is a script, written in the python programming language, which will download the linux kernel source code that you need to build the wacom.ko module from the code that you just unpacked (using the instructions above).

I had some problems running the rpi-source script - make sure your raspbian is up to date by using the commands in my previous post.

When you've got your raspbian up to date, get the rpi-source program by giving the following command in your home directory (that is, /home/pi)

Code: Select all

git clone https://github.com/notro/rpi-source


This will create a new directory in your home directory called rpi-source. If you've already done this, then you'll get an error message, but that's ok. Now, having got the rpi-souce stuff, you need to move into the rpi-source directory to find and run the actual rpi-source script.

Code: Select all

cd rpi-source
Now, take a look around - use the ls command to show you what's in the rpi-source directory:

Code: Select all

$ cd rpi-source/
$ ls
LICENSE     README.md   rpi-source
Huzzah! The rpi-source script of legend! Now, having found the rpi-source script (which confusingly has the same name as the directory that contains it), you can execute it, and benefit from its powerful magic. Give the following command (from inside the rpi-source directory):

Code: Select all

python rpi-source
This should run and produce a lot of output on your screen. At the end of it all you should return to your home directory by typing:

Code: Select all

cd
then take a look at the contents of your home directory using the ls command:

Code: Select all

ls
and you should see (amongst other things) a new directory called linux in your home directory!

Let me know if you have any luck with the above, and then we'll go from there to get the driver built and installed.........

Good luck rook92!

rook92
Posts: 4
Joined: Sat Dec 12, 2015 2:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Fri Dec 18, 2015 9:11 am

yes I've got them showing up in my home directory .
i have input-wacom-0.30.1 and input-wacom-0.30.1.tar.bz2 .
but input-wacom-0.30.1.tar.bz2 shows up in red text is that bad ?
either way whats next ?

lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Mon Dec 21, 2015 11:23 am

Hi rook92,

well, that's a good start! You've got the Linux Wacom project code that you need. Now, we just need to get you the linux kernel code and we can get the wacom driver built.

Now, did you follow the rest of my instructions in my last post (the one from Sun Dec 13, 2015 11:18 pm)?

Specifically, have you downloaded the rpi-source code from github? that's your next step - let me know when you've got that done, or if you're having problems downloading the rpi-source code then let me know.

Keep going!

lcww1
Posts: 31
Joined: Sat Jun 01, 2013 6:40 pm

Re: USB Wacom tablets with Raspbian Jessie

Thu Mar 10, 2016 9:50 pm

I don't know if you're still out there rook92, or whether you're still interested in getting your wacom tablet working with your Pi? Anyhow, I have some good news for you - if you download and install the latest version of Raspbian from the foundation's page (just go to the Downloads section of the website) then you'll find that your wacom tablet "should just work" when you plug it in to a usb port on the Pi. Hooray! No more compiling kernel modules!

Return to “General discussion”