n0b0dy's guide to installing a Waveshare 3.2 v1 Touchscreen

Overview Forums Sticky Finger’s Kali-Pi n0b0dy's guide to installing a Waveshare 3.2 v1 Touchscreen

Viewing 26 reply threads
  • Author
    Posts
    • #1247
      Re4son
      Keymaster

      UPDATE: This manual procedure is no longer required. Waveshare screens are now supported by Re4son’s universal TFT setup tool:

      http://whitedome.com.au/re4son/kali-pi/#TFThttp://whitedome.com.au/re4son/kali-pi/#TFT

      Original author: n0b0dy

      rtng

      I have the same brand JOY-IT and i have follow the same method for installing driver

      Hardware
      Waveshare 3.2 v2 Touchscreen of http://www.JOY-IT.com
      Raspberry Pi 3
      Install Kali Linux und dann

      1-. apt-get update
      2-. mount /dev/mmcblk0p1 /boot/
      3-. cd /boot
      4-. nano config.txt
      and paste a config.txt

      dtparam=audio=on
      dtparam=spi=on
      dtoverlay=waveshare32b:rotate=270

      5-. nano /boot/cmdline.txt
      and paste at the end of the line

      fbcon=map:10

      6-. nano /usr/share/X11/xorg.conf.d/99-calibration.conf
      and paste:

      Section “InputClass”
      Identifier “calibration”
      MatchProduct “ADS7846 Touchscreen”
      Option “Calibration” “160 3723 3896 181”
      Option “SwapAxes” “1”
      EndSection

      7-. nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf
      and paste:

      Section “Device”
      Identifier “Allwinner A10/A13 FBDEV”
      Driver “fbturbo”
      Option “fbdev” “/dev/fb1”
      Option “SwapbuffersWait” “true”
      EndSection

      8-. cd /tmp
      wget http://www.joy-it.net/anleitungen/rpi/tft32b/waveshare32b-overlay.dtb
      sudo cp waveshare32b-overlay.dtb /boot/overlays/

      9-. reboot
      10-. ssh IP-your-raspberry
      11-. mount /dev/mmcblk0p1 /boot
      cd /usr/local/src
      git clone https://github.com/adafruit/Adafruit-PITFT-Helper.git
      cd Adafruit-PITFT-Helper/
      ./adafruit-pitft-helper -t 35r -u /root

      12-. yes
      13-. yes
      14-. reboot

      That worked for me
      Original author: n0b0dy

    • #1126
      Re4son
      Keymaster

      Original author: n0b0dy

      I miss it

      10.5 mkdir /etc/kbd/
      and create the file config (empty)
      Original author: n0b0dy

    • #1127
      Re4son
      Keymaster

      Hi n0b0dy,

      awesome work, thanks heaps!

      We might be able to reduce the number of steps by shuffling things around a bit. The Adafruit helper performs some of the config changes already.

      Hey rtng,

      why don’t you try n0b0dy’s steps with the following changes:

      – Steps 11/12/13/14 first.
      – Steps 1/2/3/4 but you only have to replace the dtoverlay line
      – Steps 6/7/8

      And that should get it working.

      Let us know if that works for you and I can change the Adafruit-Helper to include a parameter to do that automatically for this screen type.

      Thanks everyone,
      Re4son

    • #1333
      Re4son
      Keymaster

      Hi everyone,

      I’ve written up the following blog post in response to n0b0dy’s discovery:

      http://whitedome.com.au/re4son/sticky-fingers-kali-pi-with-waveshare-3-2-tft-touch-screen/

      Please give it a try and provide some feedback.

      Cheers,
      Re4son

    • #1343
      n0b0dy
      Guest

      Update

      Step 9

      For more security i have copied all files of /lib/modules/*

      but from the following Distros
      a-. kali-2.1.2-rpitft.img
      b-. 2016-02-26-raspbian-jessie-tft32v2.img (Distro from Waveshare)
      Link (b): http://www.joy-it.net/downloads/summary/31-raspberry-zubehoer/87-touch-display-3-2-v2

      and now you can continue the process
      10: reboot
      …11,12, etc etc

      PS:

      When the tutorial dont work for you, you must check that the file /etc/kbd/config is not empty – in case it is empty, you can copy this file:
      http://www.whitedome.com.au/download/config

      And after many trials, i had to remove the file from /usr/share/X11/xorg.conf.d/99-fbturbo.conf
      because when you executed
      ./adafruit-pitft-helper -t 35r -u /root
      It creates a new file but in /root/99-fbturbo.conf

      Feedback for Re4son

      The procedure you suggested did not work for me but I just tried it once.

      Thank you for all
      I can send you a picture from my station Rasperry pi 3 when it is ready.

    • #1344
      n0b0dy
      Guest

      Well,

      A try this Guide and I tell you how it worked

      Sticky Finger’s Kali-Pi with WaveShare 3.2″ or 3.5″ TFT Touch Screen

      I tell you soon

      Thank

    • #1406
      rtng
      Guest

      Hey Grandmasters,
      just tried http://whitedome.com.au/re4son/sticky-fingers-kali-pi-with-waveshare-3-2-tft-touch-screen/ with waveshare32b on rpi twice but it didn’t work for me.
      As i allready praised 😉 both of you here: https://forums.kali.org/showthread.php?29983-Kali-2-0-image-for-Raspberry-Pi3/page3 , n0b0dy’s method worked for me well but i still did’nt manage to integrate the shiny new re4son-kernel. I tried that kernel and helper but got weired touchscreen-cursor and desktop and couldn’t startx automatically even after going through the adafruit guide: https://learn.adafruit.com/adafruit-pitft-3-dot-5-touch-screen-for-raspberry-pi/detailed-install. thank you for suggestions.
      all the best to you

    • #1407
      Re4son
      Keymaster

      Hi nrtg,

      I’ve almost finished the new helper for you to test but I need your help with making it work. I’ve got a couple of questions:
      1. With the new kernel and the following lines in the config.txt:

      dtparam=audio=on
      dtparam=spi=on
      dtoverlay=waveshare32b:rotate=270

      does the screen work with the console?

      could you please send me a copy of the following files:
      config.txt
      cmdline.txt
      /usr/share/X11/xorg.conf.d/99-calibration.conf
      /usr/share/X11/xorg.conf.d/99-fbturbo.conf
      /etc/X11/xorg.conf.d/99-fbdev.conf

      please e-mail them to [at] whitedome.com.au

      I really appreciate your help.

      Many thanks,
      Re4son

    • #1410
      DarkStorm
      Guest

      Hi Guys thanks for the guide i’m also having probs with waveshare32b heres some stuff ive done so far to get it working on a rpi3 kali linux rolling 2.1.2

      wget http://www.spotpear.com/download/diver24-5/LCD-show-151102.tar.gz
      tar xvf LCD-show*.tar.gz
      cd LCD-show/
      sudo dpkg -i xinput-calibrator_0.7.5-1_armhf.deb
      sudo ./LCD32-show
      reboot

      Then add add wheezy to apt/sources
      sudo nano /etc/apt/sources.list

      #deb http://http.kali.org/kali kali-rolling main non-free contrib
      #deb-src http://http.kali.org/kali kali-rolling main non-free contrib
      deb http://archive.raspbian.org/raspbian wheezy main contrib non-free

      sudo apt-get update
      sudo apt-get install evtest tslib libts-bin
      then restore /apt/sources to :
      sudo nano /etc/apt/sources.list

      deb http://http.kali.org/kali kali-rolling main non-free contrib
      deb-src http://http.kali.org/kali kali-rolling main non-free contrib
      #deb http://archive.raspbian.org/raspbian wheezy main contrib non-free

      sudo apt-get update

      Then to get fbturbo to work I had to install
      sudo apt-get install git build-essential xorg-dev xutils-dev x11proto-dri2-dev
      sudo apt-get install libltdl-dev libtool automake libdrm-dev
      git clone https://github.com/ssvb/xf86-video-fbturbo.git
      cd xf86-video-fbturbo
      autoreconf -vi
      ./configure –prefix=/usr
      make
      sudo make install
      sudo cp xorg.conf /etc/X11/xorg.conf

      sudo nano /etc/udev/rules.d/95-stmpe.rules
      change ATTRS{name}==”stmpe” to
      ATTRS{name}==”ADS7846 Touchscreen”,

      sudo cat /dev/input/event4 might be a different number on your device touch the screen you should see something happen ! ctrl-c to quit

      sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate

      this should now have your touchscreen working without X

      sudo mount /dev/mmcblk0p1 /boot
      sudo nano /boot/config.txt

      mine looks like this

      # --- added by adafruit-pitft-helper Tue 10 May 19:39:19 BST 2016 ---
      [pi1]
      #device_tree=bcm2708-rpi-b-plus.dtb
      [pi2]
      #device_tree=bcm2709-rpi-2-b.dtb
      #pi3
      device_tree=bcm2710-rpi-3-b.dtb
      [all]
      dtparam=spi=on
      #dtparam=i2c1=on
      dtparam=i2c_arm=on
      dtoverlay=waveshare32b
      dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swa$
      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1
      dtparam=audio=on
      # --- end adafruit-pitft-helper Tue 10 May 19:39:19 BST 2016 ---

      sudo nano /boot/cmdline.txt

      dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait fbcon=map:10 fbcon=font:VGA8x8 rootflags=noload net.ifnames=0 biosdevname=0

      sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

      Section "InputClass"
              Identifier      "calibration"
              MatchProduct    "ADS7846 Touchscreen"
              Option  "Calibration"   "3700 122 268 4012"
              Option  "SwapAxes"      "1"
      EndSection

      sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

      Section "Device"
              Identifier      "Allwinner A10/A13 FBDEV"
              Driver          "fbturbo"
              Option          "fbdev" "/dev/fb1"
      
              Option          "SwapbuffersWait" "true"
      EndSection

      Now I have most of it working I just cannot switch to hdmi from pitftmenu and my net dev names seem to be like enx************ wlx************ which is annoying.

      and I keep getting this error scrolling through my console and dmesg :
      w1_master_driver w1_bus_master1: Family 0 for 00.880000000000.4e is not registered

      Anyway hope this helps thers probly something ive missed but will keep on trying thanks again,
      DarkStorm

    • #1411
      DarkStorm
      Guest

      Oh and a quick add to say to get the scripts to stop giving python/r error I had to use dos2unix on the scripts

      sudo dos2unix /home/pi/pitftmenu/*

      • #1414
        Re4son
        Keymaster

        Hi DarkStorm,

        thanks for the info. Good point.
        I’ve never noticed any python errors. When do you get those?

        Many thanks,
        Re4son

    • #1412
      rtng
      Guest

      @ Re4son
      did you got mails?
      if you need more information, let me know..

      • #1413
        Re4son
        Keymaster

        Hi rtng,

        thanks for the files.
        I am about to finish the new helper and I’ll include them in the kernel package.
        To validate the configuration I got from the manufacturer could you please try to edit these files:

        /usr/share/X11/xorg.conf.d/99-fbturbo.conf :

        Section “Device”
        Identifier “Allwinner A10/A13 FBDEV”
        Driver “fbturbo”
        Option “fbdev” “/dev/fb1”
        Option “SwapbuffersWait” “true”
        EndSection

        /usr/share/X11/xorg.conf.d/99-calibration.conf :

        Section “InputClass”
        Identifier “calibration”
        MatchProduct “ADS7846 Touchscreen”
        Option “Calibration” “160 3723 3896 181”
        Option “SwapAxes” “1”
        EndSection

        That should be all that is required.

        Everything to support the display is provided by the new kernel package. The only thing that has to be done manually is to edit:
        /boot/config.txt
        /boot/cmdline.txt
        /usr/share/X11/xorg.conf.d/99-calibration.conf
        /usr/share/X11/xorg.conf.d/99-fbturbo.conf

        Those configurations will soon be done by the new helper module (give me a day or two)

        Please let me know how you go.

        Many thanks,
        Re4son

    • #1416
      DarkStorm
      Guest

      I was getting the error running refresh and on another option ive forgot 🙂
      env: python\r: No such file or directory

      But i am using the 2.8 files not sure if this makes a difference.

      Also to get the x on tft or hdmi to work just # out Option “fbdev” “/dev/fb1
      in 99-fbturbo.conf.

      Seems to be working great my end now thanks guys and good luck

      • #1417
        Re4son
        Keymaster

        Hi DarkSt0rm,

        great to hear that it’s working for you.
        Thanks for the hint, I’ll fix up the 2.8 files.

        Many thanks,
        Re4son

    • #1418
      Re4son
      Keymaster

      Alright everyone,

      I’ve just ordered a waveshare 3.5″ online for testing.
      Not sure when it’s going to be here but until then, feel free to test out the new pi-tft-setup utility, available under:

      https://github.com/Re4son/Re4son-Pi-TFT-Setup/archive/master.zip

      Install the kali-pi kernel, download the zip, unzip it and run re4son-pi-tft-setup. That’s all you should have to do.
      Beware though, I haven’t tested it yet.

      Good luck with it,
      Re4son

    • #1450
      Re4son
      Keymaster

      The Re4son-Pi-TFT Setup Tool is now included in the Re4son Kali-Pi kernel package available here:
      http://whitedome.com.au/download/Kali-Pi-Kernels/re4son_kali-pi-tft_kernel_current.tar.gz

      It supports the following types:

      ’28r’ (Adafruit 2.8″ PID 1601)
      ’28c’ (Adafruit 2.8″ PID 1983)
      ’35r’ (Adafruit 3.5″)
      ’22’ (Adafruit 2.2″)
      ‘elec22’ (Elecfreak 2.2″)
      ‘pi70’ (Raspberry Pi 7″)
      ‘jb35’ (JBTek 3.5″)
      ‘sain32’ (Sainsmart 3.2″)
      ‘wave32’ (Waveshare 3.2″)
      ‘wave35’ (Waveshare 3.5″)
      ‘wave40’ (Waveshare 4″)
      ‘wave50’ (Waveshare 5″ HDMI)

      Some of those are still in beta. Please let me know if you encounter any problems.

      Have fun,
      Re4son

    • #1468
      Re4son
      Keymaster

      Re4son-Pi-TFT Setup Tool has been upgraded to version 1.1.2.
      I’ve received my Waveshare 3.5″, fixed one bug and tweaked some settings.
      Waveshare should work flawlessly now.

      The new version is included in the root directory of the updated kernel package:
      http://whitedome.com.au/download/Kali-Pi-Kernels/re4son_kali-pi-tft_kernel_current.tar.gz

      Or it can be pulled from my github repo:

      git clone https://github.com/Re4son/Re4son-Pi-TFT-Setup

      To setup Adafruit PiTFT 3.5″ on Kali, just run:
      ./re4son-pi-tft-setup -t 35r -u /root

      To setup Waveshare TFT 3.5″ on Kali, just run:
      ./re4son-pi-tft-setup -t wave35 -u /root

      To boot into command line, just run:
      ./re4son-pi-tft-setup -b cli

      To enable autologon for user pi, just run:
      ./re4son-pi-tft-setup -a pi

      I update this tool frequently to add features and screen support.
      You might want to update it before you run it, via:
      ./re4son-pi-tft-setup -d

      All supported screens and function are listed via:
      ./re4son-pi-tft-setup -v

      Please let us know how you go.

      Have fun,
      Re4son

    • #1527
      BX
      Guest

      Hey i have some Problems to get my 5″ waveshare hdmi to work with my pi3
      my steps are:

      fresh kali
      update
      upgrade
      install the kernel
      update your setup tool
      running the setup tool with ./re4son-pi-tft-setup -t wave50 -u /root

      Now the screen starts in the right resolution
      but it stops booting and i get w1_master_driver not registered errors
      i saw there is no /usr/share/X11/xorg.conf.d/99-fbturbo.conf after setup
      so i put this it in manually:

      Section "Device"
              Identifier      "Allwinner A10/A13 FBDEV"
              Driver          "fbturbo"
              Option          "fbdev" "/dev/fb0"
      
              Option          "SwapbuffersWait" "true"
      EndSection

      but no difference

      my /boot/config is:

      
      hdmi_group=2
      hdmi_mode=1
      hdmi_mode=87
      hdmi_cvt 800 480 60 6 0 0 0
      arm_freq=700
      start_x=1
      gpu_mem=128
      core_freq=250
      sdram_freq=400
      over_voltage=0
      dtparam=spi=on
      dtparam=i2c_arm=on
      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1

      my /etc/X11/xorg.conf.d/99-calibration.conf is:

      Section "InputClass"
              Identifier      "calibration"
              MatchProduct    "ADS7846 Touchscreen"
              Option  "Calibration"   "208 3905 288 3910"
              Option  "SwapAxes"      "0"
      EndSection
    • #1528
      Re4son
      Keymaster

      Hi BX,

      What happens if you delete everything from your /boot/config.txt and just leave this:

      dtparam=spi=on
      dtparam=i2c_arm=on
      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1

      Please let me know how you go.

      Many thanks,
      Re4son

    • #1529
      BX
      Guest

      Hey,
      Just leaving

      
      dtparam=spi=on
      dtparam=i2c_arm=on
      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1
      

      in the boot/config
      gives still w1_master_driver not registered errors
      and its not booting.
      but its again in the wrong resolution (black border on the right)

      but i tryed installing the kernel and

      hdmi_group=2
      hdmi_mode=1
      hdmi_mode=87
      hdmi_cvt 800 480 60 6 0 0 0
      arm_freq=700
      start_x=1
      gpu_mem=128
      core_freq=250
      sdram_freq=400
      over_voltage=0
      dtparam=spi=on
      dtparam=i2c_arm=on
      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1

      and

      
      dwc_otg.fiq_fix_enable=2 console=ttyAMAO,115200 kgdbox=ttyAMAO,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rootflags=noload net.ifnames=0
      

      as boot/cmdline
      without the other files or your setup-tool
      boots in the right resolution but no touch of course.

    • #1530
      Re4son
      Keymaster

      We’re getting closer 😉

      What happens when you replace the content of your /boot/config.txt with this:

      disable_overscan=1
      hdmi_group=2
      hdmi_mode=1
      hdmi_mode=87
      hdmi_cvt 800 480 60 6 0 0 0
      start_x=1
      gpu_mem=128
      core_freq=250
      sdram_freq=400
      over_voltage=0
      dtparam=spi=on
      dtparam=i2c_arm=on
      dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1
    • #1531
      Re4son
      Keymaster

      Hi BX,

      If my previous post doesn’t work you try this zip file:

      http://whitedome.com.au/download/Waveshare/Waveshare-LCD5.zip

      just run install-Waveshare5.sh

      It’s not very elegant but it should do the trick.
      Please let me know how you go and I’ll adjust the setup tool accordingly.

      Many thanks.
      Re4son

    • #1533
      BX
      Guest

      hey the install-Waveshare5.sh gives no such file errors.
      I copyed the files myself now it boots in the right resolution but i still get the w1-master driver errors and xserver is not starting.
      but now it boots and i can run a dmesg:
      [URL=http://www.pic-upload.de/view-30882536/20160607_123254.jpg.html][IMG]http://www2.pic-upload.de/thumb/30882536/20160607_123254.jpg[/IMG][/URL]
      [URL=http://www.pic-upload.de/view-30882537/20160607_123932.jpg.html][IMG]http://www2.pic-upload.de/thumb/30882537/20160607_123932.jpg[/IMG][/URL]
      thanks for your help

    • #1534
      Re4son
      Keymaster

      Oops, sorry for that. I’ve hacked the script together without testing ;-(

      Can you do me a favour please and delete the following line from your /boot/config.txt

      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1

      Just get rid of it.

      I have a suspicion that we don’t actually need it.

      Cheers,
      Re4son

    • #1536
      BX
      Guest

      fresh kali
      update & upgrade
      reboot
      mount boot
      installing the kernel
      reboot
      update
      mount boot
      update setup
      setup with -t wave50 -u /root
      and then updating all the files with the files from the zip and removing the line:

      
      dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1  
      

      results in long booting time and black screen where x should start.

      But the good news there are no w1-master errors..
      boot

    • #1540
      Re4son
      Keymaster

      Hi BX,

      awesome, we’re making progress here 🙂
      What happens if you remove the file “/usr/share/X11/xorg.conf.d/99-fbturbo.conf”.

      I always move that file to my home directory to get hdmi working. I could always copy it back when I needed but never had to.

      Cheers,
      Re4son

    • #1541
      BX
      Guest

      now it stops booting here:
      bootstop
      And my first sdcard is dead because of ~100 dd sessions.

      • #6471
        Re4son
        Keymaster

        Hi BX,

        What a bummer. I’ve been there many times.
        I am using Sandisk Ultra’s for development and testing work. I’ve bought plenty of 8GB for $3, 16GB & 32GB for $9 on sales on eBay.
        The Ultras perform almost on Sandisk Extreme Pro level when I overclock the mmc.

        I’ve included commented out lines for mmc overclocking in the latest version of the reason-setup-tool.
        Just uncomment out the line applicable to you and you’re flying.

    • #10492
      cur1ous
      Guest

      hey, would you know how to increase the console buffer in the console mode ?
      While starting console mode from the menu i don’t have enough lines to perform a wifi scan in console mode.
      Second related issue: what would be the faster way to connect to a wifi from your menu ?
      Sorry, noob here 🙂

    • #10507
      Re4son
      Keymaster

      Hi cur1ous,

      1. add fbcon=scrollback:100k to your /boot/cmdline.txt
      2. I always configure my wifi in X Window and make sure that I tick “All users may connect to this network” in “Edit Connections” (4 tabs + ENTER to get out of this window)

      That should do the trick.

      Hope that helps,
      Re4son

Viewing 26 reply threads
  • You must be logged in to reply to this topic.