Waveshare Spotspear 3.5" Touch Screen Working with Rune

Raspberry Pi related support

Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby rlsten » 01 Aug 2016, 13:51

I was able to get a Waveshare Spotpear 3.5" resistive touch screen working with Rune Audio (RuneAudio_rpi2_rp3_0.4-beta_20160321_2GB.img) on a Raspberry Pi 3.
s-l500.jpg
s-l500.jpg (67.36 KiB) Viewed 9402 times
Responsiveness is a bit erratic; a stylus is pretty much mandatory. Scrolling can be a challenge.

I also used this method for a no brand screen I got from ebay, although the screen was rotated 180 degrees.
s-l500.jpg
s-l500.jpg (67.36 KiB) Viewed 9402 times


I got the screen to work by basically burning the Waveshare Raspbian Jessie Ready to Use image https://drive.google.com/open?id=0B8Xjwnqc7XAMNHdKdGJ6bkpxZHc, and then noting the changes to the relevant files that were specific to the Waveshare screen. It results in basically the same configuration as using the driver installation method detailed on the Waveshare Wiki http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)#Software. I didn't use that method because I didn't want the Rune Audio config.txt and cmdline.txt files overwritten during the Waveshare driver installation.

Here is a step by step guide (of course, I can't guarantee that this will work for everybody; I've used it several times):

1. Install the "xf86-video-fbturbo" package
Code: Select all
pacman -S xf86-video-fbturbo


2. Copy the waveshare driver (waveshare35a-overlay.dtb) to /boot/overlays. The driver can be found on the CD that comes with the screen, or it can be obtained as part of the driver package on the Waveshare Wiki. http://www.waveshare.com/w/upload/2/24/LCD-show-160520.tar.gz

3. Add the following to /boot/config.txt:

Code: Select all
start_x=1
gpu_mem=128
core_freq=250
sdram_freq=400
over_voltage=0
dtparam=spi=on
dtoverlay=waveshare35a
dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swapxy=1,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900
dtparam=i2c_arm=on
dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1


4. Add the following at the end of /boot/cmdline.txt:

Code: Select all
fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo


5. Create the file /etc/X11/xorg.conf.d/99-calibration.conf and insert the following:

Code: Select all
Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "3932 300 294 3801"
        Option  "SwapAxes"      "1"
EndSection


6. In /etc/X11/xorg.conf.d/99-fbturbo.conf, change
Code: Select all
 Option          "fbdev" "/dev/fb0"

to
Code: Select all
 Option          "fbdev" "/dev/fb1"


7. Add the following to /etc/modules-load.d/raspberrypi.conf:

Code: Select all
i2c-bcm2708
i2c-dev
flexfb  width=320  height=480  regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3
fbtft_device debug=3 rotate=90 name=flexfb speed=16000000 gpios=reset:25,dc:24
ads7846_device model=7846 cs=1 gpio_pendown=17  keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900


Note: The last 3 lines re: flexfb; fbtft; and ads7846_device were commented out on the Waveshare Raspberry Jessie Ready to Use image; however, they were not commented out on the Driver Installation package from the Waveshare Wiki.

8. Reboot

If you want to rotate the screen, then in /boot/config.txt change
Code: Select all
dtoverlay=waveshare35a-overlay.dtb


to
Code: Select all
dtoverlay=waveshare35a-overlay.dtb,rotate=270


If you rotate the screen, or if the calibration is off, you will have to calibrate the screen. I used the method from this excellent post:
http://www.runeaudio.com/forum/post13781.html?hilit=xinput_calibrator#p13778

Cheers,
Rod
rlsten
 
Posts: 79
Joined: 25 May 2015, 18:06

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby zzeromin » 16 Aug 2016, 08:38

Hi. rlsten

Thanks for great tutorial.
I've successfully done setup 3.5" TFT LCD on RPi 3B.

Image

You are the best.
Thanks a lot.

zzeromin
zzeromin
 
