esp8266 mqtt to dmx help errors

hi so i use an esp 8266 to control the dmx dimmer of some lights via mqtt and nodered i had help from @Riva we got it running.
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 :

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
Attempting MQTT connection…connected

and here is the code i use

/*

*/
#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);
}
[/quote]*
any help will be really apreciated caused i m stuck now the lights close after some minutes of use
thanks in advance
chris_

RST Cause 4 is a watchdog restart so your probably spending to much time in a program loop without yielding for the WiFi
This could be in your callback or maybe in one of the libraries. There is a tool somewhere that you can past the reset data into and it helps decode it. I have never used it but it may point to the parts of the code that cause the WDT reset.