diff --git a/esp-link/main.c b/esp-link/main.c index b386338..bf8c6ef 100644 --- a/esp-link/main.c +++ b/esp-link/main.c @@ -81,7 +81,7 @@ HttpdBuiltInUrl builtInUrls[] = { { "/pins", cgiPins, NULL }, #ifdef MQTT { "/mqtt", cgiMqtt, NULL }, -#endif +#endif { "*", cgiEspFsHook, NULL }, //Catch-all cgi function for the filesystem { NULL, NULL, NULL } }; @@ -151,8 +151,8 @@ void user_init(void) { uint32_t fid = spi_flash_get_id(); NOTICE("Flash map %s, manuf 0x%02X chip 0x%04X", flash_maps[system_get_flash_size_map()], fid & 0xff, (fid&0xff00)|((fid>>16)&0xff)); - NOTICE("** esp-link ready"); - + NOTICE("** %s: ready, heap=%ld", esp_link_version, (unsigned long)system_get_free_heap_size()); + // Init SNTP service cgiServicesSNTPInit(); #ifdef MQTT diff --git a/rest/rest.c b/rest/rest.c index a267059..aa40ccb 100644 --- a/rest/rest.c +++ b/rest/rest.c @@ -375,7 +375,7 @@ REST_Request(CmdPacket *cmd) { realLen = cmdArgLen(&req); if (realLen > 2048) goto fail; } - DBG_REST(" bodyLen=%ld", realLen); + DBG_REST(" bodyLen=%d", realLen); // we need to allocate memory for the header plus the body. First we count the length of the // header (including some extra counted "%s" and then we add the body length. We allocate the @@ -394,7 +394,7 @@ REST_Request(CmdPacket *cmd) { if (client->data) os_free(client->data); client->data = (char*)os_zalloc(headerLen + realLen); if (client->data == NULL) goto fail; - DBG_REST(" totLen=%ld data=%p", headerLen + realLen, client->data); + DBG_REST(" totLen=%d data=%p", headerLen + realLen, client->data); client->data_len = os_sprintf((char*)client->data, headerFmt, method, path, client->host, client->header, realLen, client->content_type, client->user_agent); DBG_REST(" hdrLen=%d", client->data_len); @@ -413,7 +413,7 @@ REST_Request(CmdPacket *cmd) { espconn_regist_reconcb(client->pCon, tcpclient_recon_cb); if(UTILS_StrToIP((char *)client->host, &client->pCon->proto.tcp->remote_ip)) { - DBG_REST("REST: Connect to ip %s:%ld\n",client->host, client->port); + DBG_REST("REST: Connect to ip %s:%d\n",client->host, client->port); //if(client->security){ // espconn_secure_connect(client->pCon); //} @@ -421,7 +421,7 @@ REST_Request(CmdPacket *cmd) { espconn_connect(client->pCon); //} } else { - DBG_REST("REST: Connect to host %s:%ld\n", client->host, client->port); + DBG_REST("REST: Connect to host %s:%d\n", client->host, client->port); espconn_gethostbyname(client->pCon, (char *)client->host, &client->ip, rest_dns_found); } diff --git a/syslog/syslog.c b/syslog/syslog.c index 3fcf66f..27d8c58 100644 --- a/syslog/syslog.c +++ b/syslog/syslog.c @@ -413,7 +413,7 @@ syslog_compose(uint8_t facility, uint8_t severity, const char *tag, const char * // add HOSTNAME APP-NAME PROCID MSGID if (flashConfig.syslog_showtick) - p += os_sprintf(p, "%s %s %lu.%06lu %lu ", flashConfig.hostname, tag, se->tick / 1000000, + p += os_sprintf(p, "%s %s %u.%06u %u ", flashConfig.hostname, tag, se->tick / 1000000, se->tick % 1000000, syslog_msgid++); else p += os_sprintf(p, "%s %s - %u ", flashConfig.hostname, tag, syslog_msgid++);