joljols
Posts: 8
Joined: Thu Oct 30, 2014 9:41 am

Control head light from rpi via dmx

Mon Jun 11, 2018 6:58 pm

Hi, I recently bought a RS422 / RS485 Serial HAT shield for my rpi to control a dmx head light. With an arduino I have been able to control the head light channels (horizontal movement, vertical movement, brightness, flicker) using the DmxSimple library, like e.g.

#include <DmxSimple.h>
byte i = 0;
int X = 0;
int Y = 0;

void setup() {
DmxSimple.usePin(3);
DmxSimple.maxChannel(60);
DmxSimple.write(3, 255);
DmxSimple.write(4, 255);
}

void loop() {
// Random movement for both axes
X += random(10);
Y += random(10);
DmxSimple.write(1, X);
DmxSimple.write(2, Y);
delay(100);
}

I would like to command the light from my rpi, ideally using python, to be able to have more dynamic control over the light. My knowledge about Dmx is however limited and I have no idea when I connect the RS485 Serial HAT how I can write a simple script like on arduino to control the light. I can follow the steps about setting-up the board here http://www.instructables.com/id/How-to- ... pberry-Pi/ but what do I do next? How can I send bytes to the light over dmx from rpi like with my arduino script?

Any help is appreciated

User avatar
Arjan
Posts: 256
Joined: Sat Sep 08, 2012 1:59 pm

Re: Control head light from rpi via dmx

Tue Jun 12, 2018 11:13 am

Hi Jolle,

In Linux, doing DMX out only, using the native UART, then the best option is to install OLA -> https://wiki.openlighting.org/index.php ... berry_Pi_3

- Arjan
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions

joljols
Posts: 8
Joined: Thu Oct 30, 2014 9:41 am

Re: Control head light from rpi via dmx

Tue Jun 12, 2018 11:22 am

Thanks Arjan,

I have more or less no knowledge of using UART. How can I send simple commands via python to the dmx channels?

I found out about pySimpleDmx (https://github.com/c0z3n/pySimpleDMX), which requires the COM port number, the shield documentation says it uses GPIO18. Do I use specify that?

Or is there a more simple way to send bytes via python to that GPIOpin?

Many thanks!

User avatar
Arjan
Posts: 256
Joined: Sat Sep 08, 2012 1:59 pm

Re: Control head light from rpi via dmx

Tue Jun 12, 2018 4:00 pm

http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions

mushu999
Posts: 19
Joined: Sun Aug 20, 2017 11:24 pm

Re: Control head light from rpi via dmx

Wed Jun 13, 2018 3:59 am

I suggest you might find something useful on this site: https://learn.adafruit.com because they focus on beginners with Arduino/Rpi. Owner is very liberal-progressive but if you can ignore that stuff, the tech is fun and there is a lot of information available for someone who wants to take the time to read.

User avatar
Arjan
Posts: 256
Joined: Sat Sep 08, 2012 1:59 pm

Re: Control head light from rpi via dmx

Wed Jun 13, 2018 5:22 pm

mushu999 wrote:
Wed Jun 13, 2018 3:59 am
I suggest you might find something useful on this site: https://learn.adafruit.com because they focus on beginners with Arduino/Rpi.
There is no DMX stuff on Adafruit. The best option to look for OLA information is the OLA website https://www.openlighting.org/ola/tutori ... pberry-pi/
I have also an how-to for installing OLA on the Raspberry Pi -> http://www.raspberrypi-dmx.org/raspberr ... spberry-pi
It explains the native UART as well.
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions

joljols
Posts: 8
Joined: Thu Oct 30, 2014 9:41 am

Re: Control head light from rpi via dmx

Fri Jun 22, 2018 7:06 pm

I am still having trouble to communicate with my headlight. This is what I have done:

- I followed the steps here https://www.openlighting.org/ola/linuxinstall/#Git and here https://opendmx.net/index.php/OLA_Python_API to install ola python api. This was successful.
- I ran the "ola_universe_info.py" file in the github python examples directory. This shows:
Universe 0
- Name: Universe 0
- Merge mode: LTP
- Output ports:
- Port(id=0, universe=0, active=True, description="/dev/ttyAMA0", supports_rdm=False)
- I then ran the file

Code: Select all

ola_send_dmx.py
in the same examples directory, making sure to change universe to 0, in line with above. (running like:

Code: Select all

python ola_send_dmx.py
in terminal over ssh)
- The terminal then shows "Success!" but nothing happens with the light
- The light always shows A001 also indicating the light is connected and listening.

I would really appreciate any help to get this working, especially now it seems I am so close. Arjan, do you have any idea what is going wrong? Many thanks

Update:
- Starting ola by typing in

Code: Select all

olad -l 3
in terminal and then trying the script again it still does not do anything
- Going to the OLA admin in the browser I am able to change the lights with the DMX console
- Running the example script again (and still with the "Success!" message) the values in the DMX console do not change

User avatar
Arjan
Posts: 256
Joined: Sat Sep 08, 2012 1:59 pm

Re: Control head light from rpi via dmx

Sat Jun 23, 2018 8:26 pm

It is best to ask your question with the OLA users on https://groups.google.com/forum/#!forum/open-lighting

Then please do add the log for ola -l 4

Show that your output device is up-and-running. This can also be done using the OLA GUI.
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions

Return to “Troubleshooting”