Git Product home page Git Product logo

espdmx's People

Contributors

mtongnz 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

espdmx's Issues

help with mqtt dmx dimmer sketch

Jan 05, 2019, 01:56 am
hi so i use an esp 8266 to control the dmx dimmer of some lights via mqtt and nodered
The only problem i come across after a few minutes of use it resets at the begining mayebe 30' nad after every 10 or more minutes and send these errors :
`/*

*/
#include <espDMX.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>

// Update these with values suitable for your network.

const char* ssid = "ssid";
const char* password = "password";
const char* mqtt_server = "192.168.0.12";

WiFiClient espClient;
PubSubClient client(espClient);
uint32_t lastMsg = 0;
char msg[50];
uint8_t dmxPayload[2];
uint16_t value = 0;

void setup_wifi() {

delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

randomSeed(micros());

Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}

void callback(char* topic, byte* payload, unsigned int length) {
//Serial.println(length);
// Serial.print("Message arrived [");
// Serial.print(topic);
// Serial.print("] ");
// for (int i = 0; i < length; i++) {
// Serial.print((char)payload);
// }
// Serial.println();

// Should really check the topic matches the exact one your subscribed to before using value
for (int i = 0; i < length; i++) {
msg = (char)payload;
}
msg[length] = 0;

int x = atoi(msg);
Serial.println(x);
dmxPayload[0] = (byte)x;
dmxB.setChans(dmxPayload, 1);
}

void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
// Attempt to connect
if (client.connect("group1","user","password")) {
Serial.println("connected");
// Once connected, publish an announcement...
client.publish("outlight/dmx1/", "On Dmx Esp");
// ... and resubscribe
client.subscribe("inlight/dmx1/");
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}

void setup() {
// Start dmxA, status LED on pin 12 with full intensity
Serial.begin(115200);
dmxB.begin();
setup_wifi();
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
delay(2000);
}

void loop() {

if (!client.connected()) {
reconnect();
}
client.loop();

if (millis() - lastMsg > 60000) {
lastMsg = millis();
snprintf (msg, 49, "On Dmx Esp");
//snprintf (msg, 49, "On Dmx Esp #%ld", value++);
//Send free memory ram
// uint32_t free = ESP.getFreeHeap();
// itoa(free, msg, 10);

//  Serial.print("Publish message: ");
//  Serial.println(msg);
client.publish("outlight/dmx1/", msg);

}

delay(10);
}`

`ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld

Connecting to hkhkhkhk
.......
WiFi connected
IP address:
192.168.0.110
Attempting MQTT connection...connected

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld

Connecting to hkhkhkhk
...
WiFi connected
IP address:
192.168.0.110`

any help will be really appreciated
thanks
chris

Doesn't work with ESP8266-12E

After a few seconds i get following message:

`ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld`

wrong dmx out, like it's confmusing/mixing the steps

Greetings everyone,
thank you all for your contributions to DMX.

I 'm playing with the espDMX example and i have some issues running the code on wemos D1 mini v2 and i have implemented the MAX485 topology on dmxA(Tx0), a status led and i connected a 7 channel RGB led par.

I modified the steps for an R-G-B-black:

1-Master Dimmer
2-Red
3-Green
4-Blue
5-strobo
6-macro1
7-macro2


//4 steps with 7 channels in each
byte dmxChase[][7] = { { 255, 0, 0, 0, 0, 0, 0},
                        { 255, 255, 0, 0, 0, 0, 0},
                        { 255, 0, 255, 0, 0, 0, 0},
                        { 255, 0, 0, 255, 0, 0, 0}
 
};
void loop() {
  for (int i = 0; i < 4; i++) {
    
    // Output channels 1 - 10 on dmxA
    dmxA.setChans(dmxChase[i], 7, 1);

    // 1 second between each step
    delay(1000);
  }
}


what i get as a result to the led par is:
at the very first loop is almost the sequence as i wrote BUT
after that, every time the status led is blinking, it's like it runs 5 steps.

Any ideas?
Thanks in advance

Compile fails w/ Arduino IDE v1.8.10

I'm just getting started with this and am stumbling thru getting the Arduino environment setup.

I cloned this library and when trying to compile the example sketch, I get the following errors:

Arduino: 1.8.10 (Linux), Board: "Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

/home/schneis/arduino-1.8.10/libraries/espDMX/espDMX.cpp: In function 'dmx_t* dmx_init(int, int)':
/home/schneis/arduino-1.8.10/libraries/espDMX/espDMX.cpp:246:45: error: invalid conversion from 'void*' to 'fp_putc_t {aka void (*)(char)}' [-fpermissive]
 ets_install_putc1((void *) &uart_ignore_char);
                                             ^
In file included from /home/schneis/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/cores/esp8266/pgmspace.h:11:0,
                 from /home/schneis/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/cores/esp8266/Arduino.h:239,
                 from /home/schneis/arduino-1.8.10/libraries/espDMX/espDMX.cpp:21:
/home/schneis/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/tools/sdk/include/ets_sys.h:219:6: error:   initializing argument 1 of 'void ets_install_putc1(fp_putc_t)' [-fpermissive]
 void ets_install_putc1(fp_putc_t routine);
      ^
Multiple libraries were found for "espDMX.h"
 Used: /home/schneis/arduino-1.8.10/libraries/espDMX
exit status 1
Error compiling for board Generic ESP8266 Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The following patch seems to resolve the issue:

--- espDMX/espDMX.cpp.orig	2019-12-10 00:59:35.119923699 -0800
+++ espDMX/espDMX.cpp	2019-12-10 01:10:01.115088501 -0800
@@ -242,7 +242,7 @@
     }
 
     system_set_os_print(0);
-    ets_install_putc1((void *) &uart_ignore_char);
+    ets_install_putc1(&uart_ignore_char);
     
     // Initialize variables
     dmx->dmx_nr = dmx_nr;


Help please Outputing a specific Channel

Evening

thank you for sharing espDMX, I have been looking at the dmxChase example and I have that working within another project I am working on and it works perfectly, but my what I can seem to so if get a artnet values from channel one and then turn that into a DMX value to output.

Any help would be gratefully received.

Thank you in advanced

Tim

Custom pin number

I need a way to customize the pin to output to a MAX485.

I hope you can help me on this.

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.