pi Venus install Touch Screen (MPI3501 ILI9486 320x480 LCD) - victronenergy/venus GitHub Wiki

Setup a MPI3501 Display on Venus rpi

grab the bits we need and go to the right folder.

cd /home/root
wget http://www.lcdwiki.com/res/RaspDriver/LCD-show.tar.gz
tar -xzvf LCD-show.tar.gz
cd LCD-show

copy the overlay tft display driver to our u-boot overlay folder

cp usr/tft35a-overlay.dtb /u-boot/overlays/

add the right bits to our u-boot config

echo dtparam=spi=on >> /u-boot/config.txt
echo dtparam=i2c1=on >> /u-boot/config.txt
echo dtparam=i2c_arm=on >> /u-boot/config.txt
echo framebuffer_width=480 >> /u-boot/config.txt
echo framebuffer_height=272   >> /u-boot/config.txt
echo dtoverlay=tft35a,rotate=270 >> /u-boot/config.txt
echo display_default_lcd=1 >> /u-boot/config.txt

add the right bits to cmdline config.

echo fbcon=map:10 >> /u-boot/cmdline.txt
reboot

After rebooting...

install the drivers and touchscreen tools

opkg update
opkg install qt4-embedded-plugin-mousedriver-tslib

Install tslib stuff

opkg install tslib-calibrate
opkg install tslib-tests

config the calibrate files

TSLIB_FBDEVICE=/dev/fb0
TSLIB_TSDEVICE=/dev/input/touchscreen0
TSLIB_CALIBFILE=/etc/pointercal
TSLIB_CONFFILE=/etc/ts.conf
TSLIB_PLUGINDIR=/usr/lib/ts

run calibration

ts_calibrate

Touch the screen appropriately (after first buying it dinner and drinks, and getting consensual permission etc.)

edit the start gui script

nano /opt/victronenergy/gui/start-gui.sh

Add the following lines right after the "when headfull "comment block
Note that these require you to have calibrated the screen, saving the various calibration files as above.

export TSLIB_TSEVENTTYPE=INPUT
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/touchscreen0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export QWS_MOUSE_PROTO=tslib:/dev/input/touchscreen0

Save and exit start-gui.sh (press ctrl x, y)

mv /etc/venus/headless /etc/venus/headless.off
reboot

You should now have a display. Enjoy!