mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
Publish while MQTT connection pending caused hungs/WDT sometime - fixed
Default set 0 to all DMX out channels (include unused)
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
#include "utils.h"
|
||||
#include <aJSON.h>
|
||||
#include "inputs.h"
|
||||
#include "main.h"
|
||||
|
||||
extern lan_status lanStatus;
|
||||
extern PubSubClient mqttClient;
|
||||
|
||||
int abstractIn::publish(long value, char* subtopic)
|
||||
@@ -32,7 +34,7 @@ int abstractIn::publish(char * value, char* subtopic)
|
||||
strncpy(addrstr,emit->valuestring,sizeof(addrstr));
|
||||
if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestring);
|
||||
strncat(addrstr,subtopic,sizeof(addrstr));
|
||||
if (mqttClient.connected())
|
||||
if (mqttClient.connected() && lanStatus == OPERATION)
|
||||
{
|
||||
mqttClient.publish(addrstr, value, true);
|
||||
return 1;
|
||||
|
||||
@@ -245,6 +245,7 @@ dmxout.begin();
|
||||
dmxout.setTxMaxChannels(channels);
|
||||
#endif
|
||||
#endif
|
||||
for (int i=1;i<=channels;i++) DmxWrite(i,0);
|
||||
}
|
||||
|
||||
void ArtnetSetup()
|
||||
|
||||
@@ -120,12 +120,7 @@ int in_ccs811::Poll()
|
||||
publish(co2,"/CO2");
|
||||
publish(tvoc,"/TVOC");
|
||||
publish(ccs811Baseline,"/base");
|
||||
|
||||
Serial.print("] millis[");
|
||||
//Simply the time since program start
|
||||
Serial.print(millis());
|
||||
Serial.print("]");
|
||||
Serial.println();
|
||||
Serial.println("]");
|
||||
printSensorError();
|
||||
|
||||
#ifdef WAK_PIN
|
||||
|
||||
Reference in New Issue
Block a user