custom wd counter, domoticzget cmd, Baudrate change to 9600

This commit is contained in:
esp8266nu
2015-06-06 11:39:27 +00:00
parent 21c3c2efdc
commit d61a61ace6
3 changed files with 31 additions and 2 deletions
+14 -2
View File
@@ -49,6 +49,16 @@
// DO NOT CHANGE ANYTHING BELOW THIS LINE
// ********************************************************************************
// variables used
// 1 Dallas
// 2-3 DHT
// 4-5 BMP085
// 6 Lux
// 7 Analog
// 8 RFID
// 9 Pulsecounter
// 10 DomoticzSend Serial in
#define ESP_PROJECT_PID 2015050101L
#define VERSION 1
#define BUILD 6
@@ -111,12 +121,13 @@ boolean AP_Mode = false;
char ap_ssid[20];
boolean cmd_disconnect = false;
unsigned long connectionFailures;
unsigned long wdcounter=0;
unsigned long pulseCounter1=0;
void setup()
{
Serial.begin(19200);
Serial.begin(9600);
Serial.print(F("\nINIT : Booting Build nr:"));
Serial.println(BUILD);
@@ -247,10 +258,11 @@ void loop()
// Watchdog trigger
if (millis() > timerwd)
{
wdcounter++;
timerwd = millis() + 30000;
char str[40];
str[0]=0;
sprintf(str,"WD %u CF %u FM %u", millis()/1000, connectionFailures, FreeMem());
sprintf(str,"WD %u CF %u FM %u", wdcounter/2, connectionFailures, FreeMem());
Serial.println(str);
syslog(str);
}
+12
View File
@@ -29,6 +29,18 @@ void ExecuteCommand(char *Line)
}
}
if (strcasecmp(Command, "DomoticzGet") == 0)
{
float value=0;
if (Domoticz_getData(Par2, &value))
{
Serial.print("DomoticzGet ");
Serial.println(value);
}
else
Serial.println("Error getting data");
}
if (strcasecmp(Command, "UDP") == 0)
{
if (GetArgv(Line, TmpStr1, 2))
+5
View File
@@ -38,4 +38,9 @@
// delay(10) in main loop instead of yield()
// DomoticzSend <type>,<idx>,<value> test command (via serial)
// Disabled analogRead, seems broken in g8cd3697 (use millis()/1000 as demo value!)
// R007 01-06-2015
// use custom counter for WD instead of millis() (millis does not reset on ESP.Reset)
// Changed BAUDrate to 9600
// DomoticzGet <type>, <idx> test command (via serial)