UltiCon Setup Menagerie - Raspberry Pi and the UCTRONICS Screen
I ordered a 64GB SD card to transplant my project (read: collection of crappy PoC programs) so I had to get the RasPi again which is kind of a perfect opportunity to show how to get your Raspberry Pi up and running.
I usually prefer to start in headless mode. If you’re more comfortable with a GUI, it’s totally fine, don’t let anyone bully you into using command line. Just do it because you want to learn it. It comes with the benefit that, if you don’t use X you get some performance gains, though I’m not sure how much (let’s run metrics someday!).
These will be instructions for a Linux computer since that’s my daily driver. If you haven’t tried Ubuntu these days or encountered a million problems in the past, trust me when I tell you it’s very approachable these days and very stable.
Let’s Setup Headless Mode!
Okay so let’s setup headless mode. You can also find these instructions on the Raspberry Pi Foundation website: https://www.raspberrypi.org/documentation/configuration/wireless/headless.md
1. Download a Lite version of Raspberry Pi OS from The Foundation https://www.raspberrypi.org/downloads/raspberry-pi-os/
2. Flash it to your SD card
Find your SD card first in /dev. For this, I like to be doubly sure by either opening GParted (a GUI program that allows you to format disks in certain ways but also shows the size of disks) or running fdisk -l to find the disk that is the right size. For me, that is located at /dev/mmcblk0. Replace that as needed in the command below
dd bs=4M if=2020-02-13-raspbian-buster-lite.img of=/dev/mmcblk0 conv=fsync
It will be completely quiet until you get a new prompt which means it’s finished.
3. Once you’ve done that, let’s get it ready so that you can access it. The first thing you want to do is make sure you get ssh access.
Mount the partition named “boot” from the SD card and, cd into that directory, and create an empty file called ssh
cd /mnt/boot
sudo touch ssh
4. Next, in the same directory, make a file called wpa_supplicant.conf and put in your wifi credentials and the country code for the country in which you live. This will make it connect to your wifi immediately upon booting. I have a file I always copy that looks like this.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=US
network={ ssid="greatestSsidNameEver" psk="superstrongpassword" }
But change your country code, ssid, and psk as appropriate.
That’s it for headless mode. Plug it into your pi, let it boot and then you can ssh into it!
First Pi Things to Do
I didn’t really mean for this to turn into a Pi tutorial but here we are.
The first thing you want to do when you get into your pi is to change yuor password using
passwd
Next up, make sure your filesystem is expanded so that you get to use all of that space.
First launch raspi-config
sudo raspi-config
Then hit “Advanced Operations”
Then “Expand Filesystem”
hit Yes, Finish, then let it reboot.
Now, it’s always a good idea to install git but it will also be needed for the UCTRONICS screen. Run
sudo apt install git
Finally, update everything with
sudo apt update
sudo apt upgrade
Getting the UCTRONICS Screen Working
So I don’t put the device on the headers first. I start with just HDMI first and make sure I can flip it and get the scaling right.
When you first plug it in it looks like this:
What we’re going to do is pull scripts from github and then run them to basically just set the screen settings on boot.
1. Clone the repo
git clone https://github.com/UCTRONICS/UCTRONICS_LCD35_HDMI_RPI.git
It gives you a new folder called UCTRONICS_LCD35_HDMI_RPI which contains a README.md. I shouldn’t have to tell you to read it but, if you don’t, I’ll copy the instructions down here:
Go into the Raspbian directory within that folder
cd UCTRONICS_LCD35_HDMI_RPI/Raspbian/
Make the scripts executable
sudo sed -i -e 's/\r$//' *.sh
chmod +x *.sh
Backup your settings
sudo ./backup.sh
And finally, install the driver.
sudo ./install_uc_touch_180.sh
That will trigger a reboot and, when everything comes back up, it should be at a size that you can read. The problem I found was that whether I ran install_uc_touch_0.sh or install_uc_touch_180.sh, it would be the same direction so I ended up also having to edit /boot/config.txt
sudo nano /boot/config.txt
and then add at the end of the file
display_rotate=2
for 180 degree rotation on every boot.
And that’s it! Now it looks like this.
Alright, we’re at a fantastic starting point for the next steps. Tune in next week for more and, for the most up-to-date code, I’m keeping my repo updated with all my tests so feel free to check it https://github.com/amckeeota/UltiCon
Til next time!















