Skip to main content

Posts

Matter on ESP32: Troubleshooting 'Commissioning Failed' with Apple Home

  If you are developing a Matter-over-Wi-Fi device on the ESP32, you have likely encountered the specific problem that is the Apple Home "Commissioning Failed" error. Android devices commission instantly. The   chip-tool   on Linux works perfectly. Yet, when you scan the QR code with an iPhone, the Home app spins on "Connecting..." for 30 seconds before unceremoniously dropping the connection. Apple provides zero logs to the user. However, the issue almost always boils down to two factors specific to the ESP32 implementation:  BLE Advertisement intervals violating Apple's strict accessory design guidelines  and  Memory exhaustion during the PASE (Passcode Authenticated Session Establishment) handshake . Here is the root cause analysis and the production-grade fix to stabilize your Matter commissioning. The Root Cause: Timing and Fragmentation Matter commissioning (specifically PASE) begins over Bluetooth Low Energy (BLE). The Commissioner (the iPhone) must ...

Elixir OTP Strategy: Handling 'GenServer timeout' in Heavy Processing

  The Hook: The 5000ms Wall Every senior Elixir developer has seen this stack trace. It usually appears during a traffic spike, cascading through your logs and triggering pager alerts: ** (exit) exited in: GenServer.call(MySystem.HeavyWorker, :process_data, 5000) ** (EXIT) time out The default 5000ms timeout in  GenServer.call/3  is not arbitrary; it is a fail-safe. However, in high-load systems, hitting this timeout usually isn't a symptom of network latency—it is a symptom of  mailbox congestion . When a GenServer performs heavy processing directly in its main loop, it violates the cardinal rule of the Actor Model:  Keep the mailbox flowing. The Root Cause: Serial Execution in the Actor Model Under the hood, a GenServer is a single Erlang process with a mailbox (a FIFO queue) and a recursive loop. When you execute a blocking function inside  handle_call/3 : The process halts message consumption. It executes your logic (e.g., XML parsing, image resizin...