Browse Source

Debug info

fastled
Xose Pérez 7 years ago
parent
commit
b4466f5436
4 changed files with 84 additions and 46 deletions
  1. +73
    -7
      code/espurna/espurna.ino
  2. +6
    -0
      code/espurna/light.ino
  3. +5
    -0
      code/espurna/mqtt.ino
  4. +0
    -39
      code/espurna/utils.ino

+ 73
- 7
code/espurna/espurna.ino View File

@ -74,8 +74,10 @@ void welcome() {
DEBUG_MSG_P(PSTR("[INIT] CPU frequency: %d MHz\n"), ESP.getCpuFreqMHz());
DEBUG_MSG_P(PSTR("[INIT] SDK version: %s\n"), ESP.getSdkVersion());
DEBUG_MSG_P(PSTR("[INIT] Core version: %s\n"), ESP.getCoreVersion().c_str());
DEBUG_MSG_P(PSTR("\n"));
// -------------------------------------------------------------------------
FlashMode_t mode = ESP.getFlashChipMode();
DEBUG_MSG_P(PSTR("[INIT] Flash chip ID: 0x%06X\n"), ESP.getFlashChipId());
DEBUG_MSG_P(PSTR("[INIT] Flash speed: %u Hz\n"), ESP.getFlashChipSpeed());
@ -97,20 +99,87 @@ void welcome() {
#endif
DEBUG_MSG_P(PSTR("[INIT] EEPROM size: %8u bytes / %4d sectors\n"), settingsMaxSize(), sectors(settingsMaxSize()));
DEBUG_MSG_P(PSTR("[INIT] Empty space: %8u bytes / 4 sectors\n"), 4 * SPI_FLASH_SEC_SIZE);
DEBUG_MSG_P(PSTR("\n"));
// -------------------------------------------------------------------------
#if SPIFFS_SUPPORT
if (fs) {
DEBUG_MSG_P(PSTR("\n"));
DEBUG_MSG_P(PSTR("[INIT] SPIFFS total size: %8u bytes\n"), fs_info.totalBytes);
DEBUG_MSG_P(PSTR("[INIT] used size: %8u bytes\n"), fs_info.usedBytes);
DEBUG_MSG_P(PSTR("[INIT] block size: %8u bytes\n"), fs_info.blockSize);
DEBUG_MSG_P(PSTR("[INIT] page size: %8u bytes\n"), fs_info.pageSize);
DEBUG_MSG_P(PSTR("[INIT] max files: %8u\n"), fs_info.maxOpenFiles);
DEBUG_MSG_P(PSTR("[INIT] max length: %8u\n"), fs_info.maxPathLength);
DEBUG_MSG_P(PSTR("\n"));
}
#endif
DEBUG_MSG_P(PSTR("\n"));
// -------------------------------------------------------------------------
DEBUG_MSG_P(PSTR("[INIT] MANUFACTURER: %s\n"), MANUFACTURER);
DEBUG_MSG_P(PSTR("[INIT] DEVICE: %s\n"), DEVICE);
DEBUG_MSG_P(PSTR("[INIT] SUPPORT:"));
#if ALEXA_SUPPORT
DEBUG_MSG_P(PSTR(" ALEXA"));
#endif
#if ANALOG_SUPPORT
DEBUG_MSG_P(PSTR(" ANALOG"));
#endif
#if DEBUG_SERIAL_SUPPORT
DEBUG_MSG_P(PSTR(" DEBUG_SERIAL"));
#endif
#if DEBUG_UDP_SUPPORT
DEBUG_MSG_P(PSTR(" DEBUG_UDP"));
#endif
#if DHT_SUPPORT
DEBUG_MSG_P(PSTR(" DHT"));
#endif
#if DOMOTICZ_SUPPORT
DEBUG_MSG_P(PSTR(" DOMOTICZ"));
#endif
#if DS18B20_SUPPORT
DEBUG_MSG_P(PSTR(" DS18B20"));
#endif
#if EMON_SUPPORT
DEBUG_MSG_P(PSTR(" EMON"));
#endif
#if HOMEASSISTANT_SUPPORT
DEBUG_MSG_P(PSTR(" HOMEASSISTANT"));
#endif
#if I2C_SUPPORT
DEBUG_MSG_P(PSTR(" I2C"));
#endif
#if INFLUXDB_SUPPORT
DEBUG_MSG_P(PSTR(" INFLUXDB"));
#endif
#if MDNS_SUPPORT
DEBUG_MSG_P(PSTR(" MDNS"));
#endif
#if NOFUSS_SUPPORT
DEBUG_MSG_P(PSTR(" NOFUSS"));
#endif
#if NTP_SUPPORT
DEBUG_MSG_P(PSTR(" NTP"));
#endif
#if RF_SUPPORT
DEBUG_MSG_P(PSTR(" RF"));
#endif
#if SPIFFS_SUPPORT
DEBUG_MSG_P(PSTR(" SPIFFS"));
#endif
#if TERMINAL_SUPPORT
DEBUG_MSG_P(PSTR(" TERMINAL"));
#endif
#if WEB_SUPPORT
DEBUG_MSG_P(PSTR(" WEB"));
#endif
DEBUG_MSG_P(PSTR("\n\n"));
// -------------------------------------------------------------------------
unsigned char custom_reset = customReset();
if (custom_reset > 0) {
char buffer[32];
@ -120,10 +189,7 @@ void welcome() {
DEBUG_MSG_P(PSTR("[INIT] Last reset reason: %s\n"), (char *) ESP.getResetReason().c_str());
}
DEBUG_MSG_P(PSTR("[INIT] Free heap: %u bytes\n"), ESP.getFreeHeap());
initDump();
DEBUG_MSG_P(PSTR("\n\n"));
DEBUG_MSG_P(PSTR("\n"));
}


+ 6
- 0
code/espurna/light.ino View File

@ -534,10 +534,12 @@ void _lightAPISetup() {
void lightSetup() {
#if LIGHT_PROVIDER == LIGHT_PROVIDER_MY9192
_my9291 = new my9291(MY9291_DI_PIN, MY9291_DCKI_PIN, MY9291_COMMAND, MY9291_CHANNELS);
for (unsigned char i=0; i<MY9291_CHANNELS; i++) {
_channels.push_back((channel_t) {0, false, 0});
}
#endif
#if LIGHT_PROVIDER == LIGHT_PROVIDER_DIMMER
@ -568,8 +570,12 @@ void lightSetup() {
pinMode(_channels[i].pin, OUTPUT);
}
#endif
DEBUG_MSG_P(PSTR("[LIGHT] LIGHT_PROVIDER = %d\n"), LIGHT_PROVIDER);
DEBUG_MSG_P(PSTR("[LIGHT] Number of channels: %d\n"), _channels.size());
_lightColorRestore();
_lightAPISetup();
mqttRegister(_lightMQTTCallback);


+ 5
- 0
code/espurna/mqtt.ino View File

@ -483,7 +483,12 @@ boolean mqttDiscover() {
#endif // MDNS_SUPPORT
void mqttSetup() {
DEBUG_MSG_P(PSTR("[MQTT] MQTT_USE_ASYNC = %d\n"), MQTT_USE_ASYNC);
DEBUG_MSG_P(PSTR("[MQTT] MQTT_AUTOCONNECT = %d\n"), MQTT_AUTOCONNECT);
#if MQTT_USE_ASYNC
mqtt.onConnect([](bool sessionPresent) {
_mqttOnConnect();
});


+ 0
- 39
code/espurna/utils.ino View File

@ -55,45 +55,6 @@ unsigned long getUptime() {
}
#define DUMP_SETTING(X, Y) DEBUG_MSG_P(PSTR(" %s: %s\n"), X, String(Y).c_str())
void initDump() {
DEBUG_MSG_P(PSTR("\n[INIT] Current settings:\n\n"));
DUMP_SETTING("MANUFACTURER", MANUFACTURER);
DUMP_SETTING("DEVICE", DEVICE);
DEBUG_MSG_P(PSTR(" ---------------------------\n"));
DUMP_SETTING("ALEXA_SUPPORT", ALEXA_SUPPORT);
DUMP_SETTING("ANALOG_SUPPORT", ANALOG_SUPPORT);
DUMP_SETTING("DEBUG_SERIAL_SUPPORT", DEBUG_SERIAL_SUPPORT);
DUMP_SETTING("DEBUG_UDP_SUPPORT", DEBUG_UDP_SUPPORT);
DUMP_SETTING("DHT_SUPPORT", DHT_SUPPORT);
DUMP_SETTING("DOMOTICZ_SUPPORT", DOMOTICZ_SUPPORT);
DUMP_SETTING("DS18B20_SUPPORT", DS18B20_SUPPORT);
DUMP_SETTING("EMON_SUPPORT", EMON_SUPPORT);
DUMP_SETTING("HOMEASSISTANT_SUPPORT", HOMEASSISTANT_SUPPORT);
DUMP_SETTING("I2C_SUPPORT", I2C_SUPPORT);
DUMP_SETTING("INFLUXDB_SUPPORT", INFLUXDB_SUPPORT);
DUMP_SETTING("MDNS_SUPPORT", MDNS_SUPPORT);
DUMP_SETTING("NOFUSS_SUPPORT", NOFUSS_SUPPORT);
DUMP_SETTING("NTP_SUPPORT", NTP_SUPPORT);
DUMP_SETTING("RF_SUPPORT", RF_SUPPORT);
DUMP_SETTING("SPIFFS_SUPPORT", SPIFFS_SUPPORT);
DUMP_SETTING("TERMINAL_SUPPORT", TERMINAL_SUPPORT);
DUMP_SETTING("WEB_SUPPORT", WEB_SUPPORT);
DEBUG_MSG_P(PSTR(" ---------------------------\n"));
DUMP_SETTING("LIGHT_PROVIDER", LIGHT_PROVIDER);
DUMP_SETTING("MQTT_AUTOCONNECT", MQTT_AUTOCONNECT);
DUMP_SETTING("MQTT_USE_ASYNC", MQTT_USE_ASYNC);
}
void heartbeat() {
unsigned long uptime_seconds = getUptime();


Loading…
Cancel
Save