I have a Raspberry Pi 4B with a Bitwizard DMX Hat which uses the serial port. I try to output DMX from the board to a LED light using QLC+ software, but it's not working. I tried some commands and I think I messed something. I read somewhere that the Pi4 have 2 serial bus, and that the default one has changed vs the Pi3. In QLC+, some people say that I just need to check the serial0 in the list, but it's not there.
Right now ls -l /dev
is telling that serial1=ttyS0, and there's no ttyAMA0 (continue reading)
Here are the commands I tried:
First I installed i2c tools (because I use another Hat for Relays):
sudo apt-get install i2c-tools -y
I edited /boot/config.txt to uncomment the line "hdmi_force_hotplug=1" because I want to use the Pi headless. And I added the following line at the end of the file :
enable_uart=1
I then configured the board to output DMX (by default it's configured to have only DMX input). I added these lines in the file /etc/init.d/qlcplus just before the line beginning with QLCPLUS_OPTS
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
Next, it seems that we have to disable bluetooth because it uses the serial port, so I added these lines at the end of /boot/config.txt
dtoverlay=pi3-disable-bt
dtoverlay=pi4-disable-bt
dtoverlay=disable-bt
Next I enabled UART
sudo wget https://raw.githubusercontent.com/itemir/rpi_boat_utils/master/uart_control/uart_control
mv uart_control uart_control.sh
sudo chmod -x uart_control.sh
sudo ./uart_control.sh gpio
Next, a website say that I need to disable the Pi Serial interface, in order so it's free to use by the Hat. I entered raspi-config and disabled Serial in the interfaces.
Next I disabled the modem service, so that the UART is free.
sudo systemctl disable hciuart
sudo systemctl disable [email protected]
Next, I changed the /boot/config.txt file to :
- Remove line "console=ttyAMA0,115200
- Add line "init_uart_clock=16000000
I rebooted, and it's not working. In QLC+, I don't know what to select in the outputs. The UART line has no device to it, so I can't select it. I tried ticking the GPIO line but it's not working. And there is no Serial line to tick.
Any help would be much appreciated!
This is the Bitwizard board I use https://bitwizard.nl/shop/DMX-interface-for-Raspberry-pi
=========== UPDATE
So I started over on a fresh Buster install like @Milliways suggested. This time I have not installed third party softwares, except for QLC software and its dependencies.
Here is what I've done
In raspi-config, I enabled serial port without serial console.
In the /boot/config.txt file,
I added line dtoverlay=pi3-disable-dt
as per the QLC doc for Bitwizard board.
The line enable_uart=1
was already active, so no change for that.
I added these lines to /etc/init.d/qlcplus to tell Bitwizard to emit DMX signal
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
In QLC, I selected UART on ttyAMA0 as the device to use.
The link posted by @Milliways was of good help for the last part.
Step 5 was required to make it work, so I had to remove console=tty1
from the /boot/cmdline.txt file.
It's working now!