Tontec Touch Screen Set Up
Having purchased a Tontec Touch Screen (Model MZ61581) for the Raspberry Pi from Amazon I went about following the instructions found via the product description. These instructions are what I used for the Raspberry Pi 2 (or Model B+). I was using the 2015-05-05 version of raspbian-wheezy.
My screen was installed as below
***The unmodified instruction file can be downloaded at https://s3.amazonaws.com/ttbox/35screen.zip
1. Initial Config of New Raspberry Pi Install
After booting your Raspberry Pi for the first time on Raspbian-Wheezy, we will need to perform the normal tasks of setting up our Raspberry Pi. including: expanding the filesystem; and setting the timezone.
You also need to set the date correctly as otherwise the rpi-update command in step 3 will error with tar timestamp is in the future. The following instructions taken from this Stack Exchange Post explain what we need to do:
Go to http://support.ntp.org/bin/view/Servers/NTPPoolServers, select your region, then your country and a list of servers will be display. Now edit your /etc/ntp.conf file e.g.
sudo nano /etc/ntp.conf
Replace the list of servers with the one you found in the webpage. e.g.
server 0.uk.pool.ntp.org iburst server 1.uk.pool.ntp.org iburst server 2.uk.pool.ntp.org iburst server 3.uk.pool.ntp.org iburst
Save and exit.
Before restarting the ntp deamon I would advise setting your time manually to a time close to the current time. Apparently if the pi time is too different to ntp time it will not sync and my investigations seem to support this.
date -s "8 Jul 2015 19:00:00" sudo /etc/init.d/ntp restart
check that the date is correct. There maybe some delay in it setting and you could also reboot.
date
2. Update and upgrade the Raspberry Pi Install
Then we need “update” and “upgrade”. If you want to learn more about the update, upgrade and rpi-update process read Michael’s post on the subject.
sudo apt-get update
sudo apt-get upgrade
sudo reboot
3. Update Firmware
We now need to update our firmware to the newest version to support Tontec screen. Check that your date is correct (step 1) before starting this process.
sudo rpi-update
My first attempts failed with a white screen on the Tontec. Further investigation via the main HDMI showed that the boot sequence was freezing on fbtft_register_backlight:
(Edit) This is actually normal behaviour and once the Tontec screen was working the main screen still froze at this point. I contacted iTonTec support and they suggested running
sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update
instead of the plain rpi-update, which appeared to make the difference.
sudo reboot
4. Enable SPI and set overlay for Tontec MZ61581 Screen
Open Raspi-Config and set the following on:
Thanks to the amazon commenters for this as it was missing from the user guide.
Open /boot/config.txt
sudo nano /boot/config.txt
And add these lines to the bottom
dtparam=spi=on
dtoverlay=mz61581
Then save and reboot
sudo reboot
4. Set Tontec 3.5 Screen as the default display instead of HDMI
Here we will change the default output display from HDMI to Tontec Screen
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf
Change
Option "fbdev" "/dev/fb0"
To
Option "fbdev" "/dev/fb1"
Note: if you want to switch back to the HDMI display, just change it back to fb0
5. Edit cmdline.txt
Here we will enable Tontec Screen to display during the booting process
sudo nano /boot/cmdline.txt
Add
fbcon=map:10
at the end of current line. (No need to start a new line)
6. Reboot
Done!
Touch Calibration (optional)
If you need to calibrate the touchscreen for X, Please download the instruction at http://s3.amazonaws.com/ttbox/35calibrate.zip
Thank you very much for the REPO_URI trick! I recover my touch screen from the latest rpi-udpate (4.0.6).
Is it possible to have the same output to both the LCD and HDMI port?
Thanks for the instructions. The picture and URI trick were very helpful.
I got yellow lines across the screen. Tech support gave me the following fix:
sudo rpi-update
cd /boot/overlays
sudo rm mz61581-overlay.dtb
sudo wget http://www.itontec.com/mz61581-overlay.dtb
This setup worked for me (Rasbian Jessie)
Thank you so much!
did you manage to calibrate your screen? I followed the instructions in the document provided by tontec but the option “calibrate touchscreen” is not available in the menu…
Great Summary – worked fine for jessie and Raspi3 🙂 Thank you! BTW: The tontech docx files are not viewable on a mac – don’t know why they do not publish them as pdf, html or .md documents… :->
Hallo cayman, I could start the calibration from a SSH-session via the command
DISPLAY=:0.0 xinput_calibrator
After that you have to add the config-snipped dumped to the console on raspian to the file nach /usr/share/X11/xorg.conf.d/99-calibration.conf to make it persistent.