BitWizard DMX Interface: Difference between revisions
mNo edit summary |
Annegret04 (talk | contribs) No edit summary |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
The '''BitWizard DMX interface''' is an HAT (hardware attached on top) extension board for the Raspberry Pi <ref>[[wikipedia:Raspberry_Pi]]</ref>. |
The '''BitWizard DMX interface''' is an HAT (hardware attached on top) extension board for the Raspberry Pi <ref>[[wikipedia:Raspberry_Pi]]</ref>. |
||
== Installation |
== Installation notes == |
||
=== GPIO configuration === |
|||
⚫ | |||
=== |
==== Raspberry Pi OS ==== |
||
⚫ | For the BitWizard HAT to function it has to be set to ''output mode'' via the GPIO <ref>[[wikipedia:General-purpose_input/output]]</ref> pins. There are a number of programms which enable you to configure the GPIO pins. |
||
In this example we use ''pigpio'' <ref>http://abyz.me.uk/rpi/pigpio/</ref> to configure the GPIO pins. To install pigpio on your Raspberry Pi either open a terminal window or connect to the Pi via SSH and type: |
|||
⚫ | |||
⚫ | |||
==== Output mode ==== |
|||
Then we create a ''shell script'' <ref>[[wikipedia:Shell_script]]</ref> which will configure the GPIO pins when we run the script. Let's call the script ''bitwizard_gpio.sh'' |
Then we create a ''shell script'' <ref>[[wikipedia:Shell_script]]</ref> which will configure the GPIO pins when we run the script. Let's call the script ''bitwizard_gpio.sh'' |
||
Line 32: | Line 33: | ||
Now the pin configuration is changed and the BitWizard DMX HAT should work. |
Now the pin configuration is changed and the BitWizard DMX HAT should work. |
||
==== Creating a cron job ==== |
|||
The changes to the GPIO pin configuration are not persistent. This means that we have to run the script again after we rebooted the Raspberry. To automate this task we create a cron job <ref>[[wikipedia:Cron]]</ref> which runs our script after reboots. |
|||
There are multiple ways to create a cron job. We choose to create a cron job file in /etc/cron.d and name our file ''bitwizard_gpio_cron''. |
|||
'''''Caveat:''''' Files in /etc/cron.d have to follow a naming convention or they will be ignored. The filenames may constist of ASCII upper- and lower-case letters, ASCII digits, ASCII underscore and ASCII minus-hyphen. |
|||
/etc/cron.d/bitwizard_gpio_cron contains: |
|||
@reboot root /path/to/bitwizard_gpio.sh |
|||
==== Troubleshooting ==== |
|||
If the the cron job doesn't seem to work, look in the system log file for error messages: |
|||
sudo less /var/log/syslog |
|||
== See also == |
== See also == |
||
Line 39: | Line 58: | ||
<div class="references-small"><references /></div> |
<div class="references-small"><references /></div> |
||
== External |
== External links == |
||
http://bitwizard.nl/wiki/Dmx_interface_for_raspberry_pi |
http://bitwizard.nl/wiki/Dmx_interface_for_raspberry_pi |
||
[[Category:Lighting |
[[Category:Lighting Control]] |
Latest revision as of 11:36, 15 April 2021
The BitWizard DMX interface is an HAT (hardware attached on top) extension board for the Raspberry Pi [1].
Installation notes
GPIO configuration
For the BitWizard HAT to function it has to be set to output mode via the GPIO [2] pins. There are a number of programms which enable you to configure the GPIO pins.
Raspberry Pi OS
In this example we use pigpio [3] to configure the GPIO pins. To install pigpio on your Raspberry Pi either open a terminal window or connect to the Pi via SSH and type:
sudo apt install pigpio
Then we create a shell script [4] which will configure the GPIO pins when we run the script. Let's call the script bitwizard_gpio.sh
#!/bin/bash pigpiod sleep 1 pigs m 18 W pigs w 18 1 pigs m 14 0 pigs m 15 0 systemctl restart olad
Caveat: We presume your shell is Bash [5]. If you use another shell change the first line of the script accordingly. We also presume that you have either Open Lighting Architecture (OLA) [6] or QLC+ [7] installed on your Raspberry.
Then make the script executable:
sudo chmod +x bitwizard_gpio.sh
Run the script with:
sudo ./bitwizard_gpio.sh
Now the pin configuration is changed and the BitWizard DMX HAT should work.
Creating a cron job
The changes to the GPIO pin configuration are not persistent. This means that we have to run the script again after we rebooted the Raspberry. To automate this task we create a cron job [8] which runs our script after reboots.
There are multiple ways to create a cron job. We choose to create a cron job file in /etc/cron.d and name our file bitwizard_gpio_cron.
Caveat: Files in /etc/cron.d have to follow a naming convention or they will be ignored. The filenames may constist of ASCII upper- and lower-case letters, ASCII digits, ASCII underscore and ASCII minus-hyphen.
/etc/cron.d/bitwizard_gpio_cron contains:
@reboot root /path/to/bitwizard_gpio.sh
Troubleshooting
If the the cron job doesn't seem to work, look in the system log file for error messages:
sudo less /var/log/syslog