I realized that the 4th corner screw hole of Pi Zero was still unused and tried to connect and use a 2nd display. A second M3 screw allowed to do that, this is back view showing both displays just after bootup with "/dev/fbi" framebuffer indicators:
First I learned how to connect a ili9341 display to SPI1 instead of SPI0 in this posting:
Then it was not that easy to drive two displays with Pi Zero because the "sudo modprobe fbtft_device ..." method allows for one framebuffer only. I asked and got great help from DirkS on how to use device tree overlay to bring up one display during boot in this thread:
Here you can see front view. As you can see I superglued a 2nd 2x4+1 Pi Zero SPI to 9x1 ili9341 connector:
On pins 33-40 there are two GND and no 3V3. Therefore I used 7 male pins on the Pi side, and a female connector on pin 34 which therefore has no connection to GND and is just there for the compact 2x4 form factor. I soldered a small cable to it on the side, connecting with 3V3 on pin 01.
In the thread where I got help from DirkS you can find the device tree overlay I created for the first ili9341 display connected to SPI0. These are the relevant lines of "/boot/config.txt":
Code: Select all
The first two lines enable SPI, and enable SPI1 interface with 3 chip select lines. Then the dtoverlay and dtparam lines enable first display on SPI0.
The last lines of "/etc/rc.local" show how the display startup works, especially how the 2nd display on SPI1 gets stared, and how gstreamer pipeline gets started:
Code: Select all
[email protected]:~ $ tail -11 /etc/rc.local
tail --bytes 153600 /home/pi/fb1.565.bmp> /dev/fb1
sudo modprobe fbtft_device name=rpi-display gpios=reset:13,dc:26,led:28 rotate=270 cs=2 busnum=1
tail --bytes 153600 /home/pi/fb2.565.bmp> /dev/fb2
sudo gst-launch-1.0 -v v4l2src device=/dev/video0 do-timestamp=true ! video/x-raw,width=320,height=240,framerate=10/1 ! tee name=t ! queue ! edgedetect ! videoconvert ! fbdevsink device=/dev/fb1 t. ! clockoverlay shaded-background=true font-desc="Sans, 48" ! videoconvert ! fbdevsink device=/dev/fb2 2>&1 > /dev/null
[email protected]:~ $
For the gstreamer pipeline to work, v4l2 module needs to be loaded during boot:
That is all, the gstreamer pipeline uses two plugins in order to create two views on the two displays of the video taken from v1 Raspberry camera. On left display you see the video with clockoverlay plugin, on the right you see edge detection plugin "edgetv" at work. "tee" plugin allows to do both in same pipeline:
Of couse the 2nd display can be used differently, eg. for displaying statistics of the video from first display.