I'm working on a raspberry pi (2B) project that is using a Waveshare 7" LCD Capacitive touchscreen that interfaces with the raspberry pi through HDMI (display) and USB (touchscreen).
The installation of the drivers for the touchscreen make the touchscreen and the display work perfectly. However, when I run my python program, which I use to both control GPIO and SPI (used on a 16x2 character display), the GPIO doesn't work any more. Python displays no errors, and the RPi.GPIO and RPLCD modules simply don't do anything.
I can control the GPIOs using the terminal however (although I don't know how to use the SPI pins through the terminal), so I know that fundamentally it should still work. (I am able to light the backlight of the character LCD by using the GPIO output in the terminal).
The installation of the touchscreen drivers uses a script that replaces the following files and folders:
/boot/kernel.img
/boot/kernel7.img
/boot/config.txt
/lib/modules/
The config.txt
file only enables the display to work as far as I can gather. The driver script also replaces /lib/modules
with a folder named '3.18.6-v7+
' instead of what I normally have in there, which is '4.1.6-v7+
' and '4.1.6+
'.
I've tried enabling the device tree and SPI in using raspi-config
in the terminal, but this doesn't seem to change anything unless I am in my initial configuration without the touchscreen drivers. I should note that if I replace the kernels with the original files, the touchscreen stops working (display still works), but the GPIOs start working again.
The main problem is that I can't get the touchscreen and the GPIO's through python working at the same time. Is there something fundamental that I am missing here? Are the modules in 3.18.6-v7+
not compatible with RPi.GPIO and RPLCD? Applying updates like rpi-update
, or sudo apt-get update/upgrade
will revert things to a state with the touchscreen disabled and the GPIOs working.
Edit: I'm not allowed to comment yet on this site, so I'll state here that I have tried using WiringPi and WiringPi2 GPIO libraries in Python with no effect. I know that there are many others out there, so I'll try some others to see if there is another solution.