Unable to Install Driver for Waveshare 3.5-Inch Touchscreen on BalenaOS

Hello Balena Community,

I’m working on setting up a Waveshare 3.5-inch touchscreen display on my Raspberry Pi with BalenaOS, and I’m having difficulty installing the driver and configuration. I’m new to working with microcontrollers and Balena, so any help would be greatly appreciated!

Here’s a summary of my setup, the steps I’ve taken, and the issues I’m running into.

Setup and Context

  • Display: Waveshare 3.5-inch touchscreen
  • Additional Hardware: MCP2515 CAN controller over SPI, which requires its own device tree overlay.
  • Image Tested: I’ve loaded a standard Raspberry Pi OS image from Waveshare, and the display works as expected, so I believe the hardware is fully functional.

Configurations and Attempts

Following theWaveshare Wiki instructions, I initially tried to install the driver on BalenaOS using Git. Since I couldn’t get Git working directly on the Host OS, even through Docker, I attempted to set things up manually by copying the waveshare35a.dtbo file into the overlays folder and modifying config.txt to include the necessary display and CAN configuration parameters.

I also tried setting up the display through Balena Cloud configuration variables, including BALENA_HOST_CONFIG_dtoverlay=waveshare35a and various display settings, but the display still doesn’t function.

This is my config.txt file

# Display Configuration for Waveshare 3.5 inch Display
hdmi_cvt=480 320 60 6 0 0 0
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=87

# I2C, SPI, Audio, and UART Configuration
dtparam=i2c_arm=on
dtparam=spi=on
dtparam=audio=on
enable_uart=1

# GPU Memory Allocation
gpu_mem=16

# CAN Bus Configuration for MCP2515
dtoverlay=mcp2515-can0
dtparam=oscillator=12000000
dtparam=interrupt=25
dtparam=spi1-1cs
dtparam=spimaxfrequency=100000

# Waveshare LCD Overlay
dtoverlay=waveshare35a

Is there a way to enable Git directly on the Host OS, or could anyone suggest a reliable method for accessing resin-boot on BalenaOS? Alternatively, if there’s a different approach to install and persist the Waveshare touchscreen driver, I’d be grateful for any guidance.

Thank you in advance for your help!

Hello, the OS is read only by design so you can’t install Git on the OS, but you can install it in your container. I would try the display first without any configuration if you haven’t already. I’ve found that many work out of the box with the drivers already included in the OS.

If you find that you need to add an overlay though, see this section of our docs for more details. Also, you should only modify the config.txt file before the first boot. After the device has been provisioned, you can use the configuration tab on the dashboard. (More details here)

Finally, here are some other threads with similar questions and answers: