I installed Pironman system to a new virgin installation of RPi 64 bit OS fresh off the RPi website.
I then installed Pironman hardware with the default jumper settings including activating IO pin 10 for RGB output. I then installed Pironman software according to Sunfounder instructions.
The OLED display and power button work normally but the RGB strip does not work and the RGB IO appears to be on IO pin 12 which is not the default. Using pin 12 disables the analog audio output.
"WS2812 Pin Select: Raspberry Pi has three high-speed signal driving mode that can be used to drive WS2812 RGB LED strip. But these modes have other uses, and using them for WS2812 RGB LED strip will disable their original functions.
PCM (IO21) for digital audio (HDMI audio).
SPI (IO10) is used for SPI interface.
PWM (IO12) for analog audio (3.5mm audio jack).
The SPI (IO10) drive mode is selected by default. If you switch to a different pin (letâs say IO21) during the assembly process, you will also need to modify the corresponding configuration.
pironman -rp 21"
So, since I want to use the default IO10 configuration and not IO12, I went to a terminal and entered:
pironman -rp10
And I get the (grammatically incorrect) response:
pi@playroom:~ $ sudo pironman -rp10
no this command: -rp10
please run [ pironman ] or [ pironman -h ] to get help infomation
The same thing happens no matter what pin I enter, so it is obvious that the âpironman -rpxxâ command does not work.
If you look into the file ws2812_RGB.py you find this:
LED strip configuration:
LED_COUNT = 16 # Number of LED pixels.
LED_PIN = 12 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
LED_DMA = 10 # DMA channel to use for generating signal (try 5)
LED_BRIGHTNESS = 255 # Set to 0 for darkest and 255 for brightest
LED_INVERT = False # True to invert the signal (when using NPN transistor level shift)
PLEASE HOW DO I FIX THIS AND CHANGE TO PIN 10 FROM PIN 12? THANKS!
You may have cloned the wrong code branch, please check if your pironman code branch is in v2.0.
cd ~/pironman
git branch
If not, switch to v2.0 and reinstall it:
git checkout v2.0
sudo python3 install.py
In the v2.0 code, the IO10 (spi) pin is used by default to drive rgb.
The command to change the rgb IO is: pironman -rp 10
I did clone the wrong Pironman branch but I only followed your instructions verbatum as published in the installation instructions. Updating the software per the instructions above fixed the IO pin 10 issue but caused another issue. Changing Pironman parameters using âsudo pironman -xxâ no longer works and the app loads the defaults from main.py no matter what. Running main.py from Geany to debug gives this output:
------------------------23/07/24 16:35:43------------------------
pironman version: 2.1.2
username:
config_file: /root/.config/pironman/config.txt
OS Version:
No LSB modules are available.
Description: Debian GNU/Linux 11 (bullseye)
PCB info:
Revision : c03112
Model : Raspberry Pi 4 Model B Rev 1.2
23/07/24 16:35:43,416 [DEBUG] Configuration file does not exist, recreating âŚ
Traceback (most recent call last):
File â/opt/pironman/main.pyâ, line 61, in
os.mkdir(â%s/.configâ%user_home)
PermissionError: [Errno 13] Permission denied: â/root/.configâ
(program exited with code: 1)
Press return to continue
I can change the settings by editing main.py but using sudo pironman -xx no longer works.
This is the problem I experienced at least two times.
When Pironman is reinstalled (I has to reinstall per your instructions because github seems to default to version 1.x instead of 2.x when I follow your instructions) the reinstallation of 2.x proceeds without errors but now I can no longer change the parameters using âsudo pironman -xxâ and it always loads the default values hard coded into main.py. My investigation shows that /boot/.config/pironman/config.txt is no longer modified by âpironman -xxâ commands and main.py does not load config.txt at any rate because it cannot open the file.
Running main.py in Geany allows you to see any errors and it exits with this:
23/07/24 16:35:43,416 [DEBUG] Configuration file does not exist, recreating âŚ
Traceback (most recent call last):
File â/opt/pironman/main.pyâ, line 61, in
os.mkdir(â%s/.configâ%user_home)
PermissionError: [Errno 13] Permission denied: â/root/.configâ
(program exited with code: 1)
Press return to continue
A complete uninstall of pironman is challenging because it is installed using a python script so i can only install over the old version.
If you use sudo for running pironman, it takes the config file from â/root/.config/pironman/config.txtâ. What I did was to create a link from my home directory so both files are in sync.
We modified the code to change the path to the configuration file to /opt/pironman/config.txt, so that it will not be affected by the different username of the runtime environment. Please pull or clone the code again and install it:
cd ~/pironman
git pull
sudo python3 install.py
Note that since rgb requires root privileges to work, rgb may not work if the program is running in Geany.
regarding the fact that you started cloning the wrong branch according to the tutorial, we checked the online tutorial and it seems that we didnât find any error, if you can please let us know some information so we can fix the error.
Thank you so much. This change seems to have fixed the inconsistencies with the led lights.
Regarding the version issue with git, you might just want to add the latest pull to your instructions just to be safe before running âinstall.pyâ
Meanwhile - another suggestion - add to your instructions that when âcolorfulâ is chosen as the mode, the -rc command to set the color has no effect. This may seem obvious to you but not always to naive users like me.
I have a lot of experience as a programmer/engineer but I am an old man so I have expertise mostly in C/C++ and I am not familiar with Python but thanks to you guys, I have learned a little.