Skip to content
  • 🔧 Firmware bugs? Post like this

    Firmware & FreeRTOS firmware freertos help
    1
    0 Votes
    1 Posts
    128 Views
    A
    Half of firmware debugging is how you ask. A good report gets you an answer in an hour; "it doesn't work" gets you silence. Use this format every time: What I'm trying to do: one sentence — the goal, not the method. What I tried: the steps, in order. "Changed the baud rate, added a delay, swapped cables." What happened: exact text, not paraphrase. Paste the panic dump, the serial output, the wrong value. My setup: board (ESP32 DevKitC? which revision), IDE + version, relevant library versions. Minimal code: the smallest snippet that reproduces it — 20 lines beats 500. Use code blocks, never screenshots of code. Serial output: pasted as text, from boot to failure. Decode your own crash first A Guru Meditation Error print is a gift — it tells you the exception cause, the guilty program counter, and a backtrace. The fastest path: rebuild the exact same binary with symbols, feed the addresses to the decoder, and read the function names. Nine times out of ten it lands on one of these: Stack overflow — a task with a 1 KB stack calling deep library functions, or a large array declared inside a function. Symptom: crash inside random-looking code, corrupted backtrace. Fix: grow the stack, move big buffers to static/global. Watchdog bite — a task that never blocks. Any loop without a delay or blocking call starves the idle task and the watchdog resets the chip. Fix: yield every iteration. Null / wild pointer — dereferencing a queue handle or object that was never created, or used after deletion. Symptom: LoadProhibited on an address near zero. Fix: check every create call's return before use. Shared state without protection — a variable touched from a task and an ISR (or two tasks) with no guard. Symptom: works for hours, then corrupts once. Fix: qualifier or guard, depending on who shares it. The five gotchas that solve most posts here ADC reads garbage with WiFi on → use ADC1 pins, never ADC2 under WiFi. Board resets randomly on USB → weak cable or port; measure the rail under load, try a shorter cable and a powered hub. Serial shows garbage → monitor baud must match Serial.begin() exactly. "Worked yesterday" → something changed: code, wiring, power source, library update. Figure out what, then bisect it. Timing drift under WiFi → never use blocking delays for cadence; sample on a stable timebase. Post with the format above and tag with firmware, freertos or esp32.
  • 0 Votes
    1 Posts
    175 Views
    A
    Troubleshooting Index Search this page (Ctrl+F) for your error message before posting. GrapesIDE & Toolchain Error Cause Solution A fatal error occurred: Failed to connect to ESP32 Board not in flash mode Hold BOOT button while clicking Upload No serial port found Driver not installed Install CH340 or CP2102 driver Sketch too large Binary exceeds flash Change Partition Scheme to "No OTA (2MB)" 'x' was not declared in this scope Missing #include or typo Add the correct header file implicit conversion loses integer precision Type mismatch Cast explicitly or fix variable type warning: unused variable Variable declared but never used Remove or use the variable. Enable -Werror — this must be fixed ESP32 Hardware Error / Symptom Cause Solution ADC reads 0 or noise during WiFi ADC2 conflicts with WiFi Switch to ADC1 channels (GPIO32-39) GPIO reads random values (floating) No pull-up/pull-down Add 10kΩ pull-up or enable internal pull-up Device resets randomly Brownout — supply voltage too low Measure VCC under load. Use better USB cable/adapter Serial output garbled Wrong baud rate in monitor Match Serial.begin() rate exactly LED on but dim GPIO current limit exceeded Add current-limiting resistor FreeRTOS Error / Symptom Cause Solution Guru Meditation Error: Core panic'd Stack overflow, null deref, WDT Decode with addr2line — see Block 2 Crash Lab Task watchdog got triggered: taskName Task running without vTaskDelay Add vTaskDelay(pdMS_TO_TICKS(1)) in loop Device freezes randomly Deadlock between mutexes Check mutex acquisition order — always same order across tasks assert failed: queue.c Queue full with no space Increase queue size or consume faster Device reboots every N seconds WDT not being reset Add esp_task_wdt_reset() or vTaskDelay in busy tasks MQTT & Connectivity Error / Code Cause Solution PubSubClient state -2 (CONNECT_FAILED) Wrong credentials or broker down Check username/password/token PubSubClient state -4 (TIMEOUT) Wrong broker IP/port, firewall Verify host, port 8883 for TLS PubSubClient state 5 (UNAUTHORIZED) ACL blocked the topic Check topic matches your device_id exactly TLS certificate verify failed Wrong CA cert or device clock wrong Sync NTP before TLS connect TLS handshake timeout Heap too low for TLS Need >50KB free heap — check esp_get_free_heap_size() WiFi connects but MQTT fails TLS port blocked by ISP/router Try port 8083 (WS) or check firewall rules Messages not arriving QoS mismatch Check publisher and subscriber QoS match GrapesIoT Platform Symptom Cause Solution Device shows offline in dashboard LWT not configured or WiFi down Check MQTT connection and LWT topic OTA command sent but device ignores Device not subscribed to /down/# Check subscription in firmware Dashboard shows old data Retained message from previous session Clear retained by publishing empty payload Alarm not triggering Wrong field path in rule config Check dot-notation path matches payload key GrapesIDE Specific Issue Solution Autocomplete not working Restart IntelliSense: Ctrl+Shift+P → Reload Window Board not detected on Mac Allow USB accessories in System Settings → Privacy Build slow Exclude .pio folder from antivirus Last updated by instructor. Post below if you have a new error+solution to add.
  • 🧭 How to Ask a Good Technical Question

    Start Here help howto
    1
    0 Votes
    1 Posts
    138 Views
    A
    How to Ask a Good Technical Question Getting a fast, accurate answer depends entirely on how you ask. Follow this template: The Template What I am trying to do: [One sentence describing your goal] What I tried: [Steps you already attempted] What happened: [Exact error message, unexpected behaviour, or symptom — copy-paste, don't paraphrase] My setup: Board: ESP32 / [other] IDE: GrapesIDE v[version] Block / Session: [e.g. Block 2, Session 2.1.1] My code: // paste relevant code here // not 500 lines — only the relevant function Serial output: paste serial monitor output here Golden Rules One question per post Copy-paste error messages exactly Show what you already tried Never say "it doesn't work" without saying what it does instead Never post screenshots of code — paste the code directly