Giter VIP home page Giter VIP logo

esp-dmx's Introduction

DMX Library for Arduino with ESP8266

The DMX library allows sending data from Serial1 in DMX format.

For more information about this library please visit us at https://github.com/Rickgg/ESP-Dmx

Installation

To use, download and move the folder to your Arduino/libraries location, and restart the Arduino IDE.

API

  • init(channels) Starts the DMX library with Serial1. If no channels are given, defaults to 32.

  • write(channel, value) Writes a value to DMX buffer.

  • update() Calls for the DMX buffer to be sent. Currently, it has to be called inside the main loop.

  • end() Ends ESPDMX controller.

License

Copyright (C) 2015  Rick <[email protected]> (edited by Marcel Seerig)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

esp-dmx's People

Contributors

mseerig avatar slomusti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp-dmx's Issues

ESP connection DMX

Hi,
can anyone please show me and explain how to connect my ESP8266 running ESP-DMX with a DMX controlled device as a Led Light...

What to do with the ESP output ... i need 2 wires + GND right?

Secondary DMX master - detect other masters

Has anyone setup this library as a DMX master that listens on the bus for other masters and disables it's sending accordingly? Ultimately, I'm looking for a DMX Arduino that only sends data when the main DMX mixer is off.

example code

Hi

Please can add to this library some example code as if the library she used sACN or ArtNet protocol ?.

unable to address 512th channel

I am unable to address the 512th DMX channel.

When writing to 4 channels, i need to dmx.init(5).
So with dmx.init(512) i can write to the first 511 channels. With dmx.init(513) it defaults back to 32 (as by design).

Maybe Error in calculation of "chanSize" ?

First of all: thanks for your great library!
I tested it and found it working fine for the first 31 dmx channels, but there was no output beyond 31... (although I initiated it with .init(512) ).

A further look into the code revealed, that you calculate "chansize" as following:

    if (chanQuant < dmxMaxChannel || chanQuant <= 0) {
        chanQuant = defaultMax;
      }
      chanSize = chanQuant;

In this case, chanSize will always be set to defaultMax (which is 32), even if it is between 32 and 512.
So I think it should have been ">" instead of "<" to prevent entering numbers higher than dmxMacChannel:

    if (chanQuant > dmxMaxChannel || chanQuant <= 0) {
        chanQuant = dmxMaxChannel;
    }

I will test it with these changes on transmitting more than 32 channels and report later...

Accessing dmxData from main.cpp

I know this is my ignorance but I want to be sure to do this correctly. I want to access dmxData[] from my own main.cpp so I can save the data to a file.

I don't need everything, I just need to know the syntax to access dmxData from main.cpp. Thanks for your help!

circuit

have someone a circuit how to hook up the wires to my max3485 chip?

Auto Update

Add auto update feature, so it doesn't need to be called in the main loop().

ESP-DMX RESET

get some warnings in all versions:

In file included from /tmp/.arduinoIDE-unsaved2023323-153060-1eb6g03.rsk8/sketch_apr23a/sketch_apr23a.ino:16: /tmp/.arduinoIDE-unsaved2023323-153060-1eb6g03.rsk8/sketch_apr23a/sketch_apr23a.ino: In function 'void setup()': /home/arbeit/Arduino/libraries/esp_dmx-2.0.1/src/esp_dmx.h:29:69: warning: missing initializer for member 'dmx_config_t::source_clk' [-Wmissing-field-initializers] { .baud_rate = DMX_TYP_BAUD_RATE, .break_num = 44, .idle_num = 3, } ^ /tmp/.arduinoIDE-unsaved2023323-153060-1eb6g03.rsk8/sketch_apr23a/sketch_apr23a.ino:63:28: note: in expansion of macro 'DMX_DEFAULT_CONFIG' dmx_config_t dmxConfig = DMX_DEFAULT_CONFIG; ^~~~~~~~~~~~~~~~~~

and when i change to all ports otherwise 1 i get a hardreset:

Rebooting... ets Jul 29 2019 12:21:46 rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:1184 load:0x40078000,len:13192 load:0x40080400,len:3028 entry 0x400805e4 E (10) dmx: dmx_param_config(410): dmx_num error E (11) dmx: dmx_set_pin(396): dmx_num error E (11) dmx: dmx_driver_install(114): dmx_num error assert failed: xQueueReceive queue.c:1382 (( pxQueue )) Backtrace: 0x40083691:0x3ffb20a0 0x40088269:0x3ffb20c0 0x4008d5bd:0x3ffb20e0 0x40088e7a:0x3ffb2210 0x400d13dd:0x3ffb2250 0x400d2e79:0x3ffb2290 ELF file SHA256: 32ca25a2e86d64e7

DMX SONOFF MAX-485

Bonjour, je cherche un moyen de contrôler mes lumières DMX à l'aide d'un sonoff et d'une puce MAX-485. Comment puis-je faire, puis-je avoir un schéma et sur quelle pin du sonoff dois-je brancher le MAX-485 ? Merci

Slow down DMX output refresh rate

Hello,
currently this library seems to send the dmx output as fast as possible.
With some models of lighting fixtures( inexpensive imported models) it works best to slow down the refresh rate.

using this library, how would one slow down the refresh rate to 20 or 25 HZ ?

Improve Serial Port Functionality

Right now this library only works with UART1. There are two enhancements which would be needed to support additional features. First, allow UART 0 to be used as an option instead of UART 1. This would allow transmit and receive capability to be added to the code. UART1 is Tx only while UART 0 is Tx and Rx.

Second, allow the use of software UART interfaces. See https://github.com/plieningerweb/esp8266-software-uart for software UART code. This would allow more than one universe of DMX transmit and receive on a single ESP8266 chip. This allows for further applications such as multi-universe sACN (E1.31) nodes, DMX combiners and splitters, etc. This has already been done on the AVR Arduino's see http://www.deskontrol.net/blog/arduino-four-universes-dmx-512-library/ for an example of that.

DMX read

The read() function refers to reading the data from the DMX buffer in the chip.

Library to receive DMX

Is there any ability to receive DMX or do you know of a library to receive DMX on an ESP8266 or ESP32?

Wiring Diagram

Hi, can you give me a wiring diagram for esp8266 and max485?
I need receiver and transmitter diagram.
thanks,

Using this library with ESP32

I am trying to integrate this with an ESP 32 instead.

Ultimately all we are achieving is a momentary button press selects between 5 dmx channels @ 255.

Is this compatible with esp32? i am not sure where to define the pins.

Off-by-one error case for channel?

Hello, I had problems using ESP-Dmx in combination with https://github.com/DaAwesomeP/dmxusb on an ESP8266 NodeMCU, working with qlcplus on the host computer. The issue was to address fixtures > 32.

It seems there might be an off-by-one error induced here:

void DMXESPSerial::write(int Channel, uint8_t value) {
  if (dmxStarted == false) init();

  if (Channel < 1) Channel = 1; // Channel should be allowed to be equal to zero
  // Next line: Channel should *never* be > index 511 (512th element in dmxData)
  if (Channel > chanSize) Channel = chanSize;
  if (value < 0) value = 0;
  if (value > 255) value = 255;

  dmxData[Channel] = value; // undefined for Channel == 512
}

Skimming over a few issues I think this might have been the cause.

For faster/easier access I simply added a buffer() function to write directly to dmxData: https://github.com/Simon-L/mpdmx/blob/main/mpdmx_1/ESPDMX.cpp#L35

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.