• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • Weโ€™re hiring!
Log inSign up
dcm31

dcm31

m5stackinterface

Public
Like
m5stackinterface
Home
Code
3
backend
2
frontend
1
README.md
Branches
3
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ€“ all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://dcm31--be0ceb7a457e11f0827e76b3cceeab13.web.val.run
README.md

Screen Composer Webhook

A webhook endpoint for M5StickCPLUS2 devices that manages button labels through HTTP requests.

Features

๐ŸŽฎ Device Integration

  • Handles M5StickCPLUS2 device requests (GET for init, POST for button presses)
  • Manages button labels for buttons A, B, and C
  • Implements label rotation demo functionality

๐ŸŒ Web Interface

  • Clean web UI for monitoring device interactions
  • Real-time log of device requests and responses
  • Manual label management interface
  • Copy-to-clipboard webhook URL

๐Ÿ“Š Request Logging

  • SQLite database for persistent storage
  • Logs all device interactions with timestamps
  • Shows request/response pairs for debugging

API Endpoints

Device Webhook

  • GET / - Device initialization handshake
  • POST / - Button press events

Web Interface

  • GET / (browser) - Management dashboard
  • GET /logs - JSON API for request logs
  • POST /clear-logs - Clear all logs
  • POST /update-labels - Manually update labels

Device Protocol

Device โ†’ Webhook

// Boot/refresh { "device": "M5StickCPLUS2", "event": "init" } // Button press { "device": "M5StickCPLUS2", "event": "press", "button": "A", "value": "Yes please", "ts_ms": 1234567 }

Webhook โ†’ Device

{ "labels": { "A": "New A text", "B": "New B text", "C": "New C text" } }

Demo Behavior

The default implementation rotates through a list of labels:

  • Initial: ["Red", "Green", "Blue"]
  • After button press: ["Green", "Blue", "Red"] (rotated left)
  • Maps to buttons A, B, C respectively

Technical Details

  • Built with Hono framework
  • SQLite for data persistence
  • TailwindCSS for styling
  • Handles both device requests and web interface
  • Error handling with appropriate HTTP status codes
  • Payload size kept under 1KB for device compatibility
HTTP
  • index.ts
    dcm31--be0ceb7a457e11f0827e76b3cceeab13.web.val.run
Code
backendfrontendREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
Weโ€™re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
ยฉ 2025 Val Town, Inc.