I am attempting to run a Python script on a Raspberry PI 5. The software is at https://gethub.com/sunfounder/pironman5.git -depth 1. The error message is
Traceback (most recent call last):
File “/home/pi/pironman5/install.py”, line 6, in
from pironman5.variants import NAME, DT_OVERLAYS, PERIPHERALS, VARIANTS
File “/home/pi/pironman5/pironman5/variants/init.py”, line 119, in
NAME = VARIENT.NAME
^^^^^^^^^^^^
AttributeError: ‘NoneType’ object has no attribute ‘NAME’
pi@raspberry5:~/pironman5 $
There is a typo in the code: VARIENT (misspelled) instead of VARIANT.
Running this line patches the code, allowing the script to continue with my device type of “0316” assigned to Pironman5Max. BUT, I have a Pro Max.
sed -i ‘s/elif variant_id == “0308”:/elif variant_id == “0316”:\n return Pironman5Max\n elif variant_id == “0308”:/’
~/pironman5/pironman5/variants/init.py
After running this line, the installer works. This code finds the device ID:
python3 -c "
import os
hat_path = ‘/proc/device-tree/hat_type1’
for fname in [‘product_id’, ‘product_ver’, ‘product’, ‘vendor’, ‘uuid’]:
fpath = f’{hat_path}/{fname}’
if os.path.exists(fpath):
with open(fpath, ‘rb’) as f:
raw = f.read()
print(f’{fname}: raw={raw} hex={raw.hex()}')
"
variant ID “0316”
version “V10”
product: Piroman 5 Pro Max
After all this - no LEDs or screen. The local website works - http://localhost:34001