<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Enrique Gamboa on Medium]]></title>
        <description><![CDATA[Stories by Enrique Gamboa on Medium]]></description>
        <link>https://medium.com/@jegamboafuentes?source=rss-9038ca33f9ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*W72VfH3w-uW8kfZRRSeypg@2x.jpeg</url>
            <title>Stories by Enrique Gamboa on Medium</title>
            <link>https://medium.com/@jegamboafuentes?source=rss-9038ca33f9ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:56:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jegamboafuentes/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Prompt to Prototype: Building an ESP32 Smart Photo Frame with Cursor IDE]]></title>
            <link>https://medium.com/codetodeploy/from-prompt-to-prototype-building-an-esp32-smart-photo-frame-with-cursor-ide-62b48bfcf4b9?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/62b48bfcf4b9</guid>
            <category><![CDATA[waveshare]]></category>
            <category><![CDATA[photo-frames]]></category>
            <category><![CDATA[cursor-ide]]></category>
            <category><![CDATA[esp32-s3]]></category>
            <category><![CDATA[cursor-hardware]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 15:34:55 GMT</pubDate>
            <atom:updated>2026-09-03T10:12:44.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjeRmAuSZ7qXMii7XvS82g.jpeg" /><figcaption>The final result sitting on my desk displaying a personal memory.</figcaption></figure><p>I’ve had this <a href="https://www.waveshare.com/esp32-s3-lcd-1.47.htm?srsltid=AfmBOookCss2_1y_jfHEWDADnVezPa6X_ufjGYwO4DV9Ssr2NLV79pwk">Waveshare device</a> sitting on my desk for a while. If you’ve followed my previous builds — like the <a href="https://jegamboafuentes.medium.com/building-an-iot-flowerpot-from-scratch-bad9e6623f48">IoT flowerpot</a>, the real-time <a href="https://jegamboafuentes.medium.com/i-created-my-own-subway-arrival-board-with-real-time-data-to-dont-miss-my-train-anymore-28bfded312c0">MBTA subway arrival board</a>, or my <a href="https://jegamboafuentes.medium.com/this-is-how-i-create-my-personal-own-soccer-ai-coach-from-scratch-using-googles-automl-with-14ea2fec5200">AutoML soccer coach</a> — you know I absolutely love buying ESP32 boards on <a href="https://www.amazon.com/Waveshare-Development-Dual-core-Processor-Frequency/dp/B0DFTCC1FT/ref=sr_1_3?crid=KFY4HPEA9NYH&amp;dib=eyJ2IjoiMSJ9.Z3RLUzGlqWpUOBT6M36NdHA_uigeXpXqlL1JLfxvjsCycYkCog0zFUMwGUjp6QrTr8y0tw3g9r3kLGQrAr9ucc1wtMYQzS_JCVntir9v25xFdcCE7ssB5_k_2TIk0Z96dZnYMgHaDbGmHsrgKqdB4k9l1ZPeXwHwKpCPHu-Wgt-camWKi6vzM9B6Ak3tl6J6Zev7IktfOYjdkgi2-hcFotR5OtbNq5560CRZ1hpo9Ys.ODTRJ9Mlv6TiUGQNJWTIAnbIFGmkC9oAlphXi-oO90Q&amp;dib_tag=se&amp;keywords=ESP32-S3+1.47inch&amp;qid=1788189282&amp;s=financial&amp;sprefix=esp32-s3+1.47inch%2Cfinancial%2C190&amp;sr=1-3">Amazon</a>. They are cute, tiny computers for about $20, and running experiments on them is pure fun. Lately, I decided to test something different: I wanted to see if the Cursor IDE could actually handle the nuances of C++ Arduino projects.</p><blockquote><em>💥 </em><strong><em>Master AI &amp; Tech Skills</em></strong><br> 🎓 Get Up to 50% OFF Premium Courses<br> ⏰ Limited-Time Offer<br><a href="https://trk.udemy.com/zz4NBO"><em>👉 </em><strong><em>Enroll Now &amp; Start Learning</em></strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITogvtC6mF2BUF35Qsd9pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*dxPG3BILzeHie_6isOej2g.gif" /><figcaption>The core functionality in action: The Waveshare ESP32-S3 is successfully looping through .png images from the SD card, automatically changing the photo every 3 seconds using the non-blocking code generated by Cursor.</figcaption></figure><h3><strong>What this project is about</strong></h3><p>This build is a custom digital photo frame powered by the <a href="https://www.waveshare.com/esp32-s3-lcd-1.47.htm?srsltid=AfmBOookCss2_1y_jfHEWDADnVezPa6X_ufjGYwO4DV9Ssr2NLV79pwk">Waveshare ESP32-S3-LCD-1.47.</a> The core objective was to mount an SD card and continuously loop through a folder of .png images, swapping the picture every three seconds. While the board comes with a basic factory demo that does something similar, I wanted to completely reconstruct and upgrade their original code from scratch using AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gtbx9I77WGrrDSrAx5EDOA.png" /><figcaption>High-level logical diagram showing connections from web config to physical hardware.</figcaption></figure><p><strong>GitHub project</strong>: <a href="https://github.com/jegamboafuentes/mini-photo-frame-esp32-s3-1-47-inch">https://github.com/jegamboafuentes/mini-photo-frame-esp32-s3-1-47-inch</a></p><h3><strong>Project summary</strong></h3><p>Cursor completely blew my expectations out of the water. It didn’t just generate the boilerplate; it properly configured all the hardware-specific libraries, verified the code, and uploaded it directly to the USB-C connected ESP32. Dealing with custom SPI ports and SDMMC pins can usually trigger hours of debugging, but Cursor navigated the hardware setup flawlessly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*Z3wfvuhO_xkB_N7uWL0UoQ.png" /><figcaption>The conceptual link between AI prompts in Cursor IDE and deployment to the ESP32 hardware.</figcaption></figure><h3><strong>Architecture of the project</strong></h3><p>The hardware relies on the ESP32-S3R8 chip featuring 8MB PSRAM and 16MB Flash, driving a 1.47-inch IPS display with a 172 x 320 resolution. On the software side, the generated architecture is cleanly modularized into separate C++ files managing the ST7789 display, the SD card, the RGB lamp, and a local web configuration interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dq_Y6Ytv5YEXSwCoVFw-iQ.png" /><figcaption>A detailed look at the C++ modular software design alongside the hardware components.</figcaption></figure><h3><strong>Project content</strong></h3><p>To get started, I provided Cursor with this exact initial prompt to set the hardware context:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3mGX10d2kOH52P-e0Dvhg.png" /><figcaption>Putting the AI to work on writing C++ Arduino code.</figcaption></figure><h4>First Prompt to Cursor</h4><blockquote><strong><em>Hardware Context:</em></strong><em> Board: Waveshare ESP32-S3-LCD-1.47 (ESP32-S3R8 with 8MB PSRAM, 16MB Flash) Display: 1.47-inch IPS, 172 x 320 resolution LCD SPI Pins: MOSI=45, SCLK=40, CS=42, DC=41, RST=39, BL=48 MicroSD (SDMMC) Pins: CMD=15, CLK=14, D0=16, D1=18, D2=17, D3=21</em></blockquote><blockquote><strong>Product link</strong>: <a href="https://www.waveshare.com/esp32-s3-lcd-1.47.htm?srsltid=AfmBOookCss2_1y_jfHEWDADnVezPa6X_ufjGYwO4DV9Ssr2NLV79pwk">https://www.waveshare.com/esp32-s3-lcd-1.47.htm?srsltid=AfmBOookCss2_1y_jfHEWDADnVezPa6X_ufjGYwO4DV9Ssr2NLV79pwk</a></blockquote><blockquote><strong><em>The Goal:</em></strong><em> I want to build a digital photo frame that loops through .png images stored in the root directory of the SD card, changing the image every 3 seconds.</em></blockquote><blockquote><strong><em>Instructions for the sketch:</em></strong><em> Use the SD_MMC.h library configured with the custom pins provided above to mount the SD card in 4-bit mode. Use the Arduino_GFX library (or TFT_eSPI if configured for ST7789 172x320) for display output. Use the PNGdec library (by Larry Bank) to decode the PNG images directly from the SD card. Write a non-blocking loop (using millis()) that scans the root directory / of the SD card. Every 3 seconds, decode and render the next .png file found in the directory to the screen. When the end of the directory is reached, loop back to the first image.</em></blockquote><h3><strong>Web Config</strong></h3><p>Generating the loop was just the starting point. I went through many iterations and back-and-forth prompting with Cursor to refine the system into the final project. Ultimately, the IDE helped me build out a fully functional web interface. I can connect directly to the ESP32 over Wi-Fi to upload or delete pictures on the fly, and even configure the RGB LED on the back of the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*OvWhuec2SITzF8BZ3imx1Q.png" /><figcaption>The sleek, responsive web interface for managing slideshow settings and photo uploads.</figcaption></figure><p>To give you an idea of how seamless this is, check out these screenshots. The main dashboard makes it easy to manage your current gallery, while the upload screen allows you to drop new files straight into the SD card over the network. Seeing the physical device display a crisp image and watching the live frame loop through the gallery seamlessly makes the whole effort worthwhile. It turns a static piece of hardware into a dynamic, user-friendly smart display.</p><h3><strong>Conclusion</strong></h3><p>Building hardware integrations is faster than ever, and you no longer need to spend hours digging through C++ library documentation to get a working prototype. You can use this experiment as a baseline guide to prompt Cursor for even cooler deployments. If you want to build this yourself, grab a Waveshare board and check out my full project code on GitHub here. Let me know what you end up deploying to your own devices!</p><p><strong>GitHub project</strong>: <a href="https://github.com/jegamboafuentes/mini-photo-frame-esp32-s3-1-47-inch">https://github.com/jegamboafuentes/mini-photo-frame-esp32-s3-1-47-inch</a>.</p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9QTaaaxboQP_gKSLedW_w.png" /></figure><p>👉 Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></p><p>👉 Follow us: <a href="https://medium.com/codetodeploy"><strong>Medium</strong></a></p><p>👉 CodeToDeploy Tech Community is live on Discord — <a href="https://discord.gg/ZpwhHq6D"><strong>Join now!</strong></a></p><p><strong>Disclosure:</strong> This post includes affiliate and partnership links.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62b48bfcf4b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codetodeploy/from-prompt-to-prototype-building-an-esp32-smart-photo-frame-with-cursor-ide-62b48bfcf4b9">From Prompt to Prototype: Building an ESP32 Smart Photo Frame with Cursor IDE</a> was originally published in <a href="https://medium.com/codetodeploy">CodeToDeploy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reinventing HTTP 402: How I Built an On-Chain Arcade Game on Base]]></title>
            <link>https://medium.com/codetodeploy/reinventing-http-402-how-i-built-an-on-chain-arcade-game-on-base-a319533003a7?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/a319533003a7</guid>
            <category><![CDATA[base-network]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[x402]]></category>
            <category><![CDATA[web3-game-development]]></category>
            <category><![CDATA[x402-protocol]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Fri, 21 Aug 2026 21:19:03 GMT</pubDate>
            <atom:updated>2026-09-03T09:58:24.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*C5vDFHOBh-9jQBndEqOr5w.gif" /><figcaption>The <a href="https://quetzal402.metaverseprofessional.tech/">Quetzal402</a> game interface, featuring a custom Aztec pixel-art aesthetic and live Base Mainnet vault tracking.</figcaption></figure><p>As a data engineer architect and the founder of <a href="https://metaverseprofessional.tech/">Metaverse Professional LLC</a>, I spend a lot of time designing enterprise data pipelines and exploring decentralized architectures. After my team, <a href="https://www.lightningbounties.com/"><em>Lightning Bounties</em></a>, <a href="https://jegamboafuentes.medium.com/our-epic-win-at-the-mit-bitcoin-hackathon-2024-34fab944e78d">won the MIT Bitcoin Hackathon in 2024</a>, I became obsessed with solving the friction of internet-native payments. Our hackathon project focused on micro-incentives, which made it crystal clear how clunky traditional <em>Web3 payments</em> — with their multi-step wallet approvals — can be. Traditional fiat gateways, with their credit cards and subscriptions, aren’t much better for micro-transactions.</p><blockquote><em>💥 </em><strong><em>Master AI &amp; Tech Skills</em></strong><br> 🎓 Get Up to 50% OFF Premium Courses<br> ⏰ Limited-Time Offer<br><a href="https://trk.udemy.com/zz4NBO"><em>👉 </em><strong><em>Enroll Now &amp; Start Learning</em></strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITogvtC6mF2BUF35Qsd9pg.png" /></figure><p><strong>Live Game 🎮</strong>: <a href="https://quetzal402.metaverseprofessional.tech/">https://quetzal402.metaverseprofessional.tech/</a></p><p><strong>GitHub</strong>: <a href="https://github.com/jegamboafuentes/quetzal402">https://github.com/jegamboafuentes/quetzal402</a></p><p><strong>By </strong><a href="https://enriquegamboa.info/"><strong>Enrique Gamboa</strong></a></p><h4>Enter the <a href="https://x402.org/"><strong>x402 protocol</strong></a>.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/147/1*7nZNTTKbYsovCd-IK6hBKA.png" /><figcaption>x402 official logo</figcaption></figure><p>To test how this protocol works in the wild, I used Cursor AI to build a “<em>Hello World</em>” application: <a href="https://quetzal402.metaverseprofessional.tech/"><strong>Quetzal402</strong></a>, an Aztec-themed Web3 arcade game. Here is a deep dive into how I built it, how the x402 protocol handles the money, and why this standard is the missing link for the machine-to-machine economy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*3GxxWu9-bWfRKE12Y8oJ2A.png" /><figcaption>The official game logo, merging the Feathered Serpent motif with the x402 protocol badge.</figcaption></figure><h3>The Vision: Reinventing Web3 Micro-Tolls</h3><p>For decades, HTTP 402 Payment Required has remained one of the web’s most elusive status codes—reserved in the HTTP specification, but rarely implemented natively in web architectures.</p><p>With the emergence of <em>Layer 2 networks</em> like <a href="https://www.base.org/">Base</a> and developer tooling from the <a href="https://www.coinbase.com/developer-platform">Coinbase Developer Platform</a> (CDP), the <a href="https://x402.org/"><em>x402 protocol</em> </a>finally brings native payment handshakes to standard web APIs.</p><p>In Quetzal402: The Feathered Ledger:</p><ol><li><strong>Spectators &amp; players crowdfund the prize vault</strong> by boosting it with USDC via x402-gated API endpoints.</li><li><strong>Players compete for the high score</strong> on a canvas grid.</li><li><strong>The champion who breaks the record</strong> automatically drains the accrued prize pool directly to their wallet.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iwqnBV7GlcyMeL0FSN6tlw.png" /><figcaption>The core game mechanics: crowdfund the prize vault via micro-tolls, beat the high score, and claim the USDC pool on-chain.</figcaption></figure><h3>1. How the x402 Protocol Works Under the Hood</h3><p>Unlike traditional Web3 workflows that require complex frontend smart contract abstractions (approve() followed by transferFrom()), the x402 protocol handles payments directly at the HTTP layer.</p><h4>The Problem with Traditional Web3 Payments</h4><ul><li>Requires 2 separate wallet transactions (Approve allowance + Transfer).</li><li>High friction for micro-transactions and API monetization.</li><li>Tight coupling between frontend Web3 libraries and custom smart contracts.</li></ul><h4>The x402 Solution: EIP-3009 Gasless Signatures</h4><p>USDC natively supports <strong>EIP-3009 (</strong>TransferWithAuthorization<strong>)</strong>. This allows users to sign an off-chain message granting permission to transfer tokens. The x402 Facilitator takes that cryptographic signature and broadcasts the settlement transaction to the Base network on the user&#39;s behalf.</p><h3>2. Implementing the Backend Guard: @x402/express</h3><p>On the server side (<a href="https://github.com/jegamboafuentes/quetzal402/blob/main/quetzal402/server.js">server.js</a>), protecting a route with x402 requires wrapping the endpoint with the withPayment middleware.</p><p>JavaScript:</p><pre>import express from &#39;express&#39;;<br>import { x402Server, withPayment } from &#39;@x402/express&#39;;<br>const app = express();<br>app.use(express.json());<br>// 1. Dynamic Pricing Function<br>const vaultDepositPricing = async (req) =&gt; {<br>  const selectedNetwork = req.query.network === &#39;base&#39; ? &#39;base&#39; : &#39;base-sepolia&#39;;<br>  const depositAmount = req.body?.amount ? String(req.body.amount) : &quot;1.00&quot;;<br>  return {<br>    amount: depositAmount,<br>    currency: &quot;USDC&quot;,<br>    network: selectedNetwork,<br>    receiver: process.env.VAULT_RECEIVER_ADDRESS<br>  };<br>};<br>// 2. Protected Route: HTTP 402 Enforcement<br>app.post(<br>  &#39;/api/vault/deposit&#39;,<br>  withPayment(x402Server, vaultDepositPricing),<br>  async (req, res) =&gt; {<br>    // This handler ONLY executes once the payment is cryptographically verified!<br>    const receipt = req.paymentReceipt;<br>    <br>    // Update internal database / high score ledger state<br>    vaultBalance += parseFloat(req.body.amount || 1);<br>    <br>    res.json({<br>      success: true,<br>      message: &quot;The Feathered Serpent is pleased. Vault boosted!&quot;,<br>      txHash: receipt.transactionHash,<br>      newVaultBalance: vaultBalance<br>    });<br>  }<br>);</pre><p>When an unauthenticated client hits /api/vault/deposit, the server immediately responds with:</p><p>HTTP</p><pre>HTTP/1.1 402 Payment Required<br>Content-Type: application/json<br>{<br>  &quot;error&quot;: &quot;Payment Required&quot;,<br>  &quot;paymentRequirements&quot;: {<br>    &quot;network&quot;: &quot;base&quot;,<br>    &quot;token&quot;: &quot;0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&quot;,<br>    &quot;amount&quot;: &quot;1.00&quot;,<br>    &quot;recipient&quot;: &quot;0x...&quot;<br>  }<br>}</pre><h3>3. The Frontend Interceptor: @x402/client</h3><p>On the client side (<a href="https://github.com/jegamboafuentes/quetzal402/blob/main/quetzal402/public/x402-client.js">public/x402-client.js</a>), the @x402/client SDK acts as an intelligent fetch wrapper.</p><p>When the client receives the 402 Payment Required response, it intercepts the payload, extracts the payment requirements, and triggers MetaMask / Coinbase Wallet for an EIP-712 / EIP-3009 typed data signature:</p><p>JavaScript</p><pre>import { createX402Client } from &#39;@x402/client&#39;;<br>import { ethers } from &#39;ethers&#39;;<br>// 1. Initialize the Provider &amp; Signer<br>const provider = new ethers.BrowserProvider(window.ethereum);<br>const signer = await provider.getSigner();<br>// 2. Create the x402 Client<br>const x402Client = createX402Client({<br>  signer,<br>  network: currentNetwork // &#39;base&#39; or &#39;base-sepolia&#39;<br>});<br>// 3. Make the API Call<br>// The client automatically negotiates the 402 challenge and settles the payment<br>const response = await x402Client.fetch(&#39;/api/vault/deposit?network=base&#39;, {<br>  method: &#39;POST&#39;,<br>  headers: { &#39;Content-Type&#39;: &#39;application/json&#39; },<br>  body: JSON.stringify({ amount: depositAmount })<br>});<br>const result = await response.json();<br>console.log(&quot;Vault boosted successfully:&quot;, result.txHash);</pre><h3>4. The Flow: Deposit &amp; Payout Mechanics</h3><h4>A. Crowdfunding the Vault (Deposit)</h4><p>Here is an architectural deep dive into how x402 works, how the handshake is negotiated, and how this was brought to life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rq0NgVne2AkgJLuu5CdqTA.png" /><figcaption>The vault deposit flow, illustrating how the HTTP 402 status intercepts requests to trigger an EIP-3009 wallet signature.</figcaption></figure><ul><li>The user selects <strong>Base Mainnet</strong> or <strong>Base Sepolia Testnet</strong> from the network selector.</li><li>The user inputs their desired contribution (e.g., 1 USDC) and clicks <strong>Boost Vault</strong>.</li><li>A single signature popup confirms the TransferWithAuthorization request without requiring a prior approval transaction.</li><li>The money will always go to this wallet: <a href="https://basescan.org/address/0x92B2682CB39D302bDD12d2e5b1eBa830232f3208">0x92B2682CB39D302bDD12d2e5b1eBa830232f3208</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*L-uVuMcXkQleTbM1d7SM4g.png" /><figcaption>A frictionless 1 USDC deposit using a gasless TransferWithAuthorization signature, instantly updating the shared prize vault.</figcaption></figure><h4>B. Beating the Feathered Serpent (Payout)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*u2-Ydw69O2YpfnR4RmWupQ.gif" /><figcaption>Record Broken message — This enables the player to withdraw the vault</figcaption></figure><p>Here is the architectual diagram of how Payout works in the game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R3RGgIwuNVaTfAa_GOw-ug.png" /><figcaption>The automated payout architecture, showing how the backend anti-cheat engine verifies a high score before the CDP Facilitator disburses the prize.</figcaption></figure><ul><li>The player navigates Quetzalcoatl to consume jade stones on the 2D canvas (built with Phaser.js).</li><li>Upon game over, if the score beats the active Current Record, the anti-cheat payload (inputLog keystroke array + timestamps) is posted to /api/score/submit.</li><li>The server validates run integrity and unlocks the <strong>Withdraw Prize</strong> state.</li><li>Clicking <strong>Withdraw Prize</strong> authorizes the server-side CDP wallet to disburse the accumulated USDC balance directly to the winning player’s wallet address.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*uf161WcygmTYYKvQQNzJ_g.png" /><figcaption>The moment of victory: the backend automatically drains the 9 USDC prize pool and transfers it directly to the champion’s connected wallet.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fao9sH1-l-XZgJUoeKhf2g.jpeg" /><figcaption>Notification of deposit from the game to my wallet.</figcaption></figure><h3>5. Rapid Prototyping with Cursor AI</h3><p>Building a full-stack Web3 application involving Phaser 3 game physics, Express middleware, CDP Facilitator settlement, and responsive pixel-art layouts can involve significant boilerplate.</p><p>By leveraging <strong>Cursor AI</strong>, development moved rapidly through focused prompts:</p><ul><li><strong>Contextual Refactoring:</strong> Translating raw HTTP 402 interceptors into reusable client modules.</li><li><strong>Network Isolation:</strong> Seamlessly structuring dual-environment switching between Base Mainnet (8453) and Base Sepolia (84532) without code duplication.</li><li><strong>Responsive Aztec Theming:</strong> Generating custom glassmorphic CSS palettes and touch event listeners for mobile gameplay.</li></ul><p>Instead of getting bogged down in boilerplate game physics or CSS glassmorphism, I used Cursor’s composer to handle the frontend and the Aztec aesthetic. This allowed me to focus my engineering purely on the x402 integration and the backend architecture.</p><h3>Conclusion &amp; Live Demo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1OX9W_Uv3jmuZFLjUvwm0g.png" /><figcaption>The desktop gameplay experience built with Phaser.js, featuring real-time, on-chain ledger statistics on the right panel.</figcaption></figure><p>Building <a href="https://quetzal402.metaverseprofessional.tech/">Quetzal402</a> proved how frictionless Web3 payments have become. By combining the speed of the Base network, the stability of USDC, and the elegance of the x402 protocol, we are finally realizing the original vision of the internet economy.</p><p>While <a href="https://quetzal402.metaverseprofessional.tech/">Quetzal402 </a>uses this protocol for a retro arcade game, the implications are massive. As AI models become more autonomous, they will need to pay for compute, API access, and data feeds without human intervention. The x402 protocol provides the exact HTTP-native rails required for this machine-to-machine economy to thrive.</p><p>The infrastructure is here. It’s time to start building.</p><ul><li><strong>🎮 Live Game:</strong> <a href="https://quetzal402.metaverseprofessional.tech/">https://quetzal402.metaverseprofessional.tech/</a></li><li><strong>📦 GitHub Repository:</strong> <a href="https://www.google.com/search?q=https://github.com/jegamboafuentes/quetzal402">https://github.com/jegamboafuentes/quetzal402</a></li><li><strong>🛠️ Built by:</strong> <a href="https://metaverseprofessional.tech/">Metaverse Professional LLC</a> | Enrique Gamboa (<a href="https://enriquegamboa.info/">enriquegamboa.info</a>)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MN6tiznems-SAUwY2ufD1g.png" /><figcaption>Quetzalcoatl guarding the Base network emblem, representing the Layer 2 infrastructure powering the game’s micro-transactions.</figcaption></figure><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9QTaaaxboQP_gKSLedW_w.png" /></figure><p>👉 Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></p><p>👉 Follow us: <a href="https://medium.com/codetodeploy"><strong>Medium</strong></a></p><p>👉 CodeToDeploy Tech Community is live on Discord — <a href="https://discord.gg/ZpwhHq6D"><strong>Join now!</strong></a></p><p><strong>Disclosure:</strong> This post includes affiliate and partnership links.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a319533003a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codetodeploy/reinventing-http-402-how-i-built-an-on-chain-arcade-game-on-base-a319533003a7">Reinventing HTTP 402: How I Built an On-Chain Arcade Game on Base</a> was originally published in <a href="https://medium.com/codetodeploy">CodeToDeploy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built and Deployed My First MCP Server for Boston’s MBTA — and Cursor Changed the Game ]]></title>
            <link>https://medium.com/codetodeploy/i-built-and-deployed-my-first-mcp-server-for-bostons-mbta-and-cursor-changed-the-game-ba0b37034074?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba0b37034074</guid>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[google-cloud-run]]></category>
            <category><![CDATA[mbta]]></category>
            <category><![CDATA[mcps]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 15:48:06 GMT</pubDate>
            <atom:updated>2026-09-01T07:37:44.601Z</atom:updated>
            <content:encoded><![CDATA[<p><em>From an MBTA API I first played with years ago to a fully deployed Model Context Protocol server running on Google Cloud.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xm6mwwE13RD-SI3rUCpFBA.png" /><figcaption>The idea behind the project: connect AI clients to live Boston transit data through my MBTA MCP server.</figcaption></figure><blockquote><em>💥 </em><strong><em>Master AI &amp; Tech Skills </em></strong><br> 💥 Crack Every Tech Interview with Confidence<br> 🔥 Up to <strong>70% OFF</strong> — Limited-Time Offer<br> <a href="https://www.educative.io/unlimited?aff=xkRD"><em>👉 </em><strong><em>Enroll Now &amp; Start Learning</em></strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITogvtC6mF2BUF35Qsd9pg.png" /></figure><p>A few years ago, I built one of my favorite little projects.</p><p>I created a physical subway arrival board for my apartment using the <strong><em>MBTA API</em></strong><em>, an LED matrix, Python, and an Adafruit Matrix Portal.</em></p><p>The reason was pretty simple: <strong>I kept missing the train </strong>😂.</p><p>I documented that project here:</p><p>👉 <a href="https://jegamboafuentes.medium.com/i-created-my-own-subway-arrival-board-with-real-time-data-to-dont-miss-my-train-anymore-28bfded312c0">I created my own subway arrival board with real-time data to not miss my train anymore</a> 🤘</p><p>That project introduced me to the <a href="https://www.mbta.com/developers/v3-api">MBTA V3 API</a>, and since then I have always liked it. It is simple, useful, provides real-time data, and most importantly, it solves a problem that I can actually relate to living in Boston. 🤣</p><p>Fast-forward a few years and I found myself wanting to learn something completely different:</p><p><strong>MCP — Model Context Protocol.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oI0FZ5rFJP5fk5ghKKX5wA.png" /><figcaption>My simplified view of MCP: an AI client, an MCP server, and the external data or tools it needs.</figcaption></figure><p>I have been reading more and more about <em>MCPs </em>and how AI applications can use them to interact with external systems, APIs and tools.</p><p><strong>Instead of only reading documentation, I wanted to build one.</strong></p><p>So I cracked my fingers 🧑🏻‍💻 and started working.</p><p>But this time I added another experiment to the project: 🦾🦾</p><p><strong>How much of this could I build using Cursor 🤖?</strong></p><p>The result surprised me.</p><p><strong>A F. lot! 🤯</strong></p><h3>First… what is an MCP? 🤔</h3><p>My simplified way of understanding MCP is this:</p><p>Normally, an AI model knows how to communicate with you using text.</p><p>But what if you want it to actually <strong>do something</strong> or retrieve information from another system?</p><p>For example:</p><blockquote><em>“What are the next Red Line trains at South Station?”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZS_A-PGmNNG6edzxgXinw.png" /><figcaption>Boston, MBTA South Station</figcaption></figure><p>The AI itself does not automatically know the current MBTA arrival times.</p><p>Someone needs to provide that information.</p><p>This is where MCP becomes interesting.</p><p>An MCP server can expose specific <strong>tools</strong> that an AI application understands how to discover and call.</p><p>In my case, I wanted something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*7Du_Ke6Rs0OAht6PLEYKCA.png" /><figcaption>Instead of connecting every AI client directly to the MBTA API, the MCP server becomes the common interface.</figcaption></figure><p>Instead of teaching every AI client individually how to communicate with the MBTA API, I expose a standard MCP interface.</p><p>The AI can discover tools like:</p><pre>get_routes()</pre><pre>find_stop()</pre><pre>get_next_arrivals()</pre><pre>get_alerts()</pre><pre>get_vehicles()</pre><p>And then decide which tools it needs to answer a question.</p><p>That was the moment when MCP really clicked for me.</p><h3>Going back to an API I already knew 🚇</h3><p>For my first MCP, I did not want to start with a complicated data source.</p><p>I wanted to focus on understanding MCP itself.</p><p>That brought me back to the <a href="https://www.mbta.com/developers/v3-api">MBTA API</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*mKBIsxOIcEGlx2SPSZQf9Q.png" /><figcaption>MBTA API, or the T as locals said</figcaption></figure><p>The same API that powered the little train board sitting in my apartment years ago was now going to power an AI tool.</p><p>I liked that connection.</p><p><a href="https://jegamboafuentes.medium.com/i-created-my-own-subway-arrival-board-with-real-time-data-to-dont-miss-my-train-anymore-28bfded312c0">My old project</a> looked more like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK4r9ErAiMfdwpiuPDj1QA.png" /><figcaption><a href="https://jegamboafuentes.medium.com/i-created-my-own-subway-arrival-board-with-real-time-data-to-dont-miss-my-train-anymore-28bfded312c0">My original project</a>: MBTA API → Python → a physical LED subway arrival board.</figcaption></figure><p>The new project looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*uQlQNmM2_3PVtA1ZZ6-_kg.png" /><figcaption>Same MBTA data source, completely different use case: now the API is powering an MCP server for AI clients.</figcaption></figure><p>Same data source.</p><p>Completely different use case.</p><h3>Enter Cursor 👀</h3><p>This was also my first serious experiment to see how far I could push <strong>Cursor Agent</strong>.</p><p>Instead of creating every file manually, I opened an empty project and started describing what I wanted.</p><p>This is what I prompted:</p><pre>Build an MBTA Model Context Protocol server.</pre><pre>Use:</pre><pre>- Python 3.12<br>- Official MCP Python SDK<br>- Streamable HTTP<br>- httpx<br>- Uvicorn<br>- Docker<br>- pytest<br>- MBTA V3 API<br>- Google Cloud Run<br>- Google Secret Manager</pre><pre>Create MCP tools for:</pre><pre>- routes<br>- stops<br>- station search<br>- arrival predictions<br>- service alerts<br>- live vehicles</pre><pre>Add:</pre><pre>- error handling<br>- tests<br>- Docker support<br>- health endpoint<br>- environment-based configuration<br>- production deployment support</pre><pre>The final MCP endpoint should be:</pre><pre>https://mbta.metaverseprofessional.tech/mcp</pre><p>Then I told Cursor something that I think was very important:</p><p><strong>Do not deploy anything until everything works locally.</strong></p><p>So we worked in stages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iGm7uQYQ4-DHnUrbD7ST3g.png" /><figcaption>The build strategy: MBTA API → Python client → MCP tools → local testing → Docker → Google Cloud.</figcaption></figure><p><strong>And Cursor started building.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/0*JdgQTxycH62HKGkn.gif" /><figcaption>Build it, test it, break it, fix it, repeat. Cursor made this development loop incredibly fast.</figcaption></figure><p>Files appeared.</p><p>Tests appeared.</p><p><em>Errors appeared too!</em> 😅.</p><p>But this is where things became really interesting.</p><p>Cursor would run the application, inspect the error, understand what was failing, modify the code, run it again and continue.</p><p>That development loop was incredibly fast ⚡⚡⚡.</p><h3>The MCP tools 🛠️</h3><p>The current server exposes several MBTA capabilities.</p><h3>get_routes</h3><p>Returns MBTA routes and allows filtering by transportation type.</p><h3>get_stops_for_route</h3><p>Returns all the stops associated with a specific route.</p><h3>find_stop</h3><p>Allows the AI to search for a station by a human-friendly name and resolve it to the MBTA stop ID.</p><p>For example: South Station = <em>place-sstat</em></p><h3>get_next_arrivals</h3><p>Returns live MBTA arrival/departure predictions for a station.</p><h3>get_alerts</h3><p>Retrieves current service alerts.</p><p>So an AI could ask:</p><blockquote><em>Are there currently any problems 🚆 with the Red Line 🔴?</em></blockquote><h3>get_vehicles</h3><p>Returns live vehicle positions for an MBTA route.</p><p>That means the MCP is not just a Hello World server returning: <em>Hello Enrique!</em></p><p>It is actually connected to a real production API returning real-world, constantly changing transit information.</p><p><strong>That was important to me.</strong></p><p>I wanted my first MCP to be something that could actually be used.</p><h3>The technology behind it ⚙️</h3><p>The stack ended up being intentionally simple.</p><h3>Application</h3><ul><li><strong>Python 3.12</strong></li><li><strong>MCP Python SDK</strong></li><li><strong>httpx</strong></li><li><strong>Uvicorn</strong></li><li><strong>Streamable HTTP</strong></li></ul><h3>Testing</h3><ul><li><strong>pytest</strong></li><li>Integration tests against the <a href="https://www.mbta.com/developers/v3-api">MBTA API</a></li><li>MCP smoke tests</li></ul><h3>Infrastructure</h3><ul><li><strong>Docker</strong></li><li><strong>Google Cloud Run</strong></li><li><strong>Google Secret Manager</strong></li><li><strong>Google Cloud</strong></li><li>Custom domain (Mine is: <a href="https://metaverseprofessional.tech/">https://metaverseprofessional.tech/</a>)</li></ul><h3>Data</h3><ul><li><a href="https://www.mbta.com/developers/v3-api"><strong>MBTA V3 API</strong></a></li></ul><h3>Development</h3><ul><li><strong>Cursor</strong></li><li><strong>GitHub</strong></li></ul><p>The MBTA API key is not hard-coded anywhere in the application.</p><p>Locally it comes from an environment variable (.env), while in Google Cloud the secret is managed outside the code.</p><h3>Deploying it to Google Cloud ☁️</h3><p>Once everything worked locally and inside Docker, I gave Cursor the next challenge:</p><h4><em>Deploy it.</em></h4><p>I already had my Google Cloud account and project available, so Cursor was able to use the Google Cloud CLI from the terminal.</p><p>The application was deployed to <strong>Google Cloud Run</strong>.</p><p>The architecture now looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*sbpHvOtUpOYsUZcQYV3tnQ.png" /><figcaption>The final production architecture: MCP clients connect through Streamable HTTP to my Python MCP server on Google Cloud Run, which retrieves live data from the MBTA V3 API.</figcaption></figure><p>I also connected my domain so the final production MCP endpoint became:</p><p>👉 <a href="https://mbta.metaverseprofessional.tech/mcp"><strong>https://mbta.metaverseprofessional.tech/mcp</strong></a></p><p>Cursor also created a landing page for the MCP: <a href="https://mbta.metaverseprofessional.tech/">mbta.metaverseprofessional.tech</a></p><p>Exactly what I wanted.</p><h3>I accidentally got a website too 😄</h3><p>One thing that I liked was that I asked Cursor to give the project a simple landing page.</p><p>So instead of visiting the domain and seeing some boring server response, there is now a human-friendly page explaining the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKTOM7XGoKsUq5fHj2cv5Q.png" /><figcaption>The live MBTA MCP landing page that Cursor created and deployed along with the server.</figcaption></figure><p>You can see the <strong>live functional project here</strong>:</p><p>👉 <a href="https://mbta.metaverseprofessional.tech/">https://mbta.metaverseprofessional.tech/</a></p><p>And the actual MCP endpoint is:</p><p>👉 <a href="https://mbta.metaverseprofessional.tech/mcp">https://mbta.metaverseprofessional.tech/mcp</a></p><p>The complete source code is also public:</p><p>👨🏻‍💻 <strong>GitHub:</strong><br><a href="https://github.com/jegamboafuentes/MBTA-MCP">https://github.com/jegamboafuentes/MBTA-MCP</a></p><p>Feel free to clone it, experiment with it, break it, improve it, or use it as inspiration for your own MCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*SqWkdfDNBZX-qu_A.gif" /><figcaption>The complete project is open source — clone it, experiment with it, and use it as a starting point for your own MCP.</figcaption></figure><h3>The part that surprised me the most: Cursor 🤯</h3><p>This project started because I wanted to learn MCP.</p><p>But I ended up learning something else at the same time.</p><p><strong>AI-assisted software development is moving incredibly fast.</strong></p><p>I have around <strong>15 years of experience developing software</strong>, so I have seen plenty of tools promising to make developers more productive.</p><ul><li>IDEs.</li><li>Frameworks.</li><li>Low-code tools.</li><li>Code generators.</li><li>Cloud platforms.</li><li>Copilots.</li></ul><p>But this felt different 🤯😮.</p><p>I was not just asking Cursor:</p><blockquote><strong><em>Write a Python function for me.</em></strong></blockquote><p>I was asking it:</p><blockquote><em>Build this architecture.</em></blockquote><p>Then:</p><blockquote><em>Run it.</em></blockquote><p>Then:</p><blockquote><em>Test it.</em></blockquote><p>Then:</p><blockquote><em>Fix what is broken.</em></blockquote><p>Then:</p><blockquote><em>Dockerize it.</em></blockquote><p>Then:</p><blockquote><em>Deploy it to my Google Cloud account.</em></blockquote><p>Then:</p><blockquote><em>Connect it to my domain.</em></blockquote><p>And it did an incredible amount of that work with me.</p><p>I still needed to understand what I was building.</p><p>I still needed to make architectural decisions.</p><p>I still needed to provide credentials and make decisions around infrastructure and security.</p><p>But the speed between <strong>idea → working software</strong> was something I honestly could not believe.</p><h3>Cursor came to change the game 🎮</h3><p><strong>That is probably my biggest conclusion from this experiment.</strong></p><p>A few years ago I used the MBTA API to build a physical train arrival board.</p><p>This week I used the same API to build a production MCP server capable of providing real-time transportation tools to AI applications.</p><p>But the biggest difference was not the API.</p><p>It was the development process.</p><p>The amount of time between thinking:</p><blockquote><em>“It would be cool if I built an MBTA MCP…”</em></blockquote><blockquote>😎</blockquote><p>and having this:</p><pre>https://mbta.metaverseprofessional.tech/mcp</pre><p>running on Google Cloud was ridiculously small.</p><p>After developing software for around 15 years, that is the part that really got my attention.</p><p>Cursor did not eliminate the need to know software development.</p><p>Actually, I think knowing architecture, APIs, cloud infrastructure and how systems fit together made the experience significantly better.</p><p>But it dramatically compressed the time required to turn those decisions into something functional.</p><p>And I think that is where things are heading.</p><p>The developer becomes more and more responsible for describing:</p><pre>What should exist?</pre><pre>How should it work?</pre><pre>How should the pieces communicate?</pre><pre>What constraints should we follow?</pre><pre>How do we know it actually works?</pre><p>And agents increasingly take care of a large portion of the implementation loop.</p><p>That is a pretty big change.</p><h3>What’s next? 🚀</h3><p>This is only my first MCP.</p><p>For the next iterations I would like to experiment with things such as:</p><ul><li>Authentication</li><li>OAuth</li><li>Better caching</li><li>More MBTA endpoints</li><li>Accessibility information</li><li>Nearby station searches</li><li>More intelligent station summaries</li><li>Connecting the MCP to different AI clients</li><li>Building MCPs around more complex APIs and private data sources</li></ul><p>But for now I am pretty happy with milestone number one:</p><p>✅ First MCP built<br>✅ Connected to a real API<br>✅ Dockerized<br>✅ Tested<br>✅ Deployed to Google Cloud<br>✅ Custom domain<br>✅ Public GitHub repository<br>✅ Actually works 😎</p><p>Not bad for my first MCP.</p><h3>Try it yourself</h3><p>🚇 <strong>Live project:</strong><br><a href="https://mbta.metaverseprofessional.tech/">https://mbta.metaverseprofessional.tech/</a></p><p>🤖 <strong>MCP endpoint:</strong><br><a href="https://mbta.metaverseprofessional.tech/mcp">https://mbta.metaverseprofessional.tech/mcp</a></p><p>👨🏻‍💻 <strong>Source code:</strong><br><a href="https://github.com/jegamboafuentes/MBTA-MCP">https://github.com/jegamboafuentes/MBTA-MCP</a></p><p>And if you are thinking about building your first MCP…</p><p>My recommendation is the same approach I followed here:</p><p><strong>Pick an API you already understand and start building.</strong></p><p>You might be surprised by how quickly you can go from an idea to something real. 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*zVbtT-QQCiaWPUWX.gif" /><figcaption>Still coding after all these years… just with considerably more powerful tools now. 🦖💻</figcaption></figure><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9QTaaaxboQP_gKSLedW_w.png" /></figure><p>👉 Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></p><p>👉 Follow us: <a href="https://medium.com/codetodeploy"><strong>Medium</strong></a></p><p>👉 CodeToDeploy Tech Community is live on Discord — <a href="https://discord.gg/ZpwhHq6D"><strong>Join now!</strong></a></p><p><strong>Disclosure:</strong> This post includes affiliate and partnership links.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba0b37034074" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codetodeploy/i-built-and-deployed-my-first-mcp-server-for-bostons-mbta-and-cursor-changed-the-game-ba0b37034074">I Built and Deployed My First MCP Server for Boston’s MBTA — and Cursor Changed the Game 🚇🤖</a> was originally published in <a href="https://medium.com/codetodeploy">CodeToDeploy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate UI for Pimoroni Badger 2040: Creating Digital Badges Just Got Easy]]></title>
            <link>https://jegamboafuentes.medium.com/the-ultimate-ui-for-pimoroni-badger-2040-creating-digital-badges-just-got-easy-35cbe7c10d19?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/35cbe7c10d19</guid>
            <category><![CDATA[pimoroni]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[makers]]></category>
            <category><![CDATA[webserialapi]]></category>
            <category><![CDATA[badger2040]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 19:58:47 GMT</pubDate>
            <atom:updated>2026-04-10T19:58:47.394Z</atom:updated>
            <content:encoded><![CDATA[<h3>No more manual coding. Design your custom e-ink badge in seconds with a visual, browser-based studio for Badger 2040.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpM8sEGUz31eZhbDc_EHmA.jpeg" /><figcaption>Badger 2040 studio — User creating a digital badge using a UI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CgOsqt8JHkC8G67FFtjHfw.jpeg" /><figcaption>Digital Badge created on Badger 2040 studio displayed in Pimoroni badger 2040 device</figcaption></figure><p>Badger 2040 Studio: <a href="https://badger2040studio.metaverseprofessional.tech/">Link</a></p><p>GitHub: <a href="https://github.com/jegamboafuentes/badger-2040-studio">Link</a></p><h3>Introduction</h3><p>If you’ve ever used a <a href="https://shop.pimoroni.com/en-us/products/badger-2040"><strong>Pimoroni Badger 2040</strong></a>, you know it’s a brilliant piece of hardware. It’s an <em>RP2040</em>-powered e-ink display that is perfect for digital name tags, weather stations, or mini-dashboards. However, the “<em>out-of-the-box</em>” experience for customization can be intimidating. Unless you’re comfortable writing MicroPython and manually calculating pixel coordinates for every line of text, making a simple custom badge can feel like a chore.</p><p>I wanted to change that. I wanted a way to interact with my device that felt modern and visual. That’s why I built the <a href="https://badger2040studio.metaverseprofessional.tech/"><strong>Badger 2040 Studio</strong> </a>— a dedicated user interface (UI) designed specifically to make creating digital badges as easy as dragging and dropping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RFeuG-l1rc35xsEeNOr87g.jpeg" /><figcaption>Digital Badge designed in UI Studio and displayed in pimoroni badger2040</figcaption></figure><h3>How the Studio Works</h3><p>At its core, the <strong>Badger 2040 Studio</strong> is a bridge between your browser and your hardware. It utilizes the <strong>Web Serial API</strong> to establish a direct connection to the device’s MicroPython REPL. So you just need to connect your device to your computer, and your Web Browser will recognize your Badger 2040.</p><p>When you use the visual editor, the application generates the necessary Python commands in the background. When you’re ready, it streams those commands directly to the Badger 2040 over USB, updating the e-ink display instantly without requiring you to install any local software or drivers.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Flyj79wT8Pog%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dlyj79wT8Pog&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Flyj79wT8Pog%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5183e73aa25c32f648074a52082f087/href">https://medium.com/media/a5183e73aa25c32f648074a52082f087/href</a></iframe><h3>Features: A Complete Design Suite</h3><p>The Studio is packed with features to help you get the most out of your device:</p><ul><li><strong>Visual Design UI:</strong> A drag-and-drop canvas where you can place text, draw lines, and add shapes to create your perfect layout.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPWJ-cHzgxPpaA1QBSvoxA.png" /><figcaption>Badger 2040 Studio Interface — A visual workspace enabling effortless drag-and-drop badge design and instant, real-time deployment to e-ink hardware.</figcaption></figure><ul><li><strong>Official Example Browser:</strong> Quickly switch between your custom design and official Pimoroni examples like the clock, ebook reader, or the standard badge OS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSSjgs-uN2UvBBV5S2t7kg.png" /><figcaption>Badger 2040 Studio Example Browser — Seamlessly browse, execute, and customize official Pimoroni scripts like clocks and ebook readers directly from the web interface.</figcaption></figure><ul><li><strong>Instant Execution:</strong> One click pushes your code to the device for immediate feedback.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XmMo57yGGhQ9RruKb4zUVQ.png" /><figcaption>Instant Execution in Action — A custom digital badge designed in the Studio and immediately rendered on the physical Badger 2040 hardware, demonstrating the seamless transition from browser to e-ink.</figcaption></figure><ul><li><strong>AI-Powered Foundations:</strong> I built this project using <strong>Google AI Studio</strong>. If you want to see the logic behind the app or “remix” it yourself, you can find the project here: <a href="https://ai.studio/apps/d671be32-f203-43dd-8901-155afef9a1b6">Remix on Google AI Studio</a>.</li></ul><h3>Easy Connection with your Badger 2040</h3><p>I focused on making the connection process as painless as possible. Because it’s a web-based UI, there’s nothing to download:</p><ol><li>Plug your Badger 2040 into your computer via USB-C.</li><li>Open the Studio in a modern browser (Chrome, Edge, or Opera).</li><li>Click <strong>Connect Device</strong> and select the port labeled <strong>RP2040</strong> or <strong>CircuitPython CDC</strong>.</li><li>You are now connected and ready to design.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*f_T-3rHbaQhp4nCVCeJBsQ.png" /><figcaption>Leveraging the <strong>Web Serial API</strong>, the Badger 2040 Studio allows you to see and configure your device from any modern browser simply by connecting it to your computer — no drivers or additional software are ever needed.</figcaption></figure><h3>Painpoint Solution: From Coordinates to Canvas</h3><p>The biggest pain point with the Badger 2040 has always been the “code-save-flash” loop. Trying to center a piece of text or align a graphic by guessing X and Y coordinates in a text editor is frustrating.</p><p>By providing a <strong>Visual UI</strong>, the Studio removes this barrier. You can see exactly where your elements are placed, adjust them on the fly, and see the results on your e-ink screen in seconds. It turns a coding task into a creative design process.</p><h3>My First Open-Source Project: Contribute!</h3><p>This is a proud moment for me — this is my first official open-source project released to the maker community! I’m excited to share this tool and help others get more value out of their Pimoroni hardware.</p><p>The project is live, free to use, and open for everyone: 👉 <a href="https://badger2040studio.metaverseprofessional.tech/"><strong>Try the Badger 2040 Studio UI</strong></a></p><p>I’ve also made the entire codebase available on GitHub. Whether you want to add new UI features, support more shapes, or contribute to the example library, I would love your help in making this tool even better for the community.</p><p><a href="https://github.com/jegamboafuentes/badger-2040-studio"><strong>Join the project on GitHub</strong></a> 🚀</p><h3>Conclusion</h3><p>The Pimoroni Badger 2040 is a versatile piece of tech that deserves a user-friendly interface. With the <strong>Badger 2040 Studio</strong>, I hope to make it easier for makers, developers, and hobbyists to express their creativity without getting bogged down in the technical details of pixel placement.</p><p>Grab your device, plug it in, and start creating your next badge today!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7RX2IV5m5tzl8Ualtf1eA.png" /><figcaption>Seamless Hardware Interaction — Powered by the Web Serial API, Badger 2040 Studio enables you to configure and update your device directly from any browser just by connecting it to your computer, completely eliminating the need for external drivers or complex software installations.</figcaption></figure><p>Cheers, <strong>Enrique Gamboa</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35cbe7c10d19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Installed OpenClaw on GCP and Built a Custom AI Skill to Connect to my Volkswagen ID.4]]></title>
            <link>https://medium.com/codetodeploy/how-i-installed-openclaw-on-gcp-and-built-a-custom-ai-skill-to-connect-to-my-volkswagen-id-4-287616616689?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/287616616689</guid>
            <category><![CDATA[openclaw]]></category>
            <category><![CDATA[volkswagen-id4]]></category>
            <category><![CDATA[openclaw-skills]]></category>
            <category><![CDATA[id4]]></category>
            <category><![CDATA[volkswagen]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 14:22:12 GMT</pubDate>
            <atom:updated>2026-03-15T14:22:12.260Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Installed OpenClaw on GCP and Built a Custom AI Skill to Connect to my <strong><em>Volkswagen</em></strong> ID.4 from Scratch</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnJnYvVssTF_RNwoZQgkPA.jpeg" /><figcaption>OpenClaw connected to Volkswagen ID.4</figcaption></figure><blockquote>🔥 <strong>Top Tech Jobs Are Hiring NOW — Don’t Miss Out.</strong></blockquote><blockquote>🚀 <strong>Multiple Roles Available<br> </strong><a href="https://app.usebraintrust.com/r/codeto1/"><strong>👉 Apply &amp; Secure Your Job</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkQFf0NUnzoFbVEVQCF5WQ.png" /></figure><p>For the last few weeks, I’ve been running my own personal AI agent 24/7. 🦞 Not a standard chatbot sitting in a browser tab, but a dedicated, persistent AI system called OpenClaw running on a cloud server (GCP).</p><p>The goal? To have an assistant that doesn’t just answer questions, but actually <em>does</em> things for me in the real world.</p><p>To prove it worked, I decided to build a <em>“Hello World” </em>project: teaching OpenClaw how to talk directly to my 2024 <strong><em>Volkswagen ID.4.</em></strong> The result was even better than I expected. Not only can I ask my AI for my car’s live battery level, but I recently asked it, “<em>Hey, can you calculate my mileage every day?</em>” and it automatically created a cron job to save my daily mileage into a CSV file! Now I can ask it which days I drive the most or have it calculate mileage projections for my lease 😎.</p><p>Here is exactly how I set up the cloud server, accessed the UI, and built the car integration from scratch. ☁️🚗🦞</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLcTEyIxbwDwmJ6gJr7TMw.png" /><figcaption>Telegram question — OpenClaw answer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-EVBPnOgdG7KCxZ0vvjmRw.jpeg" /><figcaption>Picture of my Volkswagen current milage, battery level and range.</figcaption></figure><h3>1. Installing OpenClaw in GCP</h3><p>I wanted this agent to be always online, so a <em>Raspberry Pi</em> under the desk wasn’t going to cut it this time. I spun up an <em>Ubuntu Virtual Machine</em> on <em>Google Cloud Platform (GCP)</em>.</p><p>I opted for a basic VM but bumped up the RAM higher than the standard tier to give the AI plenty of memory to process complex tasks. Specifically, my configuration costs me about <strong>$39 per month</strong> to keep it running 24/7 — a small price to pay for a personal, always-on digital brain.</p><p>Here is exactly how I configured the <em>VM</em> in the <em>Google Cloud Console</em>:</p><p><strong>Step 1: Create the Instance</strong></p><ul><li>Go to Compute Engine &gt; VM Instances and click <strong>Create Instance</strong>.</li><li><strong>Name:</strong> I named mine openclaw-assistant.</li><li><strong>Region/Zone:</strong> Pick whatever is closest to you (mine is running in us-east1-c ).</li></ul><p><strong>Step 2: Machine Configuration</strong></p><ul><li><strong>Machine Family:</strong> General-purpose.</li><li><strong>Machine Type:</strong> I selected the <strong>e2-standard-2</strong> instance. This gives the VM 2 vCPUs and 8GB of memory, which is the sweet spot for OpenClaw to run smoothly without breaking the bank.</li></ul><p><strong>Step 3: Enable the Display Device (Crucial!)</strong></p><ul><li>Scroll down to the <strong>Display device</strong> section and check the box for <strong>“Enable display device”</strong>.</li><li><em>Do not skip this!</em> We absolutely need this enabled so we can install a visual desktop environment and use <em>Chrome Remote Desktop</em> to access the OpenClaw UI later.</li></ul><p><strong>Step 4: Boot Disk Configuration</strong></p><ul><li>Scroll down to <strong>Boot disk</strong> and click <strong>Change</strong>.</li><li><strong>Operating System:</strong> Ubuntu.</li><li><strong>Version:</strong> Ubuntu 24.04 LTS Minimal (minimal-2404 ).</li><li><strong>Disk Type:</strong> Balanced persistent disk.</li><li><strong>Size:</strong> I bumped mine up to <strong>200 GB</strong> so I don’t run out of space when the agent starts hoarding data, logs, and new skills.</li></ul><p><strong>Step 5: Firewalls &amp; Networking</strong></p><ul><li>Under the <strong>Firewall</strong> section, make sure you check both <strong>“Allow HTTP traffic”</strong> and <strong>“Allow HTTPS traffic”</strong>. This adds the necessary network tags (http-server, https-server ) to let the server communicate with the outside world.</li><li>Click <strong>Create</strong> and wait a minute or two for the server to spin up.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZ3xsHGtYRzMLbbJFs_oTg.png" /><figcaption>Hosted GCP VM configuration that runs OpenClaw</figcaption></figure><h3>The OpenClaw Installation</h3><p>Once your VM has a green checkmark next to it, it’s time to get OpenClaw installed. You don’t need to mess with complex terminal programs on your computer; you can do this right from the browser.</p><ol><li>In your GCP VM Instances list, look for the <strong>SSH</strong> button next to your new server and click it. This opens a secure terminal window directly in your browser.</li><li>Run the official OpenClaw installer script by pasting this command and hitting Enter:</li></ol><pre>curl -fsSL https://openclaw.ai/install.sh | bash</pre><p>3. Once the installation finishes, we need to register the gateway as a background service so that it automatically turns back on if the server ever reboots. Run these two commands:</p><pre>openclaw gateway install<br>openclaw gateway start</pre><p>Assembly: done. The gateway is officially running in the cloud! ☁️. I used Telegram to communicate with OpenClaw.</p><h3>2. Remote Desktop to OpenClaw</h3><p>Here is the tricky part about running OpenClaw in the cloud: its beautiful web dashboard runs locally on port 18789. You can&#39;t just access it over the open internet without dealing with complex reverse proxies and SSL certificates.</p><p>The easiest and most secure workaround? <strong>Chrome Remote Desktop.</strong></p><p>I installed the Ubuntu desktop environment and the Chrome Remote Desktop host on my GCP VM. This allows me to securely remote into a visual desktop environment right from my browser.</p><p>Once connected, I simply open Firefox <em>inside</em> the remote VM and go to http://localhost:18789. This gives me full access to the OpenClaw UI to manage my agents, skills, and chat logs <strong>securely</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wFdIS-kxyTQQv8bNs_9WQQ.png" /><figcaption>Chrome Remote Desktop connected to VM in GCP hosting OpenClaw</figcaption></figure><h3>3. Creation of My Hello World: Remote Connection to My ID.4</h3><p>Now for the magic. I wanted OpenClaw to check my car’s battery and mileage on command.</p><p>Getting an AI to talk to a car isn’t as simple as just asking nicely; you have to securely interface with the manufacturer’s backend API. For North American Volkswagen owners, the standard European APIs don’t always play nicely.</p><p>To bridge this gap, I used a fantastic open-source Python library: <a href="https://www.google.com/search?q=%5Bhttps://github.com/zackcornelius/CarConnectivity-connector-volkswagen-na%5D(https://github.com/zackcornelius/CarConnectivity-connector-volkswagen-na)">CarConnectivity-connector-volkswagen-na</a> by <a href="https://github.com/zackcornelius">Zack Cornelius</a>.</p><p>This library is incredibly powerful. If you provide it with your 4-digit VW Security PIN (S-PIN), it can actively manipulate the car. You can write scripts to lock or unlock the doors, start the climate control, stop a charging session, and even turn on the window heaters.</p><p>However, for my “Hello World” project, I wanted to keep things safe and simple. I didn’t want my AI accidentally unlocking my doors in the middle of the night! 🧟Therefore, the Python script I built is strictly read-only. It is limited to just pulling the <strong><em>battery percentage</em></strong>, <strong><em>estimated range</em></strong>, and <strong><em>total mileage.</em></strong></p><p>Here is exactly how I built it:</p><h3>Step A: The Library</h3><p>First, I installed the library directly onto my Ubuntu server.</p><pre>sudo apt update &amp;&amp; sudo apt install -y python3-pip<br>pip3 install carconnectivity carconnectivity-connector-volkswagen-na --break-system-packages</pre><h3>Step B: The Credentials</h3><p>Security is key here. Instead of putting my VW password directly into the Python code (where it could accidentally be exposed in a chat log), I created a locked-down configuration file.</p><p>I created a file at /home/enrique/.openclaw/vw_config.json and restricted its permissions (chmod 600) so only my user account could read it.</p><pre>{<br>  &quot;carConnectivity&quot;: {<br>    &quot;server&quot;: { &quot;enabled&quot;: false },<br>    &quot;persistence&quot;: { &quot;enabled&quot;: false },<br>    &quot;connectors&quot;: [<br>      {<br>        &quot;type&quot;: &quot;volkswagen_na&quot;,<br>        &quot;brand&quot;: &quot;volkswagen&quot;,<br>        &quot;config&quot;: {<br>          &quot;username&quot;: &quot;YOUR_VW_EMAIL&quot;,<br>          &quot;password&quot;: &quot;YOUR_VW_PASSWORD&quot;,<br>          &quot;interval&quot;: 600<br>        }<br>      }<br>    ]<br>  }<br>}</pre><h3>Step C: The Python Script</h3><p>Next, I wrote the actual execution script at /home/enrique/.openclaw/skills/vw_id4/battery.py.</p><p>One interesting quirk about this library is that it fetches your car’s data using a background thread. If you don’t tell the script to pause, it will check your empty garage and close before the server actually replies! I added a time.sleep(10) to give it time to sync, and I also added a quick math conversion to ensure the API outputs my range and odometer in <strong>miles</strong> instead of kilometers.</p><pre>import time<br>import sys<br>import json<br>from carconnectivity import carconnectivity<br><br>def main():<br>    # 1. Point to the secured config file<br>    config_file = &quot;/home/enrique/.openclaw/vw_config.json&quot;<br>    <br>    with open(config_file, &quot;r&quot;) as f:<br>        config_dict = json.load(f)<br>    <br>    # 2. Initialize the connection<br>    cc = carconnectivity.CarConnectivity(config=config_dict)<br>    <br>    try:<br>        cc.startup()<br>        <br>        # Give the background thread 10 seconds to fetch data from VW servers<br>        time.sleep(10)<br>        <br>        # We grab the first vehicle found in the account<br>        vins = cc.garage.list_vehicle_vins()<br>        if vins:<br>            vin = vins[0] <br>            vehicle = cc.garage.get_vehicle(vin)<br>            <br>            print(f&quot;🚗 {vehicle.name.value if vehicle.name.value else &#39;ID.4&#39;} Status:&quot;)<br>            <br>            # Fetch Battery &amp; Convert Range to Miles<br>            if &quot;primary&quot; in vehicle.drives.drives:<br>                drive = vehicle.drives.drives[&quot;primary&quot;]<br>                if drive.level and drive.level.value is not None:<br>                    print(f&quot;🔋 Battery: {drive.level.value}%&quot;)<br>                <br>                if drive.range and drive.range.value is not None:<br>                    r_val = drive.range.value<br>                    r_unit = drive.range.unit.value if drive.range.unit else &#39;km&#39;<br>                    if r_unit == &#39;km&#39;:<br>                        r_val = round(r_val * 0.621371, 1)<br>                        r_unit = &#39;mi&#39;<br>                    print(f&quot;🛣️ Range: {r_val} {r_unit}&quot;)<br>            <br>            # Fetch and Convert Odometer to Miles<br>            if hasattr(vehicle, &#39;odometer&#39;) and vehicle.odometer and vehicle.odometer.value is not None:<br>                o_val = vehicle.odometer.value<br>                o_unit = vehicle.odometer.unit.value if vehicle.odometer.unit else &#39;km&#39;<br>                if o_unit == &#39;km&#39;:<br>                    o_val = round(o_val * 0.621371, 1)<br>                    o_unit = &#39;mi&#39;<br>                print(f&quot;📍 Mileage: {o_val} {o_unit}&quot;)<br>                <br>        else:<br>            print(&quot;❌ Error: Could not locate a vehicle in your account.&quot;)<br>            <br>    except Exception as e:<br>        print(f&quot;❌ Connection Failed: {str(e)}&quot;)<br>    finally:<br>        cc.shutdown()<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><h3>Step D: Teaching the AI (The Skill File)</h3><p>OpenClaw doesn’t just randomly guess what scripts do; it needs strict instructions. You do this by creating a SKILL.md file in the same folder as your script.</p><p>The most important part of this file is the <strong>YAML frontmatter</strong> (the section between the --- lines at the very top). This is the golden ticket that wires your code directly into the AI&#39;s &quot;brain&quot; and tells it exactly what intents should trigger this script.</p><pre>---<br>name: vw-id4-status<br>description: Fetches the real-time battery percentage, estimated range, and total mileage of the Volkswagen ID.4.<br>---<br># VW ID.4 Live Status<br><br>## Usage<br>- &quot;What is the battery on my ID4?&quot;<br>- &quot;Check my car charge&quot;<br>- &quot;How many miles are on the VW?&quot;<br><br>## Execution<br>python3 /home/enrique/.openclaw/skills/vw_id4/battery.py</pre><p>After saving the file and running a quick openclaw gateway restart in the terminal, the skill populated immediately in my UI. I clicked enable, opened the chat, and asked: <em>&quot;What is the battery on my ID4?&quot;</em> A few seconds later, my custom AI replied: <em>🚗 ID.4 Status: 🔋 Battery: 54.0% 🛣️ Range: 135.5 mi 📍 Mileage: 13877.1 mi </em>😱</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F2RGlIytE2Gxztop3XCYgg.png" /><figcaption>vw-id4-status skill installed in OpenClaw</figcaption></figure><h3>Conclusion</h3><p>This project is a perfect reminder that AI doesn’t just have to generate text or write emails. When you give an AI agent access to the real world through APIs and custom scripts, it becomes a true assistant.</p><p>Having my mileage tracked automatically in a CSV file without me having to open an app, write down numbers, or build a complex Zapier flow is incredible. I just asked the AI to do it, and it figured out the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2xl1ECTSY2eS9dOF70GpQ.png" /><figcaption>Telegram message to OpenClaw: User message: Give me a summary of my everyday milage.</figcaption></figure><h3>Next Steps</h3><p>This project works perfectly for me, but it is currently hardcoded with my specific VIN and a local config file. The next step is to make this skill truly universal and public.</p><p>I plan to:</p><ol><li><strong>Generalize the Skill:</strong> Update the code to use OpenClaw’s UI API key injection (environment variables) so anyone can drop in their VW credentials without touching the code.</li><li><strong>Action Commands:</strong> Add the ability to pass the VW S-PIN so the AI can actually turn on my climate control or lock the doors on a freezing morning.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8iGoXXTtBazgK1GSlSPgog.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=287616616689" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codetodeploy/how-i-installed-openclaw-on-gcp-and-built-a-custom-ai-skill-to-connect-to-my-volkswagen-id-4-287616616689">How I Installed OpenClaw on GCP and Built a Custom AI Skill to Connect to my Volkswagen ID.4</a> was originally published in <a href="https://medium.com/codetodeploy">CodeToDeploy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built a Pico W Remote to Trigger My Alexa Routines]]></title>
            <link>https://jegamboafuentes.medium.com/how-i-built-a-pico-w-remote-to-trigger-my-alexa-routines-083eb31a0212?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/083eb31a0212</guid>
            <category><![CDATA[pimoroni]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[alexa]]></category>
            <category><![CDATA[home-automation]]></category>
            <category><![CDATA[raspberry-pi-pico-2w]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 16:12:02 GMT</pubDate>
            <atom:updated>2025-11-24T16:12:02.775Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I combined a Raspberry Pi Pico W, MicroPython, and a few webhooks to build a custom smart home remote from scratch.</em></p><p>GitHub: <a href="https://github.com/jegamboafuentes/Pico-W-Alexa-Routine-Trigger">Link</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRgFi_IaOKrA0xoX6FRDrg.gif" /><figcaption>The Pico turned into a remote for my Alexa rounties.</figcaption></figure><h3>Introduction</h3><p>I love home automation. For the past few years, I’ve been automating my apartment in Boston, and it’s been great. I currently have most of the lights — more than <em>14 bulbs</em> and light strips — connected to Alexa.</p><p>But this setup has one big problem.</p><p>My living room often doubles as a guest room, and I often have family and friends visiting from Mexico. I quickly noticed that controlling the lights with Alexa was difficult for them. Alexa’s accent recognition, at least for now, isn’t perfect. Hearing them struggle to find the right command, or get frustrated when Alexa said, “<em>Sorry, I don’t know that one,</em>” was all too common.</p><p>I needed a simpler, “<em>guest-proof</em>” solution. I didn’t want them to have to hunt for 14 different light switches. I wanted something intuitive.</p><p>I had a spare <a href="https://www.raspberrypi.com/products/raspberry-pi-pico-2/"><em>Raspberry Pi Pico W 2</em></a> and a new <a href="https://shop.pimoroni.com/products/pico-scroll-pack?variant=32369496653907"><em>Pimoroni Pico Scroll Pack</em></a>. I realized I could combine these to build the perfect, simple, physical remote.</p><figure><img alt="A close-up, slightly blurred image of a white, rectangular 3D-printed case designed to hold the Pico W and Scroll Pack" src="https://cdn-images-1.medium.com/max/1024/1*iadup0OXoDxodKjO9riaqw.gif" /><figcaption>I used a simple 3D-printed difuser to make the final project look clean. (3D print file in GitHub)</figcaption></figure><h3>What This Project Does</h3><p>This device is a simple, Wi-Fi-connected remote with four buttons (A, B, X, and Y). Each button is mapped to a specific <em>Alexa Routine</em> in my living room:</p><ul><li><strong>Button A: “I’m Home”</strong> (Turns all the lights on)<br>💡💡💡</li><li><strong>Button B: “TV Time”</strong> (Dims the main lights, turns on bias lighting)<br>💡💡</li><li><strong>Button X: “Movie Time”</strong> (Turns off all lights except for one dim strip)<br>💡</li><li><strong>Button Y: “Good Night”</strong> (Turns all 14+ lights off)<br>🌛</li></ul><p>When a guest presses a button, the Pico W connects to my Wi-Fi, calls a unique URL, and Alexa runs the corresponding routine. No voice commands, no accents, no frustration. The Pico Scroll’s LED matrix gives instant visual feedback, flashing a bar of light and then scrolling the name of the command, like “<em>TV Time</em>,” so they know it worked.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcDikdP-FPUM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcDikdP-FPUM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcDikdP-FPUM%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0929a0d48cab3d2a8d1017e58efeaa28/href">https://medium.com/media/0929a0d48cab3d2a8d1017e58efeaa28/href</a></iframe><h3>What You Need to Make It</h3><p>If you want to build your own, the hardware list is small and requires no soldering!</p><p><strong>Hardware:</strong></p><ul><li>A <a href="https://www.raspberrypi.com/products/raspberry-pi-pico-2/"><strong>Raspberry Pi Pico W</strong></a> (a Pico W 2 in my case)</li><li>A <a href="https://shop.pimoroni.com/products/pico-scroll-pack?variant=32369496653907"><strong>Pimoroni Pico Scroll Pack</strong></a></li></ul><figure><img alt="A hand holding the assembled Pico Scroll and Pico 2 W, showing the back of the green Pico 2 W circuit board with the “BOOTSEL” button." src="https://cdn-images-1.medium.com/max/1024/1*YtDiKmOq_qHcpXh0Voeh9Q.jpeg" /><figcaption>The “brains” of the operation: a Raspberry Pi Pico 2 W with its Wi-Fi chip, attached to the Pico Scroll Pack.</figcaption></figure><p><strong>Software &amp; Services:</strong></p><ul><li>An <strong>Amazon Alexa</strong> device with your routines already set up.</li><li>A free account at <a href="https://virtualsmarthome.xyz/"><strong>virtualsmarthome.xyz</strong></a> (this is the magic ingredient).</li><li><strong>Thonny IDE</strong> (the best, simplest way to program the Pico).</li><li>The <strong>Pimoroni MicroPython UF2 file</strong>, which includes the picoscroll library.</li></ul><h3>How to Assemble the Device and Load the Code</h3><p><strong>1. Assemble the Hardware</strong></p><p>This is the easiest part. The Pico Scroll Pack has a female header that fits perfectly onto the Pico W’s male header pins. Just push them together, making sure the USB port faces the same way as the cutout on the Scroll Pack. That’s it. Assembly: done.</p><figure><img alt="A vertical, close-up shot of the assembled Pico 2 W and Pico Scroll, showing the connection between the header pins." src="https://cdn-images-1.medium.com/max/720/1*wDjm5K4dnCnWsh5SS96ccQ.gif" /><figcaption>The Pico W and Pico Scroll Pack are easily assembled by pressing them together. No soldering required.</figcaption></figure><p><strong>2. Load the Firmware and Code</strong></p><p>I’ve put the complete code for this project on GitHub: <a href="https://github.com/jegamboafuentes/Pico-W-Alexa-Routine-Trigger">Link</a></p><p>You’ll need two files from that repository: main.py and urequests.py.</p><ol><li><strong>Install the Pimoroni Firmware:</strong> Before you do anything, you need to install the Pimoroni-flavored MicroPython firmware, which includes the libraries for the Scroll Pack.</li></ol><ul><li>Unplug your Pico W.</li><li>Hold the <strong>BOOTSEL</strong> button while plugging it back into your computer.</li><li>It will appear as a USB drive called RPI-RP2.</li><li>Drag and drop the Pimoroni .uf2 file onto it. The Pico will reboot.</li></ul><p><strong>2. Upload the Code:</strong></p><ul><li>Open Thonny and connect to your Pico W.</li><li>Open the main.py and urequests.py files you downloaded from my repo.</li><li>For each file, go to <strong>File &gt; Save As…</strong> and choose <strong>“Raspberry Pi Pico”</strong> as the destination. Save them with the same names.</li></ul><p><strong>3. Configure the </strong><strong>main.py script:</strong></p><ul><li>This is the most important step! Open the main.py file <em>that is on your Pico</em> in Thonny.</li><li>At the top, you’ll see the # --- 1. SETTINGS --- section.</li><li>You <strong>must</strong> change the WIFI_SSID and WIFI_PASSWORD to your 2.4GHz home Wi-Fi network.</li><li>Leave the URL_ variables blank for now—we&#39;ll get those in the next step.</li></ul><h3>How to Turn Your Alexa Routines into URLs</h3><p>This is the secret sauce. The Pico can’t talk to Alexa directly, but it <em>can</em> call a URL. The <a href="http://virtualsmarthome.xyz/">virtualsmarthome.xyz</a> service creates &quot;<em>virtual</em>&quot; smart home devices that, when triggered, give you a URL.</p><p><strong>Step 1:</strong> Go to <a href="http://virtualsmarthome.xyz/">virtualsmarthome.xyz</a> and sign up for a free account.</p><p><strong>Step 2:</strong> Open your Alexa app, search for the <strong>“Virtual Smart Home”</strong> skill, and enable it. Link it to the account you just created.</p><figure><img alt="A screenshot of the “URL Routine Trigger” website by virtualsmarthome.xyz, showing the “Login with Amazon” button." src="https://cdn-images-1.medium.com/max/1024/1*p33zUrqOPwN0JuT1HTcNJg.png" /><figcaption>The <strong><em>virtualsmarthome.xyz</em></strong> service is the magic that links our Pico to Alexa.</figcaption></figure><p><strong>Step 3:</strong> In the <a href="http://virtualsmarthome.xyz/">virtualsmarthome.xyz</a> dashboard, create a new &quot;<em>URL Routine Trigger</em>&quot; You can call it &quot;<em>TV time URL</em>&quot; or something similar.</p><p><strong>Step 4:</strong> Go back to your Alexa app and create a new Routine.</p><ul><li>For the <strong>“When”</strong> (trigger), choose “Smart Home,” and find your new device (e.g., “<em>TV time URL</em>”).</li><li>For the <strong>“Action,”</strong> tell it to do what you want (e.g., “Set Living Room lights to 20%”).</li></ul><figure><img alt="A screenshot of the Amazon Alexa app “Edit Routine” screen. The “WHEN” trigger is set to “TV time URL is pressed.”" src="https://cdn-images-1.medium.com/max/1024/1*GkzssmAQZ7_qhBu8Jh6Ynw.png" /><figcaption>Setting up the routine’s trigger in the Alexa app. The “When” is set to the new virtual device we created.</figcaption></figure><p><strong>Step 5:</strong> Now, go back to the <em>virtualsmarthome.xyz</em> dashboard. You will see your new device listed, and next to it, a &quot;Trigger URL.&quot;</p><p><strong>That URL is your golden ticket.</strong></p><figure><img alt="A screenshot of the virtualsmarthome.xyz dashboard, highlighting the “HTML response” Trigger URL for the “TV time URL” device, with a code snippet overlay." src="https://cdn-images-1.medium.com/max/1024/1*ELnA_2zrTD8BdxLW3FScQQ.png" /><figcaption>The virtualsmarthome.xyz dashboard where you can copy the final &quot;Trigger URL&quot; to paste into the Python code.</figcaption></figure><p><strong>Step 6:</strong> Copy that URL and paste it into your main.py script in the correct variable (e.g., URL_TV). Repeat this process for all four buttons.</p><pre># Your Alexa Routine URLs<br>URL_HOME = &quot;https://www.virtualsmarthome.xyz/url_routine_trigger/activate.php?trigger=YOUR-TRIGGER-ID&quot;<br>URL_TV = &quot;https://www.virtualsmarthome.xyz/url_routine_trigger/activate.php?trigger=YOUR-TRIGGER-ID&quot;<br>URL_MOVIE = &quot;https://www.virtualsmarthome.xyz/url_routine_trigger/activate.php?trigger=YOUR-TRIGGER-ID&quot;<br>URL_NIGHT = &quot;https://www.virtualsmarthome.xyz/url_routine_trigger/activate.php?trigger=YOUR-TRIGGER-ID&quot;</pre><p>Save the main.py file on the Pico one last time. Unplug it and plug it back in. It will connect to your Wi-Fi, and the buttons will now trigger your Alexa routines!</p><h3>Next Steps</h3><p>This project works perfectly, but it’s still plugged into the wall for power. The next step is to make it truly wireless. I plan on adding a small battery pack, like a Pimoroni LiPo Shim or a tiny USB power bank. The Pico W is very power-efficient, so it should last for weeks on a small battery, making it a true <em>“pass-it-around-the-couch”</em> remote.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvnLpULHNkocxLOC1AVmpQ.jpeg" /><figcaption>The completed Pico W remote showing the “I’m Home” alexa routine, and turning all my apartment lights.</figcaption></figure><h3>Conclusion</h3><p>This was a fast, fun project that solved a real, practical problem in my home. My guests are no longer frustrated, my home is quieter (at least from people yelling at Alexa), and I finally put that spare Pico W to good use.</p><p>It’s a perfect reminder that sometimes, the most advanced-sounding solution (like a voice assistant) isn’t always the most user-friendly. A simple button can be all you need.</p><figure><img alt="The completed Alexa remote in its white case, plugged into a wall outlet and glowing with a blue light from the LEDs inside." src="https://cdn-images-1.medium.com/max/1024/1*2__XR2Ib1PLE_cvhfYbzSw.jpeg" /><figcaption>The final product, plugged in a wall and ready to control the living room lights.</figcaption></figure><figure><a href="http://buymeacoffee.com/jegamboafuentes"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oYdALbIZwWcAttZULvZ7A.png" /></a><figcaption>buymeacoffee.com/jegamboafuentes</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=083eb31a0212" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a “Memory Box” with a Raspberry Pi to Play My Girlfriend’s Audio On Demand]]></title>
            <link>https://jegamboafuentes.medium.com/i-built-a-memory-box-with-a-raspberry-pi-to-play-my-girlfriends-audio-on-demand-551b7f9ed7cd?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/551b7f9ed7cd</guid>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 16:12:04 GMT</pubDate>
            <atom:updated>2025-11-17T16:12:04.758Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/jegamboafuentes/pi-zero-audio-photo-frame">GitHub project</a></p><h3>How I turned a single voice memo into a physical device using a Pimoroni Pirate Audio board and some Python.</h3><p>For my birthday this year, my girlfriend gave me one of the most beautiful gifts I’ve ever received: a simple audio file. It was a voice memo, just her talking, and the words were too special to just be another file lost in the bits and bytes of my iPhone.</p><p>I couldn’t just let it sit there. I’m a tinkerer, and I’ve always believed in bridging the digital and physical worlds. I wanted to take this file and <strong>make it a real</strong>, tangible object in my home.</p><figure><img alt="A hand holding a white, 3D-printed Raspberry Pi project case. The screen shows a photo of a couple, and the case is engraved with ‘2025 SEP 22’." src="https://cdn-images-1.medium.com/max/1024/1*bY5wfLnUge7WwG15eXkcTg.jpeg" /><figcaption>The final ‘Memory Box’ device, displaying our photo and the custom 3D-printed case with my birthday engraved on it.</figcaption></figure><p>I first considered an ESP32 with a speaker, but it felt like a lot of custom work. Then, I was at Micro Center and saw the perfect solution: a <strong>Pimoroni Pirate Audio Mini Speaker</strong>. It had everything: a high-quality I2S DAC, a small speaker, a full-color screen, and four buttons. It was an all-in-one package.</p><p>The project was born. I would turn this board into a “Memory Box” that would sit on the wall. It would display a picture of us, and at the press of a button, it would play her voice.</p><p>This post is the story of how I made that project a reality.</p><figure><img alt="The Pimoroni Pirate Audio Mini Speaker board, with its screen lit up showing a photo and a playback timestamp." src="https://cdn-images-1.medium.com/max/1024/1*Y4FRTLSdJRcY9LV_2R9IBw.jpeg" /><figcaption>A close-up of the Pimoroni Pirate Audio Mini Speaker board, the all-in-one heart of the project</figcaption></figure><h3>What The Device Does</h3><p>This isn’t just a simple audio player; it’s a dedicated device. Here’s what the final project does:</p><ul><li><strong>Boots Automatically:</strong> When you plug it in, it boots up, shows a “Loading…” screen, and then loads a custom background picture.</li><li><strong>Full Playback Control:</strong> The four buttons are mapped to all the essentials:</li><li><strong>Button A:</strong> Rewind 7 seconds.</li><li><strong>Button B:</strong> Cycle through a list of different background images.</li><li><strong>Button X/Y:</strong> Play, Pause, and Resume the audio.</li><li><strong>Real-Time Display:</strong> While the audio is playing, the screen overlays a real-time MM:SS timestamp, which disappears when paused.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F1136217464%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F1136217464&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F2081821429-15dc6fd728bb9f5652ff4bd8b9689ae4bf7ecfe34f167156fbae291802ae3417-d_1280%3Fregion%3Dus&amp;type=text%2Fhtml&amp;schema=vimeo" width="1440" height="2560" frameborder="0" scrolling="no"><a href="https://medium.com/media/702b5a27150d1897a8bafbb740b2b730/href">https://medium.com/media/702b5a27150d1897a8bafbb740b2b730/href</a></iframe><h3>Hardware and Software</h3><p>This is a surprisingly simple and cheap DIY project. You really only need a few key components.</p><p><strong>Hardware:</strong></p><ul><li><a href="https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/"><strong>Raspberry Pi Zero 2 W</strong></a><strong>:</strong> Perfect size and power for this.</li><li><a href="https://shop.pimoroni.com/products/pirate-audio-mini-speaker?variant=31189753692243"><strong>Pimoroni Pirate Audio Mini Speaker</strong></a><strong>:</strong> The all-in-one DAC, screen, and speaker.</li><li><strong>MicroSD Card:</strong> An 8GB card is more than enough.</li><li><strong>5V Power Supply:</strong> Any standard USB-C power supply works.</li><li><a href="https://www.thingiverse.com/thing:5245754"><strong>(Optional) 3D Printed Case</strong></a><strong>:</strong> To make it look clean on the wall. My GitHub repo has the files for the original 3D print. (The one in my pictures has a custom engraving with my birthday.)</li></ul><p><strong>Software:</strong></p><ul><li><strong>Raspberry Pi OS Lite (64-bit):</strong> We don’t need a desktop, so the “Lite” version is fast and minimal.</li><li><strong>Python 3:</strong> The script is written in Python.</li><li><strong>Key Python Libraries:<br></strong>pygame: For reliable, high-performance audio playback.<br>gpiozero: For easily reading the button presses.<br>st7789 &amp; PIL: For controlling the LCD screen and drawing text/images.</li></ul><figure><img alt="A top-down photo showing the Pirate Audio board and the Raspberry Pi Zero 2 W side-by-side on a green cutting mat before assembly." src="https://cdn-images-1.medium.com/max/1024/1*VQcR-9VYq7CaJHR-sTms2Q.jpeg" /><figcaption>The two main hardware components: the Pimoroni Pirate Audio Mini Speaker (left) and the Raspberry Pi Zero 2 W (right)</figcaption></figure><h3>How to Connect and Assemble</h3><p>This part is very brief. The Pi Zero 2 W doesn’t come with GPIO pins, so you’ll need to solder a 40-pin header to it. Once that’s done, you just plug the Pirate Audio board securely on top. That’s it!</p><figure><img alt="The Pimoroni Pirate Audio board fully assembled on top of the Raspberry Pi Zero 2 W, sitting on a green cutting mat." src="https://cdn-images-1.medium.com/max/1024/1*VeOw1ZbEdBpUcIn6ZCUAmw.jpeg" /><figcaption>The Pirate Audio board plugged directly onto the 40-pin header of the Pi Zero. No extra wires needed.</figcaption></figure><h3>How to Deploy the Code</h3><p>You can find the device code in this <a href="https://github.com/jegamboafuentes/pi-zero-audio-photo-frame">GitHub repo</a>.</p><p>This is where the real work happens. We’ll flash the SD card, SSH in, and get the script running.</p><p><strong>1. Flash the SD Card (The Right Way)</strong> First, I used the <strong>Raspberry Pi Imager</strong> to flash the <em>Raspberry Pi OS Lite (64-bit)</em>. The trick is to click the <strong>Gear icon</strong> (Advanced Options) <em>before</em> you hit “Write.” This lets you pre-configure everything:</p><ul><li>Enable SSH</li><li>Set your username (I used admin) and password</li><li>Set the hostname to pirate-audio.local</li><li>Configure your 2.4GHz Wi-Fi credentials</li></ul><p><strong>2. The <em>Critical</em> Hardware Fix</strong> Before putting the SD card into the Pi, I had to plug it <em>back into my Mac</em> and open the config.txt file (in the bootfs drive). This is the most important step for getting the audio to work.</p><p>First, I added these lines to the bottom to enable the hardware:</p><pre># --- Lines for Pirate Audio ---<br>dtoverlay=hifiberry-dac<br>gpio=25=op,dh<br>dtparam=spi=on</pre><p>Second, and this is the key we learned from all the troubleshooting, I <strong>disabled the Pi’s built-in sound cards</strong>. This forces the Pi to use the Pirate Audio board as its one and only sound device.</p><ul><li>I found dtparam=audio=on and changed it to #dtparam=audio=on.</li><li>I found dtoverlay=vc4-kms-v3d and changed it to dtoverlay=vc4-kms-v3d,noaudio.</li></ul><p><strong>3. Install Dependencies &amp; Copy Files</strong> After that, I put the card in the Pi, powered it on, and connected via SSH: ssh admin@pirate-audio.local.</p><p>I ran these commands to install all the necessary Python libraries:</p><pre>sudo apt update<br>sudo apt install -y python3-pil python3-pygame python3-gpiozero python3-st7789 gpiod</pre><p>Then, I used scp from my Mac&#39;s terminal to copy my audio file (audio.wav), my picture (linaPic.png), and the final Python script (play_my_sound.py) into a /home/admin/Music/ folder on the Pi.</p><p><strong>4. Run on Boot (The Reliable Way)</strong> crontab proved to be very unreliable. The only way to make this work 100% of the time is with a systemd user service. This ensures the script only runs <em>after</em> the audio system is fully loaded.</p><p>I created a file at /home/admin/.config/systemd/user/pirate-player.service and put this in it:</p><pre>[Unit]<br>Description=Pirate Audio Player<br>After=pulseaudio.service<br>BindsTo=pulseaudio.service<br>[Service]<br># Fixes for running in a &quot;headless&quot; environment<br>Environment=&quot;GPIOZERO_PIN_FACTORY=lgpio&quot;<br>Environment=&quot;SDL_AUDIODRIVER=alsa&quot;<br>Environment=&quot;AUDIODEV=hw:0,0&quot;<br># Gives the system 5 seconds to settle<br>ExecStartPre=/bin/sleep 5 <br># Your script<br>ExecStart=/usr/bin/python3 /home/admin/Music/play_my_sound.py<br>WorkingDirectory=/home/admin/Music<br>Restart=always<br>[Install]<br>WantedBy=default.target</pre><p>Then I enabled it with three final commands:</p><pre>systemctl --user daemon-reload<br>systemctl --user enable pirate-player.service<br>sudo loginctl enable-linger admin</pre><p>After a final sudo reboot, the device was complete.</p><h3>A Brief of How This Works (The Code)</h3><p>The final Python script is the heart of the project.</p><ul><li><strong>The Audio Fix:</strong> The most important lines are at the very top. They force the pygame library to use the alsa audio driver and point it <em>directly</em> at the hardware (hw:0,0). This bypasses the Pi&#39;s buggy default sound system (pulsesink) and makes the audio play instantly and reliably.</li><li><strong>The Screen:</strong> It uses the PIL library to show &quot;Loading...&quot; on a black screen, then it loads, rotates (-90 degrees), and resizes my linaPic.png file to fit the 240x240 display.</li><li><strong>The Audio:</strong> pygame.mixer is used to load the <em>entire</em> .wav file into memory. This is what allows the &quot;instant&quot; play/pause and (if you use an .mp3) the fast-forward/rewind.</li><li><strong>The Buttons:</strong> gpiozero is a simple and powerful library. It maps functions like play_pause() and cycle_background() to the physical button pins. It also controls AMP_PIN = 25, which is the physical &quot;on&quot; switch for the speaker&#39;s amplifier.</li><li><strong>The “Pop-Up” UI:</strong> The show_message() and update_time_display() functions use threading.Timer. This is a simple way to show text (like the MM:SS clock) on the screen and have it disappear or update automatically without freezing the rest of the code.</li></ul><h3>Conclusion</h3><p>This was one of those projects that’s 10% idea and 90% troubleshooting — especially figuring out the audio “race condition” on boot. But after all that debugging, the result is <em>so</em> worth it.</p><p>What was once a simple digital file, a birthday message, is now a permanent, physical object in my home. I can walk by, press a button, and hear her voice. It’s a true “Memory Box,” ❤️ and it’s a reminder of why I love to build things.</p><p>This is a fantastic and cheap DIY project for anyone looking to make a unique gift or give a digital file a place in the real world.</p><p>You can find all the final code, 3D print files, and a full README on my GitHub repo: <a href="https://github.com/jegamboafuentes/pi-zero-audio-photo-frame">https://github.com/jegamboafuentes/pi-zero-audio-photo-frame</a></p><figure><img alt="A hand holding the final, white 3D-printed ‘Memory Box’, with the screen displaying a photo of a couple." src="https://cdn-images-1.medium.com/max/1024/1*Tn2iSK62OpNtcayFjycdYQ.jpeg" /><figcaption>The finished project, fully assembled and ready to be mounted on the wall.</figcaption></figure><figure><a href="http://buymeacoffee.com/jegamboafuentes"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oYdALbIZwWcAttZULvZ7A.png" /></a><figcaption>buymeacoffee.com/jegamboafuentes</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=551b7f9ed7cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Apartment is an Oven, So I Built This Pico Smart Display]]></title>
            <link>https://jegamboafuentes.medium.com/my-apartment-is-an-oven-so-i-built-this-pico-smart-display-696c62dfd345?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/696c62dfd345</guid>
            <category><![CDATA[raspberry-pi-pico-w]]></category>
            <category><![CDATA[pimoroni]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[micropython]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 20:02:01 GMT</pubDate>
            <atom:updated>2025-11-10T20:06:29.498Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*enR7o_ve7PWrFfMCgUW7uA.jpeg" /><figcaption>The default screen. It boots right up to this so I can instantly check my room temperature.</figcaption></figure><p>So, I had this Raspberry Pi Pico W and a <a href="https://shop.pimoroni.com/products/pico-display-pack?variant=32368664215635">Pimoroni Pico Display Pack </a>just collecting dust in a drawer. You know how it is. I love to tinker, but I just needed a <em>reason</em> to build something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*0SrxfoflSr5DG_k5zQfNjw.gif" /><figcaption>The hardware is super simple: just the Pico W and the Pimoroni Pico Display Pack. No soldering needed.</figcaption></figure><p><a href="https://github.com/jegamboafuentes/RP2040-pico-display-thermometer">GitHub</a> project.</p><p>That reason turned out to be my apartment’s thermostat. 🔥</p><p>I live in an old building from the 60s in Revere Beach, and it is <em>always</em> hot. My thermostat is this ancient dial on the wall that tells me nothing. I figured, “Hey, I can build a thermometer to sit next to it.”</p><p>But then I started thinking. The Pico W features Wi-Fi and a built-in thermometer, and its display includes all the necessary buttons. Why stop at just the temperature? I decided to go all in and add live weather and, while I was at it, a crypto ticker for my favorites (ETH and SOL).</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F1135473651%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F1135473651&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F2080808804-744750f4800cb8a5cbb37bf0af87e95d84adbca6ba5f7648613f5b281a7a1af1-d_1280%3Fregion%3Dus&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/a584dc1680aaaa271481cdbb4de517f4/href">https://medium.com/media/a584dc1680aaaa271481cdbb4de517f4/href</a></iframe><p>So yeah, my simple thermometer project turned into this all-in-one smart display. Here’s how I did it.</p><h3>Hardware You’ll Need</h3><p>Hardware-wise, this is a super easy build. You don’t even need to solder. The display just pops right onto the Pico’s headers.</p><ul><li><a href="https://www.raspberrypi.com/products/raspberry-pi-pico/"><strong>Raspberry Pi Pico W</strong> </a>(Gotta be the “W” for Wi-Fi)</li><li><a href="https://shop.pimoroni.com/products/pico-display-pack?variant=32368664215635"><strong>Pimoroni Pico Display Pack</strong></a></li><li><strong>A Micro USB Cable</strong> (for power and code)</li></ul><h3>Software and Setup</h3><p>This whole thing runs on MicroPython. You’ll need the special <a href="https://learn.pimoroni.com/article/getting-started-with-pico">Pimoroni-flavored version</a>, since it has all the drivers for the display.</p><p><strong>1. Get MicroPython on the Pico</strong></p><ul><li>Grab the latest .uf2 file from the <a href="https://github.com/pimoroni/pimoroni-pico/releases">Pimoroni Pico MicroPython Releases page</a>.</li><li>Unplug your Pico. Hold down the <strong>BOOTSEL</strong> button and plug it back into your computer.</li><li>It’ll pop up as a drive called <strong>RPI-RP2</strong>.</li><li>Just drag and drop that .uf2 file onto the drive. It&#39;ll restart itself, and boom—you&#39;ve got MicroPython.</li></ul><p><strong>2. The Project Files</strong> I just used <a href="https://thonny.org/">Thonny</a> for my IDE. It’s perfect for this stuff — super easy to talk to the Pico.</p><p>All the code for this project is here: <a href="https://github.com/jegamboafuentes/RP2040-pico-display-thermometer">GitHub</a></p><p>You need to make these files on your Pico:</p><ul><li><strong>secrets.py</strong>: This is the most important one! You have to create this file yourself. It&#39;s just for your Wi-Fi info:</li></ul><pre>WIFI_SSID = &quot;YourNetworkName&quot; WIFI_PASSWORD = &quot;YourNetworkPassword&quot;</pre><ul><li><strong>main.py</strong>: This is the main script that runs everything.</li><li><strong>a.py</strong>, <strong>b.py</strong>, <strong>x.py</strong>, <strong>y.py</strong>: I made a separate file for each button to keep things clean.</li></ul><h3>How the Code Works</h3><p>I really didn’t want one giant, messy main.py file, so I made the code modular. Each button&#39;s function got its own file.</p><p><strong>main.py</strong> This is the boss. It runs the show. Here&#39;s the play-by-play:</p><ol><li><strong>Imports &amp; Setup:</strong> It pulls in all the libraries and sets up the display, buttons, etc.</li><li><strong>Connect to Wi-Fi:</strong> First thing it does is try to connect to your Wi-Fi (using secrets.py). It shows a &quot;Connecting...&quot; message so you know it&#39;s working.</li><li><strong>The Main Loop:</strong> This is the default thermometer screen. It just runs over and over.</li></ol><ul><li>It’s always checking for a button press.</li><li>If no buttons are pressed, it reads the Pico’s built-in temperature sensor.</li><li><strong>Quick Fix:</strong> The sensor always seemed a bit high (probably ’cause it’s in a case), so I added a TEMP_OFFSET_C = -3.3 to calibrate it.</li><li>It draws the cool thermometer graphic and shows the temp in C and F.</li><li>If you <em>do</em> press a button, it just calls the function from that button’s file (like a.show_outside_temp()).</li></ul><p><strong>The “Button” Files (</strong><strong>a.py, </strong><strong>b.py, </strong><strong>x.py, </strong><strong>y.py)</strong> These are all super simple and basically do the same thing:</p><ol><li>Show a “Fetching…” message.</li><li>Call a public API (like urequests) to get the data.</li><li>Clear the screen and show the new info (like the price or weather).</li><li>Wait a few seconds, then exit.</li></ol><p>When the button file is done, the main.py loop takes over again and goes right back to the thermometer. Easy.</p><ul><li><strong>Button A (Weather):</strong> Hits http://wttr.in/Boston?format=j1 for Boston&#39;s weather.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_27tQeo7uHwKue6GurkBqg.jpeg" /><figcaption>Hitting Button A fetches the current ‘feels like’ temperature for Boston from a public API.</figcaption></figure><ul><li><strong>Button B (ETH):</strong> Hits the CoinGecko API for the Ethereum price.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*thJk2tmDSQa1Yp4zGtEIkw.jpeg" /><figcaption>A press of Button B shows the latest ETH price, pulled live from the CoinGecko API.</figcaption></figure><ul><li><strong>Button X (Forecast):</strong> Also hits wttr.in for a 6-hour forecast.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYWNkj2vID7Rco8u2NouAQ.jpeg" /><figcaption>Button X gives me a quick 6-hour weather forecast so I know what’s coming up.</figcaption></figure><ul><li><strong>Button Y (SOL):</strong> Hits CoinGecko for the Solana price.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NnoIRH0jb0-e9sTVJ-XHnQ.jpeg" /><figcaption>And finally, Button Y pulls the current price for Solana.</figcaption></figure><h3>How to Use It</h3><p>Using it is the easiest part. That was the whole point.</p><p><strong>The Main Screen</strong> Just plug it in. It boots right into the room thermometer. You’ll see the temperature in both C and F, with the graphic on the side.</p><p><strong>The Buttons</strong></p><ul><li><strong>Press A:</strong> See the current outside temp in Boston (Change it for your own).</li><li><strong>Press B:</strong> Get the latest price for Ethereum (ETH).</li><li><strong>Press X:</strong> Check the 6-hour weather forecast.</li><li><strong>Press Y:</strong> Get the latest price for Solana (SOL).</li></ul><p>After a few seconds, it just jumps right back to the thermometer screen. No fuss.</p><h3>So, Was It Worth It?</h3><p>Absolutely. This was such a fun project, and it actually solved a problem I have every day. I finally got to use that hardware I had lying around, and now I have a perfect little “at a glance” display for my apartment.</p><p>I can see the room temp, check the weather, and… of course… see how my crypto is doing.</p><p>I also threw the 3D print files for the case into the project <a href="https://github.com/jegamboafuentes/RP2040-pico-display-thermometer">repo</a>, including a neat angled one for mounting on a wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*hOIiTmhP_wKVtHS6msueYw.png" /><figcaption>3D prints available in GitHub repo</figcaption></figure><p>Hope this makes you want to build one, too!</p><figure><a href="http://buymeacoffee.com/jegamboafuentes"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oYdALbIZwWcAttZULvZ7A.png" /></a><figcaption>buymeacoffee.com/jegamboafuentes</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=696c62dfd345" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built an IoT Device to Monitor Sailing Conditions at Community Boating Boston ⛵]]></title>
            <link>https://jegamboafuentes.medium.com/how-i-built-an-iot-device-to-monitor-sailing-conditions-at-community-boating-boston-86deacb6f715?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/86deacb6f715</guid>
            <category><![CDATA[boston]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[sailing]]></category>
            <category><![CDATA[lilygo]]></category>
            <category><![CDATA[esp32-tutorial]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Tue, 20 Aug 2024 22:10:22 GMT</pubDate>
            <atom:updated>2024-08-20T22:10:22.354Z</atom:updated>
            <content:encoded><![CDATA[<p>This summer, I decided to jump into the world of sailing by signing up for classes at <a href="https://www.community-boating.org/">Community Boating in Boston</a>. The experience has been nothing short of amazing, filled with the excitement of learning new skills and the calm of being out on the water. The way it works at Community Boating is that you start with basic theoretical classes, and once you’ve completed them, you earn a <em>“Green Flag.”</em> This flag indicates that you can sail, but only when the Green Flag is raised, signaling favorable weather conditions for beginners. As you keep practicing, you can earn higher-level flags like Yellow or Red, which correlate with more challenging conditions.</p><p>Here is the GitHub repo for this project: <a href="https://github.com/jegamboafuentes/IoT-Flag-Monitor-for-Community-Boating-Boston">Link</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*a2Z_Pj1tZOCJwno11Mfdqw.jpeg" /><figcaption>IoT Flag Monitor connected to Community Boating Boston API, Displaying: ‘Yellow Flag’ and ‘Limited Sonar Availability’ in real-time</figcaption></figure><p>Every time I want to head out for a sail, I need to check the <a href="https://www.community-boating.org/">Community Boating website</a> to see which flag is currently raised. For now, I’m primarily looking for the <em>Green Flag</em> since I’m still a beginner. <em>The problem?</em> It’s a bit of a hassle to constantly visit the website just to check the flag status. So, I decided to create a solution: an<strong> IoT device that does the checking for me. 👇</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*fUs59r4SJX0o9bv2vwjpOw.jpeg" /><figcaption>IoT Flag Monitor for Community Boating Boston displaying ‘Yellow Flag’ and Status ‘No Adults’.</figcaption></figure><h3>The Problem: Constantly Checking the Website 🖥️</h3><p>As someone who loves automation and hates repetitive tasks, I quickly realized that manually checking the flag status every time I wanted to sail was not ideal. The process was simple but time-consuming, and I thought, <em>“There has to be a better way!”</em> That’s when the idea hit me: <strong>why not build a tiny device that could monitor the flag status in real-time? 💡</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7kyqnGC51eHXjP0BeL_6Q.png" /><figcaption>Website of Community Boating Boston displaying a Yellow Flag</figcaption></figure><h3>The Solution: An IoT Flag Monitor 📡</h3><p>To solve this problem, I decided to create a monitor using a small IoT device. The idea was straightforward: connect the device to the<em> Community Boating </em><strong>real-time API</strong> to fetch the current flag status and display it on a screen. This way, I could know the flag status at a glance, without the need to visit the website. It might seem like a small thing, but it saves me those precious few seconds every time I’m getting ready to sail. 😎</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*ORzor861RnvmwZFbQGbv-w.jpeg" /><figcaption>IoT Flag Monitor for Community Boating Boston displaying a Green Flag and ‘Limited Sonar Availability’</figcaption></figure><h3>Materials I Used 🛠️</h3><p>Here’s a quick list of the components I used to build this project:</p><ul><li><a href="https://www.lilygo.cc/products/lilygo%C2%AE-ttgo-t-display-1-14-inch-lcd-esp32-control-board?srsltid=AfmBOooUrX-Y2gXdb6pmgim8VfeHclN7cDCsK0IfDKG4iQilJwyevX_Y"><strong>T-Display ESP32 WiFi Bluetooth Development Board</strong></a>: This board includes a 1.14-inch ST7789V IPS LCD, making it perfect for displaying the flag status. Product: <a href="https://www.lilygo.cc/products/lilygo%C2%AE-ttgo-t-display-1-14-inch-lcd-esp32-control-board?srsltid=AfmBOooUrX-Y2gXdb6pmgim8VfeHclN7cDCsK0IfDKG4iQilJwyevX_Y">Link</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*7NBqeDqIL1tOfj2V24EqKQ.png" /><figcaption>Lilygo — T-Display Apparence</figcaption></figure><ul><li><strong>3D-Printed Case</strong>: To neatly house the components and keep the setup secure. Original. <a href="https://www.thingiverse.com/thing:3777859">Link to the original model.</a></li><li><strong>3D-Printed Boat Model</strong>: Just for fun, I added a small boat model to the setup to give it a more thematic feel. <a href="https://www.thingiverse.com/thing:85978">Link to the original model.</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*nMRTyEWs4-KP80JMhmKY-A.gif" /><figcaption>3D Model of Boat being printed</figcaption></figure><ul><li>Here is the modified 3D model version for this project: <a href="https://github.com/jegamboafuentes/IoT-Flag-Monitor-for-Community-Boating-Boston/tree/main/3D_model">Link</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*fFNBv93UbbwN3XbGA9DjcA.gif" /><figcaption>Bambu Studio displaying the 3D parts to be printed</figcaption></figure><h3>Getting the Real-Time Data 🕒</h3><p>The key to this project was accessing the real-time data from the <em>Community Boating website</em>. Here’s how I discovered the API and fetched the flag status:</p><ol><li><strong>Inspecting the Website</strong>: First, I navigated to the <a href="https://www.community-boating.org/about-us/weather-information/"><em>Community Boating website</em></a> where the flag status is displayed. I then pressed the F12 key on my keyboard to open the <em>browser&#39;s developer tools</em>. This gave me access to the console and network activity.</li><li><strong>Finding the Right API</strong>: With the developer tools open, I clicked on the Network tab. To filter the network requests, I set the filter to Fetch/XHR. This narrowed down the list to show only the relevant API calls. Among the requests, I found the one responsible for fetching the flag color data, labeled as flag-color. <a href="https://tv.community-boating.org/api/flag-color">API Link.</a></li><li><strong>Retrieving the Status Data</strong>: I repeated the same process to locate the API responsible for fetching the status information, which was labeled as fotv. This API provided the specific status updates, which are crucial for understanding the conditions on the Community Boat center. <a href="https://tv.community-boating.org/api/fotv">API Link.</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIJ_Ysnggz2gTSaJcQcWyQ.png" /><figcaption>Boston Community Boating Website inspected using the Browser Developing Tools to get the API.</figcaption></figure><p>By following these steps, I was able to access the exact APIs that power the flag status on the Community Boating website, allowing me to retrieve real-time data directly for my IoT device.</p><h3>The Code 💻</h3><p>To bring everything together, I wrote a script that connects to the WiFi, fetches the flag color and status data from the <em>Community Boating API</em>, and displays the information on the TFT screen of my Lylygo T-Display (ESP32 device). The code handles everything from parsing the JSON response to displaying the flag color with a neat wave effect, along with the corresponding status message.</p><p>Here’s a brief rundown of what the code does:</p><ul><li><strong>WiFi Connection</strong>: The device connects to the specified WiFi network.</li><li><strong>API Requests</strong>: It makes HTTP GET requests to retrieve the current flag color and status.</li><li><strong>Data Parsing</strong>: The JSON responses are parsed to extract the relevant information, such as the flag color and active status title.</li><li><strong>Display Logic</strong>: The code updates the TFT display with the current flag color, status message, and a custom-drawn flag graphic.</li><li><strong>Periodic Updates</strong>: The device continuously checks for updates every 10 seconds to ensure the displayed information is always current.</li></ul><p>If you’re interested in the full code, you can find it in my <a href="https://github.com/jegamboafuentes/IoT-Flag-Monitor-for-Community-Boating-Boston">GitHub repository</a>. Feel free to check it out and customize it to suit your own needs!</p><pre>// 8/19/2024 - BY JEGF<br><br>#include &lt;TFT_eSPI.h&gt;<br>#include &lt;SPI.h&gt;<br>#include &quot;WiFi.h&quot;<br>#include &lt;HTTPClient.h&gt;<br><br>// WiFi credentials<br>const char* ssid = &quot;myWIFINetwork&quot;;<br>const char* password = &quot;myPassword&quot;;<br><br>// API URLs<br>const char* apiURL = &quot;https://tv.community-boating.org/api/flag-color&quot;;<br>const char* textApiURL = &quot;https://tv.community-boating.org/api/fotv&quot;;<br><br>TFT_eSPI tft = TFT_eSPI(135, 240); // Initialize the TFT display<br>String activeTitle = &quot;&quot;;  // Variable to store the active title<br><br>void setup() {<br>  Serial.begin(115200);<br>  tft.init();<br>  tft.setRotation(3);  // Rotate display 180 degrees<br>  tft.fillScreen(TFT_BLACK);<br>  tft.setTextSize(2);<br>  tft.setCursor(0, 0);<br>  tft.setTextDatum(MC_DATUM);<br>  tft.setTextSize(1);<br><br>  // Connect to WiFi<br>  WiFi.begin(ssid, password);<br>  tft.setTextColor(TFT_GREEN);<br>  tft.drawString(&quot;Connecting to WiFi...&quot;, tft.width() / 2, tft.height() / 2);<br>  <br>  while (WiFi.status() != WL_CONNECTED) {<br>    delay(500);<br>    Serial.print(&quot;.&quot;);<br>  }<br>  <br>  tft.fillScreen(TFT_BLACK);<br>  tft.setTextColor(TFT_GREEN);<br>  tft.drawString(&quot;Connected to WiFi&quot;, tft.width() / 2, tft.height() / 2);<br><br>  // Fetch the active title from the API<br>  fetchActiveTitle();<br><br>  // Fetch and display the flag color for the first time<br>  fetchAndDisplayFlagColor();<br>}<br><br>void fetchActiveTitle() {<br>  HTTPClient http;<br>  http.begin(textApiURL);<br>  int httpResponseCode = http.GET();<br><br>  if (httpResponseCode &gt; 0) {<br>    String payload = http.getString();<br>    Serial.println(payload);<br><br>    // Find the title with active: true in the JSON response<br>    int startIndex = payload.indexOf(&quot;\&quot;active\&quot;:true&quot;);<br>    if (startIndex != -1) {<br>      int titleIndex = payload.lastIndexOf(&quot;\&quot;title\&quot;:\&quot;&quot;, startIndex) + 9;<br>      int endIndex = payload.indexOf(&quot;\&quot;&quot;, titleIndex);<br>      activeTitle = payload.substring(titleIndex, endIndex);<br>    }<br>  } else {<br>    Serial.println(&quot;Error on HTTP request&quot;);<br>  }<br><br>  http.end();<br>}<br><br>void fetchAndDisplayFlagColor() {<br>  HTTPClient http;<br>  http.begin(apiURL);<br>  int httpResponseCode = http.GET();<br><br>  if (httpResponseCode &gt; 0) {<br>    String payload = http.getString();<br>    Serial.println(payload);<br>    <br>    // Parse the JSON response<br>    int index = payload.indexOf(&quot;flagColor\&quot;:\&quot;&quot;) + 12;<br>    char flagColor = payload.charAt(index);<br><br>    // Determine the status and corresponding flag color<br>    String status;<br>    uint16_t flagColorCode;<br>    switch (flagColor) {<br>      case &#39;C&#39;:<br>        status = &quot;Closed&quot;;<br>        flagColorCode = TFT_WHITE;<br>        break;<br>      case &#39;G&#39;:<br>        status = &quot;Green&quot;;<br>        flagColorCode = TFT_GREEN;<br>        break;<br>      case &#39;Y&#39;:<br>        status = &quot;Yellow&quot;;<br>        flagColorCode = TFT_YELLOW;<br>        break;<br>      case &#39;R&#39;:<br>        status = &quot;Red&quot;;<br>        flagColorCode = TFT_RED;<br>        break;<br>      default:<br>        status = &quot;Unknown&quot;;<br>        flagColorCode = TFT_WHITE;<br>        break;<br>    }<br><br>    // Add the &quot;FLAG&quot; label in blue<br>    tft.fillScreen(TFT_BLACK);<br>    tft.setTextSize(3);<br>    tft.setTextColor(TFT_BLUE);<br>    tft.drawString(&quot;FLAG&quot;, 10, 10);  // Draw &quot;FLAG&quot; on the top left<br><br>    // Display the status text below the &quot;FLAG&quot; label in the appropriate color<br>    tft.setTextColor(flagColorCode);<br>    tft.drawString(status, 10, 39); // Status text directly below &quot;FLAG&quot;<br><br>    // Draw the flag (a rectangle with a pole and wave effect)<br>    int flagWidth = 50;   // Increased width to make the flag bigger<br>    int flagHeight = 35;  // Increased height to make the flag bigger<br>    int flagX = tft.width() - flagWidth - 10; // Top right with a margin of 10 pixels<br>    int flagY = 10; // Top with a margin of 10 pixels<br><br>    // Draw the pole<br>    tft.fillRect(flagX - 5, flagY, 3, flagHeight, TFT_DARKGREY); <br><br>    // Draw the flag with a simple wave effect<br>    for (int i = 0; i &lt; flagHeight; i++) {<br>      int waveOffset = (i % 2 == 0) ? 0 : 4; // Adjusted for the larger flag<br>      tft.drawFastHLine(flagX + waveOffset, flagY + i, flagWidth, flagColorCode);<br>    }<br><br>    // Display the &quot;status:&quot; label and active title on separate lines<br>    tft.setTextSize(1);<br>    tft.setTextColor(TFT_PURPLE);  // Purple color for the title label<br>    tft.drawString(&quot;status:&quot;, 10, tft.height() - 40);  // Label &quot;status:&quot; above the title<br>    tft.setTextColor(TFT_WHITE);<br>    tft.drawString(activeTitle, 10, tft.height() - 20); // Title text on the next line<br>  } else {<br>    Serial.println(&quot;Error on HTTP request&quot;);<br>    tft.fillScreen(TFT_BLACK);<br>    tft.setTextColor(TFT_WHITE);<br>    tft.drawString(&quot;Error fetching data&quot;, tft.width() / 2, tft.height() / 2);<br>  }<br><br>  http.end();<br>}<br><br>void loop() {<br>  fetchAndDisplayFlagColor();  // Fetch and display flag color continuously<br>  delay(10000);  // Wait 10 seconds before making another API call<br>}</pre><h3>Conclusion 🎯</h3><p>This small project not only saved me time but also added a bit of fun to my sailing routine ⛵. Now, every time I’m about to head out, I just glance at my IoT device to see the current flag status — no more unnecessary web browsing! Whether you’re a fellow sailor or just someone who loves tinkering with IoT, I hope this post inspires you to build something that simplifies your life. If you’re interested in the details, feel free to reach out or check the <a href="https://github.com/jegamboafuentes/IoT-Flag-Monitor-for-Community-Boating-Boston">GitHub repository</a> for the complete code!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WL1VmEq5YwqKUxViiAzWPg.jpeg" /><figcaption>Launching site of Community Boating in Boston displaying a Yellow Flag</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86deacb6f715" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Our Epic Win at the MIT Bitcoin Hackathon 2024! ]]></title>
            <link>https://jegamboafuentes.medium.com/our-epic-win-at-the-mit-bitcoin-hackathon-2024-34fab944e78d?source=rss-9038ca33f9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/34fab944e78d</guid>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[mit]]></category>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Enrique Gamboa]]></dc:creator>
            <pubDate>Sun, 05 May 2024 15:20:51 GMT</pubDate>
            <atom:updated>2024-05-05T15:20:51.827Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6kLpd4jnNVmoHWs_d00iw.png" /><figcaption>MIT Bitcoin Expo 2024 — official expo banner</figcaption></figure><h3>Introduction 🌟</h3><p>Greetings! As staunch advocates for open-source and cryptocurrency, participating in the <a href="https://mitbitcoinexpo.org/">MIT Bitcoin Hackathon 2024</a> was an excellent match for our team’s aspirations. Driven by a commitment to innovation, we embarked on a challenge to enhance how <em>open-source</em> contributions are <strong>rewarded 🪙</strong>. We focused on integrating <strong>Bitcoin, GitHub actions </strong>and the <strong>Lightning Network</strong> into our solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IXP5B4DUyz-5Rks3GbRpfw.jpeg" /><figcaption>April 20, 2024–9:30 AM — MIT BTC EXPO 2024 has started</figcaption></figure><h3>The Hackathon Challenge ⚙️</h3><p>The atmosphere at the <a href="https://devpost.com/software/lightning-bounty">hackathon </a>was charged with excitement, featuring a blend of intense coding and collaborative innovation. Over the weekend of April 19th to 21st (<em>the Same as the Bitcoin halving 2024), we developed our project, “Lightning Bounties,</em><strong>”, </strong>which integrates <strong>GitHub Actions</strong> with Bitcoin rewards <strong>🪙</strong>, providing a compelling incentive for open-source contributions.</p><h3>The Project 🛠️</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*wHSb0zOgM-V0RTOv9n4beg.png" /><figcaption>“Lightning Bounties” — Project logo</figcaption></figure><p>Project link: <a href="https://devpost.com/software/lightning-bounty">Link</a></p><p>Github repo: <a href="https://github.com/MIT-Bitcoin-2024/lightning-bounty">Link</a></p><p>“<strong>Lightning Bounties</strong>” employs <em>GitHub Actions</em> alongside the <em>Lightning Network</em> to facilitate instant Bitcoin rewards <strong>🪙</strong>. Here’s a technical overview:</p><ul><li><strong>GitHub Actions</strong>: These are used to automate pull request reviews through custom scripts. Once a pull request meets predefined quality and security benchmarks, it triggers the reward mechanism.</li><li><strong>Lightning Network</strong>: This technology ensures that the reward transactions are executed swiftly, allowing contributors to receive Bitcoin rewards immediately after their contributions are merged.</li><li><strong>Compensation Mechanism</strong>: Our system not only offers rewards for accepted contributions but also provisions for refunds if contributions are not integrated, promoting a fair and encouraging environment.</li></ul><h4>Project Architecture 📐</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8YJKcvC0wpGBIz4RCgYJng.png" /><figcaption>Lightning Bounties — Project workflow</figcaption></figure><h4>Project demo 📽️</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F937118336%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F937118336&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1837651605-9bf2fefd500ded11085850da3cc9ff4deef4dee2a2f9e8d317f770c48aa45489-d_1280&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/dcc4e0cf08f356d2fee30667d2bbd470/href">https://medium.com/media/dcc4e0cf08f356d2fee30667d2bbd470/href</a></iframe><h3>Achievement 🥇</h3><p>Our innovative integration of <em>GitHub Actions</em> and the<em> Lightning Network</em> was well-received, earning us the <strong>first place</strong> 🥇in the Track 1<em> (Bitcoin, Lightning &amp; Taproot)</em> at the hackathon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vIXvbsxD4j-06r2ERpRfUg.png" /><figcaption>Team <strong>Lightning Bounties, </strong>presenting the project at the Hackathon ceremony award</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*nMUQA4BiYjOxKdiuHDk_fA.png" /><figcaption>Hackathon award ceremony — Announcing <strong>Lightning Bounties </strong>as a first-prize winner.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*O1VIo-OOejveKgm_DjMsIw.png" /><figcaption>Hackathon award ceremony — <strong>Lightning Bounties </strong>presenting the project.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*TB6t5VqY6JzTcW2nFCaaZw.png" /><figcaption>Screenshot of MIT BTC hackathon 2024 winners</figcaption></figure><h3>The Team 👥</h3><p>Our team comprises a diverse group of individuals passionate about technology and innovation:</p><ul><li>Will, Mike, Pavel, Alex, and Enrique (me).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABetlejazdTYsIvW-VeHEw.jpeg" /><figcaption>Team, developing <strong>Lightning Bounties </strong>at MIT campus in Cambridge, MA.</figcaption></figure><h3>Future Directions 🌍</h3><p>Encouraged by our success, we are transitioning <strong>“Lightning Bounties”</strong> into a startup 🚀. We are committed to expanding the platform to support multiple cryptocurrencies and further integrating with GitHub’s ecosystem.</p><h3>Conclusion</h3><p>One of the most incredible experiences I&#39;ve ever had was winning this hackathon. It provided a fantastic opportunity to meet like-minded people. Winning first place was especially meaningful to me because it demonstrated that our hard work as developers is paying off. I&#39;m excited to continue working on this amazing project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T0JoRA1Ih4a3EzNbIHd5gA.png" /><figcaption>Picture of the STATA center at MIT campus during the hackathon.</figcaption></figure><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34fab944e78d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>