-#define SHOW_HEAP_USE
+//#define SHOW_HEAP_USE
//Function that tells the authentication system what users/passwords live on the system.
//This is disabled in the default build; if you want to try it, enable the authBasic line in
//the builtInUrls below.
-int myPassFn(HttpdConnData *connData, int no, char *user, int userLen, char *pass, int passLen) {
- if (no == 0) {
- os_strcpy(user, "admin");
- os_strcpy(pass, "s3cr3t");
- return 1;
+//int myPassFn(HttpdConnData *connData, int no, char *user, int userLen, char *pass, int passLen) {
+// if (no == 0) {
+// os_strcpy(user, "admin");
+// os_strcpy(pass, "s3cr3t");
+// return 1;
//Add more users this way. Check against incrementing no for each user added.
// } else if (no==1) {
// os_strcpy(user, "user1");
// os_strcpy(pass, "something");
// return 1;
- }
- return 0;
-}
+// }
+// return 0;
+//}
/*
@@ -97,9 +97,6 @@ HttpdBuiltInUrl builtInUrls[] = {
{ NULL, NULL, NULL }
};
-
-//#define SHOW_HEAP_USE
-
#ifdef SHOW_HEAP_USE
static ETSTimer prHeapTimer;
diff --git a/esp-link/mqtt_client.c b/esp-link/mqtt_client.c
index 229d996..d59cd5f 100644
--- a/esp-link/mqtt_client.c
+++ b/esp-link/mqtt_client.c
@@ -10,8 +10,8 @@ static ETSTimer mqttTimer;
static int once = 0;
static void ICACHE_FLASH_ATTR mqttTimerCb(void *arg) {
if (once++ > 0) return;
- MQTT_Init(&mqttClient, flashConfig.mqtt_hostname, flashConfig.mqtt_port, 0, 2,
- flashConfig.mqtt_client, flashConfig.mqtt_username, flashConfig.mqtt_password, 60);
+ MQTT_Init(&mqttClient, flashConfig.mqtt_host, flashConfig.mqtt_port, 0, 2,
+ flashConfig.mqtt_clientid, flashConfig.mqtt_username, flashConfig.mqtt_password, 60);
MQTT_Connect(&mqttClient);
MQTT_Subscribe(&mqttClient, "system/time", 0);
}
diff --git a/esp-link/status.c b/esp-link/status.c
index 2b08b20..f71d921 100644
--- a/esp-link/status.c
+++ b/esp-link/status.c
@@ -107,7 +107,9 @@ void ICACHE_FLASH_ATTR statusInit(void) {
makeGpio(flashConfig.conn_led_pin);
setLed(1);
}
+#ifdef STATUS_DBG
os_printf("CONN led=%d\n", flashConfig.conn_led_pin);
+#endif
os_timer_disarm(&ledTimer);
os_timer_setfn(&ledTimer, ledTimerCb, NULL);
diff --git a/espfs/espfs.c b/espfs/espfs.c
index 128ca29..f9942f3 100644
--- a/espfs/espfs.c
+++ b/espfs/espfs.c
@@ -109,7 +109,9 @@ void ICACHE_FLASH_ATTR memcpyAligned(char *dst, char *src, int len) {
// Returns flags of opened file.
int ICACHE_FLASH_ATTR espFsFlags(EspFsFile *fh) {
if (fh == NULL) {
+#ifdef ESPFS_DBG
os_printf("File handle not ready\n");
+#endif
return -1;
}
@@ -121,7 +123,9 @@ int ICACHE_FLASH_ATTR espFsFlags(EspFsFile *fh) {
//Open a file and return a pointer to the file desc struct.
EspFsFile ICACHE_FLASH_ATTR *espFsOpen(char *fileName) {
if (espFsData == NULL) {
+#ifdef ESPFS_DBG
os_printf("Call espFsInit first!\n");
+#endif
return NULL;
}
char *p=espFsData;
@@ -137,7 +141,9 @@ EspFsFile ICACHE_FLASH_ATTR *espFsOpen(char *fileName) {
//Grab the next file header.
os_memcpy(&h, p, sizeof(EspFsHeader));
if (h.magic!=ESPFS_MAGIC) {
+#ifdef ESPFS_DBG
os_printf("Magic mismatch. EspFS image broken.\n");
+#endif
return NULL;
}
if (h.flags&FLAG_LASTFILE) {
@@ -163,7 +169,9 @@ EspFsFile ICACHE_FLASH_ATTR *espFsOpen(char *fileName) {
if (h.compression==COMPRESS_NONE) {
r->decompData=NULL;
} else {
+#ifdef ESPFS_DBG
os_printf("Invalid compression: %d\n", h.compression);
+#endif
return NULL;
}
return r;
diff --git a/html/favicon.ico b/html/favicon.ico
index fe24a7b..bf372a1 100755
Binary files a/html/favicon.ico and b/html/favicon.ico differ
diff --git a/html/mqtt.html b/html/mqtt.html
index 257c137..edddb88 100644
--- a/html/mqtt.html
+++ b/html/mqtt.html
@@ -28,27 +28,30 @@