Posts: 7
Joined: 22 Jan 2016, 00:39
Location: South Korea

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby radu022003 » 21 Aug 2016, 08:27

Hello, I also want to use RuneAudio with this LCD and RPi1 (later with RPi0). Until now I managed to make the LCD work, meaning I can see messages on LCD and console.

I followed some tutorials about how to install X on arch linux but when i run startx command is starting and immediately stopping without relevant error (at least for me).

Can you please provide some details about how to get to the RuneAudio interface on 3.5" LCD Touchscreen?

Thanks in advance.
radu022003
 
Posts: 3
Joined: 16 Aug 2016, 15:12

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby hondagx35 » 21 Aug 2016, 13:58

Hi radu022003,

this feature (Local Browser) is only available on the new RP2/3 and ODROID C2 images.

Installing and running x on the RP1 or Zero is too much for the little device (just my 2 cents).
What i have done for the above mentioned devices is:
- install midori (webbrowser)
- install matchbox-window-manager (needed for running the browser on the frame buffer)
- start xinit on boot and display midori pointing to http://localhost

The next RP1 image will run also on RP0 and will include the Local Browser.

Frank
User avatar
hondagx35
 
Posts: 2834
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby radu022003 » 21 Aug 2016, 16:43

installing midori seems to be impossible, at least not without efforts.

[root@runeaudio lib]# pacman -S midori
resolving dependencies...
looking for inter-conflicts...
:: libgudev and libsystemd are in conflict. Remove libsystemd? [y/N]

is this a problem only for RPi1?
radu022003
 
Posts: 3
Joined: 16 Aug 2016, 15:12

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby hondagx35 » 21 Aug 2016, 16:56

Hi

is this a problem only for RPi1?

Not only for the Pi1, but for all older images.
It needs much more effort to get the local browser running.
The whole image has to be made new (all packages have to be updated).

Frank
User avatar
hondagx35
 
Posts: 2834
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby radu022003 » 22 Aug 2016, 10:33

So what is your advice? Worth continuing on this path? Or should I change to raspberry pi 3?
radu022003
 
Posts: 3
Joined: 16 Aug 2016, 15:12

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby hondagx35 » 22 Aug 2016, 22:59

Hi radu022003,

So what is your advice?

Worth continuing on this path?

I don't think that it is possible for you to update all packages.
I'm short in time at the moment, so a new image for RP1 has to wait.
Or should I change to raspberry pi 3?

This would be the easiest solution. A RP 2 will also do the job.

Frank
User avatar
hondagx35
 
Posts: 2834
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby runemine120 » 29 Sep 2016, 01:46

Running into some issue with my project for this, did each step but still no luck. Anyway you could post pictures for each step to see exactly what i screwed up or heck even better a new iso file with the steps done already.
runemine120
 
Posts: 1
Joined: 29 Sep 2016, 01:39

Re: Waveshare Spotspear 3.5" Touch Screen Working with Rune

Postby tyman » 29 Sep 2016, 14:32

(first timer with pi2 programming, so please excuse me..)

I tested the above instructions posted and it worked like magic, and I am so so happy.

But somehow my display is in portrait mode, but yours is in landscape mode. Did you change anything on the code?

- waveshare 3.5" LCD with resisitive touch
- RPi2

I tried changing the rotate command in /boot/config.txt
where i inserted 90, 180, 270 for xx but it did not work for me.

Code: Select all
dtoverlay=waveshare35a,rotate=xx


i also tried changing the following in /boot/config.txt

Code: Select all
# LCD settings
# 180 degrees
lcd_rotate=2
# Normal
#lcd_rotate=0


i reboot after every change to the config.txt file. Any pointers will be appreciated




zzeromin wrote:Hi. rlsten

Thanks for great tutorial.
I've successfully done setup 3.5" TFT LCD on RPi 3B.

Image

You are the best.
Thanks a lot.

zzeromin
tyman
 
Posts: 3
Joined: 29 Sep 2016, 14:08

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest