master
shaun feakes 2019-01-08 21:22:17 -06:00
parent 1f46cf2b1d
commit b6b96e1415
4 changed files with 15 additions and 11 deletions

View File

@ -197,6 +197,8 @@ void publish_zone_mqtt(struct mg_connection *nc, struct GPIOcfg *gpiopin) {
static char mqtt_topic[250];
static char mqtt_msg[50];
printf("PUBLISH pin %d\n",gpiopin->pin);
if (_sdconfig_.enableMQTTaq == true) {
// sprintf(mqtt_topic, "%s/%s", _sdconfig_.mqtt_topic, gpiopin->name);
sprintf(mqtt_topic, "%s/zone%d", _sdconfig_.mqtt_topic, gpiopin->zone);
@ -321,7 +323,7 @@ void broadcast_sprinklerdstate(struct mg_connection *nc)
for (c = mg_next(nc->mgr, NULL); c != NULL; c = mg_next(nc->mgr, c)) {
// Start from 0 since we publish master valve (just a temp measure)
for (i=0; i <= _sdconfig_.zones ; i++)
for (i=(_sdconfig_.master_valve?0:1); i <= _sdconfig_.zones ; i++)
{
if (is_websocket(c)) {
//ws_send(c, data);

Binary file not shown.

View File

@ -39,18 +39,19 @@ DZIDX_RAINSENSOR = 48
# Don't use ZONE:0 for anything other than master valve, if you don't have a master valve simply delete it and start from ZONE:1
[ZONE]
[ZONE:0]
NAME=Master Valve
MASTER_VALVE=1
GPIO_PIN=17
WPI_PIN=0
GPIO_PULL_UPDN=1
GPIO_ON_STATE=0
#[ZONE:0]
#NAME=Master Valve
#MASTER_VALVE=1
#GPIO_PIN=17
#WPI_PIN=0
#GPIO_PULL_UPDN=1
#GPIO_ON_STATE=0
[ZONE:1]
NAME=Island
DEFAULT_RUNTIME=10
GPIO_PIN=18
#GPIO_PIN=18
GPIO_PIN=2
WPI_PIN=1
GPIO_PULL_UPDN=1
GPIO_ON_STATE=0
@ -59,7 +60,8 @@ DOMOTICZ_IDX=200
[ZONE:2]
NAME=Driveway
DEFAULT_RUNTIME=10
GPIO_PIN=27
#GPIO_PIN=27
GPIO_PIN=3
WPI_PIN=2
GPIO_PULL_UPDN=1
GPIO_ON_STATE=0

View File

@ -1,6 +1,6 @@
#ifndef SD_VERSION_H
#define SD_VERSION_H
#define SD_VERSION "1.0e"
#define SD_VERSION "1.0f"
#endif