Yuval Perez presents at the Zephyr Developer Summit on accelerating time-to-market for embedded applications by integrating Zephyr, Pigweed, and Firebase. The talk focuses on leveraging Firebase's capabilities—remote configuration, real-time user engagement analytics, and experimental crash reporting—within a Zephyr-based embedded system, with Pigweed serving as the crucial communication bridge. Using an automatic bicycle gear shifter as a practical example, the presentation details how developers can remotely tweak algorithms, track user behavior (like manual overrides), and monitor system health to iterate quickly and deliver a finely-tuned product. The integration allows for A/B testing of features and algorithm adjustments in the field, reducing the need for extensive pre-launch research.
Summarizing the Zephyr Developer Summit Talk: Firebase & Pigweed for Embedded Time-to-Market
0:08 Introduction & The "Time-to-Market" Imperative: Yuval Perez introduces the concept of rapidly bringing embedded applications to market, highlighting its critical importance for startups and even personal projects to avoid excessive boilerplate work and allow for post-launch iteration. He introduces Firebase as a comprehensive tool, typically used for mobile/web, now adapted for embedded.
1:34 Firebase Core Highlights for Embedded: The talk will focus on three key Firebase features:
Remote Configs: Dynamically altering embedded device (EC) behavior (e.g., feature toggles, threshold adjustments) from a cloud console.
User Engagement Tracking (Analytics): Real-time monitoring of feature usage and user interaction with the embedded application.
Crash Analytics (Experimental): Acknowledged as not fully functional yet for embedded, but a promising future capability for debugging and reliability.
2:13 Pigweed as the Bridge: Pigweed serves as the essential middleware connecting the Zephyr embedded application with the Firebase console, enabling rapid iteration and data exchange.
3:04 Product Example: Automatic Bicycle Gear Shifter: The speaker introduces a desired personal project—an automatic bicycle gear shifter—to demonstrate the concepts. Inputs include cadence, power, speed, gravity vector, and user overrides; the output is gear selection.
3:32 Simplified Algorithm: The initial gear-shifting algorithm is simplified to calculate "energy per rotation" (power divided by cadence). If this value crosses a set threshold, a downshift is triggered, indicating the user is pushing too hard.
4:42 Setting up Zephyr & Pigweed: Developers need to add Zephyr and Pigweed to their project manifest and enable C++. Pigweed's environment activation and virtual environment integration with Zephyr scripts are crucial for the build process.
6:00 Efficient Logging with Tokenized RPC: Zephyr logs are intercepted by Pigweed, tokenized (reduced to 4-byte hashes) for efficiency, and streamed via an RPC service (e.g., UART). These tokens can be decoded on the host side using Python or a web console, providing detailed insights without heavy data transfer.
8:55 Core Application Logic & Zephyr DSP: The talk delves into using Zephyr's Digital Signal Processing (DSP) library, specifically q31 values (fixed-point arithmetic for values between -1 and 1), for calculations like "energy per rotation."
10:02 Tracking Events with Firebase Event Service: A custom Firebase event service is created to track significant actions (e.g., gear shifts) while abstracting Personally Identifiable Information (PII). It includes a caching mechanism to store events when the embedded device is not connected to a host (e.g., phone), flushing them when a connection is re-established to ensure no data is lost.
12:18 Real-time Debugging & Event Visualization: The Firebase console's debug live view allows real-time monitoring of events as they are captured and transmitted, aiding in development and debugging.
13:38 Remote Config for A/B Testing & Algorithm Tuning: Firebase Remote Config enables changing integer, boolean, or string parameters on the embedded device from the cloud. This allows for A/B testing, where different user groups receive different algorithm thresholds (e.g., 160 vs. 165 joules/rotation), to determine which configuration leads to better user experience (e.g., fewer manual overrides). Boolean flags can enable/disable entire code paths, such as incorporating slope calculations for gear shifting.
16:24 Experimental Crash Reporting: The vision for crash reporting involves caching crash data on the device and flushing it to the host upon reconnection. However, direct free-form crash reporting in Firebase is currently limited, potentially requiring workarounds or alternative platforms.
17:38 Conclusion: Informed Product Iteration & Market Advantage: The presenter concludes that this integrated approach allows for launching a product with initial assumptions and then refining it post-launch through informed, data-driven decisions via A/B testing and analytics. This accelerates time-to-market, reduces upfront research costs, and continuously improves the user experience by analyzing real-world behavior (e.g., tracking manual overrides or missed shifting opportunities).
19:10 Q&A and Contact Information: Yuval encourages questions and provides his contact details (email, Discord, GitHub).