Installing Automation Hat Mini on Pi Zero with Dietpi

Hi
I’m using a headless Pi zero via wifi with DietPi, I2C, GPIO enabled and Python3 installed
Before going down the trial and error route, I’ve a couple of questions regarding the setup as the documentation is minimal.

  1. The HAT install script will not run a root user and suggests use sudo. Do I need to run the install script as sudo or can I run as a normal user?

  2. I’d rather just use Python3. Is Python2 required as the install script asks?

  3. Display: I presume I need to run the ST7735 install script, However, prior to runnning any HAT install scripts, the display shown no sign of life is that ok?

Thanks in advance for your help

I don’t do sudo when running the curl bash installs.
curl https://get.pimoroni.com/automationhat | bash
I’ve had no issues using python 3 with other Pimoroni products. I don’t own an Automation Hat MINI, just so you know.
The display will be blank, all you will see is the backlight when you power up the Pi. Even after running the ST7735 install script it won’t do anything until “YOU” tell it too by running code for it. It’s on the SPI bus. If your having issues double check that SPI and i2c are enabled in raspi-config.

@alphanumeric
Thanks for reply on sudo, but the script installs I thought it may require sudo (I’ll try without).
I am using Dietpi, so the config menu is slightly different, will need to find if SPI is enabled, (GPIO & i2C are enabled).
I noticed the serial UART is disabled in Dietpi setup, would that be it?
When I say the display shows no sign of life, exactly that. I would have expected to see the backlight or something.
I’ll have a play.

You may get errors with the install because its DietPi? The installer is written for Raspbian / PiOS. You may also be missing some dependencies. You won’t know until you run the installer. serial UART isn’t SPI.
You may have to look close to see if the backlight is on? The screen will be black / blank.
I have a bunch of the 0.96 160x80 LCD display breakouts. It’s the same one used in numerous Pimoroni pHats / mini’s. You can run those examples on it, might have to edit them to match what pins are used for it by the Automation Mini. CS and backlight, etc
st7735-python/examples at master · pimoroni/st7735-python · GitHub

Looks like it uses SPI0, CE1 and GPIO 25 for the backlight.
Automation HAT Mini at Raspberry Pi GPIO Pinout

Thanks your help as been usefull.
FYI Dietpi is really just a front end menu system for Raspian / PiOS but you a right about potential dependencies. however install seemed to work without errors.
I did swap sd card and successfully got it working on PiOS light.
Going back to dietpi version, it looks like I have permission errors

input.py

This Automation HAT Mini example displays the status of
the three 24V-tolerant digital inputs.

Press CTRL+C to exit.

Traceback (most recent call last):
  File "input.py", line 34, in <module>
    spi_speed_hz=4000000
  File "/usr/local/lib/python3.7/dist-packages/ST7735/__init__.py", line 156, in __init__
    self._spi = spidev.SpiDev(port, cs)
PermissionError: [Errno 13] Permission denied

I need to play a bit more

I believe what ever user you are running as needs to be added to the ‘spi’ user group to have the necessary permissions to access the spi interface.

something like:

sudo adduser foo spi

will also need to do the same for gpio and i2c groups.

HTH.
-Pach

Just FYI, I’ve had no issues accessing SPI and i2c when logged in as the default standard user. I have a triple display setup on SPI1 and a dual display setup on SPI0, using those 0.96 160 x 80 LCD’s.
I can run my code and Pimoroni examples without the need for sudo.
This is on PiOS with desktop. On my headless setups I just set it to boot to command line instead of the desktop GUI. I have no idea what DietPi does or doesn’t do to a stock setup though?

Dietpi is a highly optimised version of rasbian lite.
Managed to get it working on Rasbian lite std with your help from another post (thanks @alphanumeric) , and then worked out what was missing on Dietpi, including fixing permissions.
The Pimoroni scripts failed on first run so I installed some packages from the Dietpi menu to ensure they were corrently installed.
Then finished off with the Pimorini scripts for the final configuration.
It was a long winded install, a lot of duplication but it worked.
If anybody is interested I can put together a guide.
Generally I find the Dietpi Raspbian install far better then the stock one.