From 818620919ba465842a254c97fc2d8006f1d95b79 Mon Sep 17 00:00:00 2001 From: Torsten Stauder Date: Sat, 12 Dec 2020 01:25:36 +0100 Subject: [PATCH] Forgot something... grrr --- PCBs/Wemos Lolin32/README.md | 2 +- src/main.cpp | 7 ++++--- src/settings.h | 40 ++++++++++++++++++------------------ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/PCBs/Wemos Lolin32/README.md b/PCBs/Wemos Lolin32/README.md index b0288a9..33ca4c7 100644 --- a/PCBs/Wemos Lolin32/README.md +++ b/PCBs/Wemos Lolin32/README.md @@ -56,7 +56,7 @@ The heart of my project is an ESP32 on a [Wemos Lolin32 development-board](https * Female connector as socket for Lolin32, uSD-reader and MAX98357a * (optional for headphone-PCB) 1x IDC-connecor female (6pin) * (optional for headphone-PCB) 1x IDC-connecor male (6pin) -* rev2: (optional) 10 uF capacitor (used to smooth battery management) +* rev2: (optional) 1x 10 uF capacitor (2.0mm-pitch) ## Where to order? I ordered my PCBs at [jlcpcb](https://jlcpcb.com/). You have to order at least 5 pcs, which is only at 2$ + shipping. It took two weeks to arrive. If you want to have a look at the PCBs first (without having KiCad installed), visit [Gerberlook](https://www.gerblook.org/) and upload `gerber.zip` from the Gerberfiles-folder. diff --git a/src/main.cpp b/src/main.cpp index 5885126..4a618ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -751,7 +751,9 @@ void doButtonActions(void) { float voltage = measureBatteryVoltage(); snprintf(logBuf, serialLoglength, "%s: %.2f V", (char *) FPSTR(currentVoltageMsg), voltage); loggerNl(logBuf, LOGLEVEL_INFO); - showLedVoltage = true; + #ifdef NEOPIXEL_ENABLE + showLedVoltage = true; + #endif #ifdef MQTT_ENABLE char vstr[6]; snprintf(vstr, 6, "%.2f", voltage); @@ -2148,6 +2150,7 @@ void showLed(void *parameter) { vTaskDelay(portTICK_RATE_MS * 5); } } + vTaskDelay(portTICK_RATE_MS * 10); esp_task_wdt_reset(); } vTaskDelete(NULL); @@ -3817,8 +3820,6 @@ void setup() { ); - //esp_sleep_enable_ext0_wakeup((gpio_num_t) DREHENCODER_BUTTON, 0); - // Activate internal pullups for all buttons pinMode(DREHENCODER_BUTTON, INPUT_PULLUP); pinMode(PAUSEPLAY_BUTTON, INPUT_PULLUP); diff --git a/src/settings.h b/src/settings.h index 9c6e865..de1f63c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -130,26 +130,26 @@ float voltageIndicatorHigh = 4.2; // Upper range for Neopixel- #ifdef MQTT_ENABLE uint16_t mqttRetryInterval = 15; // Try to reconnect to MQTT-server every (n) seconds if connection is broken uint8_t mqttMaxRetriesPerInterval = 1; // Number of retries per time-interval (mqttRetryInterval). mqttRetryInterval 15 / mqttMaxRetriesPerInterval 1 => once every 15s - #define DEVICE_HOSTNAME "ESP32-Tonuino-Leonie" // Name that that is used for MQTT - static const char topicSleepCmnd[] PROGMEM = "Cmnd/Tonuino-Leonie/Sleep"; - static const char topicSleepState[] PROGMEM = "State/Tonuino-Leonie/Sleep"; - static const char topicTrackCmnd[] PROGMEM = "Cmnd/Tonuino-Leonie/Track"; - static const char topicTrackState[] PROGMEM = "State/Tonuino-Leonie/Track"; - static const char topicTrackControlCmnd[] PROGMEM = "Cmnd/Tonuino-Leonie/TrackControl"; - static const char topicLoudnessCmnd[] PROGMEM = "Cmnd/Tonuino-Leonie/Loudness"; - static const char topicLoudnessState[] PROGMEM = "State/Tonuino-Leonie/Loudness"; - static const char topicSleepTimerCmnd[] PROGMEM = "Cmnd/Tonuino-Leonie/SleepTimer"; - static const char topicSleepTimerState[] PROGMEM = "State/Tonuino-Leonie/SleepTimer"; - static const char topicState[] PROGMEM = "State/Tonuino-Leonie/State"; - static const char topicCurrentIPv4IP[] PROGMEM = "State/Tonuino-Leonie/IPv4"; - static const char topicLockControlsCmnd[] PROGMEM ="Cmnd/Tonuino-Leonie/LockControls"; - static const char topicLockControlsState[] PROGMEM ="State/Tonuino-Leonie/LockControls"; - static const char topicPlaymodeState[] PROGMEM = "State/Tonuino-Leonie/Playmode"; - static const char topicRepeatModeCmnd[] PROGMEM = "Cmnd/Tonuino-Leonie/RepeatMode"; - static const char topicRepeatModeState[] PROGMEM = "State/Tonuino-Leonie/RepeatMode"; - static const char topicLedBrightnessCmnd[] PROGMEM = "Cmnd/Tonuino-Leonie/LedBrightness"; - static const char topicLedBrightnessState[] PROGMEM = "State/Tonuino-Leonie/LedBrightness"; + #define DEVICE_HOSTNAME "ESP32-Tonuino" // Name that that is used for MQTT + static const char topicSleepCmnd[] PROGMEM = "Cmnd/Tonuino/Sleep"; + static const char topicSleepState[] PROGMEM = "State/Tonuino/Sleep"; + static const char topicTrackCmnd[] PROGMEM = "Cmnd/Tonuino/Track"; + static const char topicTrackState[] PROGMEM = "State/Tonuino/Track"; + static const char topicTrackControlCmnd[] PROGMEM = "Cmnd/Tonuino/TrackControl"; + static const char topicLoudnessCmnd[] PROGMEM = "Cmnd/Tonuino/Loudness"; + static const char topicLoudnessState[] PROGMEM = "State/Tonuino/Loudness"; + static const char topicSleepTimerCmnd[] PROGMEM = "Cmnd/Tonuino/SleepTimer"; + static const char topicSleepTimerState[] PROGMEM = "State/Tonuino/SleepTimer"; + static const char topicState[] PROGMEM = "State/Tonuino/State"; + static const char topicCurrentIPv4IP[] PROGMEM = "State/Tonuino/IPv4"; + static const char topicLockControlsCmnd[] PROGMEM ="Cmnd/Tonuino/LockControls"; + static const char topicLockControlsState[] PROGMEM ="State/Tonuino/LockControls"; + static const char topicPlaymodeState[] PROGMEM = "State/Tonuino/Playmode"; + static const char topicRepeatModeCmnd[] PROGMEM = "Cmnd/Tonuino/RepeatMode"; + static const char topicRepeatModeState[] PROGMEM = "State/Tonuino/RepeatMode"; + static const char topicLedBrightnessCmnd[] PROGMEM = "Cmnd/Tonuino/LedBrightness"; + static const char topicLedBrightnessState[] PROGMEM = "State/Tonuino/LedBrightness"; #ifdef MEASURE_BATTERY_VOLTAGE - static const char topicBatteryVoltage[] PROGMEM = "State/Tonuino-Leonie/Voltage"; + static const char topicBatteryVoltage[] PROGMEM = "State/Tonuino/Voltage"; #endif #endif