3.5 inch touch screen code doesn't work? Rpi

Hi,

I recently bought a 3.5 inch touch screen for raspberry pi 3b+ and it works fine displaying everything. The only issue I have is that I can’t run the scripts to revert back to normal hdmi function. When I run them I either get an error or it just reboots exactly the same.

Bit of a tutorial for the package use for it please?

Thanks!

Recently purchased one of these 3.5" screens too. Agree its a bit of a steep learning curve, ended up re-installing raspbian a number of times. If your device is this one I may be able to help.


The link on the page is to waveshare drivers, which work, … sort of … I had much more success with the GitHub drivers. https://github.com/goodtft/LCD-show

But there are a few gotchas with the GitHub script.
It expects the Pi host name to be rapsberrypi.
It expects the /usr/share/X11/xorg.conf.d/ directory to exist, if it doesn’t it wont copy the file.

Suggest using GitHib drivers as they worked well for me, apart from the above. The wave share scripts have a number of errors.

Cheers
Jim

PS if you can list the error that occurs when running the LCD-hdmi script I might be able to help.

2 Likes

Yeah that’s the one. I might try the Github drivers for it and get back to you!

1 Like

Ok so I used the github drivers and they work awesome. For anyone else looking at this, the github files have drivers for every type of LCD you could think of. All you have to do is step 2 in ReadMe.md on github on James’ link and then type this into the terminal:

(I forgot to mention they have a table with all the executable names for each type of LCD. The one for the 3.5" GPIO pin touscreen hat is LCD35-show)

So for my touchscreen the next command is:(after cd LCD-show in step 2)

./LCD35-show

(before you run this you need to place the screen on the pins)

That should automatically reboot and show a static bootloader on the hdmi output and the desktop interface on the touchscreen.

YAY!

If not, don’t worry, just pull the power and plug back in to manually reboot it and it should work.

Once you’ve had your fun though, and want to revert back to HDMI function, all you need to do is type this into the terminal:

cd LCD-show

and then:

./LCD-hdmi

That should take a second, reboot and display a white screen on the touchscreen and the desktop on the HDMI output.

Now if you’re like me and have a wireless mouse or your mouse goes really laggy after this, don’t fret. I had the same problem and it’s an easy fix.

Type this into the terminal:

sudo nano /boot/cmdline.txt

once the interface comes up, go all the way to the end of the first line, hit space and type this:

usbhid.mousepoll=0

Then click CTRL+X

Then when it asks “Save modified buffer?”, press y and then enter.

It shouldn’t do anything right away, just reboot it and it should work flawlessly.

Hope that helps anyone that was like me!

2 Likes

Great! Thanks for sharing your results Abram!

We will start working on some material that uses the Github drivers and put it up to make things easier on people.

Thanks Stephen. I’ll make sure to check them out!

Thanks for the info on the mouse. Haven’t used the LCD screen in graphical mode very much but when I did the mouse movement was extremely slow and annoying.

Cheers
Jim

PS For anyone using this LCD screen please note it seems to have no control for the backlight meaning it is consuming around 200mA all the time, even when not in use. In my design this is not a problem. But, I believe other LCDs do have backlight control, although much more expensive.

Yeah I don’t know if the cmdline fixes the laggy mouse problem on the screen but I know it does afterwards when you revert back to hdmi function. Thats where I got all my lag…

Also, yeah the screen is really laggy with the mouse so I just used the stylus included. Haven’t tried modifying the cmdline script on the screen yet but I will try and get back to you.

1 Like

OK yeah, so I used the usbhid.mousepoll=0 command and it did fix the lag on the mouse(on the touch screen). There is still a little bit of lag but I think that’s due to the frame rate of the screen. It is actually usable with the mouse Now!

P.S.
Stephen you should probably put this part into the tutorial aswell. It’s just the part from the sudo nano /boot/cmdline.txt to the usbhid mousepoll part and the reboot (hope that makes sense, you’ll probably get it). Just gotta do that when already in the touch screen :slight_smile:

1 Like

Good find Abram,

Its on my (admittedly long) list of tutorials. This is good stuff though, and some of it I’ve gone through myself without finding a solution. Excellent work!