smartthingscommunity/st-device-sdk-c/stdk-log-analysis
Claude Code and agent skill by smartthingscommunity/st-device-sdk-c
- community
Checking that the SKILL.md file is still in the repository.
Comprehensive SmartThings Device SDK (STDK) log analysis with automatic error extraction, operation flow reconstruction, and issue diagnosis. Identifies problems, provides root cause analysis, and recommends solutions with GitHub source code references.
Install
npx vskill@latest install smartthingscommunity/st-device-sdk-c/stdk-log-analysisSKILL.md
STDK Log Analysis
Comprehensive analysis of SmartThings Device SDK (STDK) log files to identify operation flows, extract errors, and diagnose issues with GitHub source code references.
When to Use
- When users share device log files for analysis
- When analyzing onboarding failures from device logs
- When investigating MQTT connection problems
- When troubleshooting attribute/capability transmission errors
- When diagnosing API call failures
- When understanding device state transitions and operation flow
Supported Log Types
- Device Logs
- STDK SDK output logs
- Format:
[I][D][W][E] tag: message - Example:
[E] iot_main: MQTT connection failed
- Mobile App Logs
- SmartThings mobile app logs
- Android logcat / iOS system logs
- Network Capture Logs
- BLE/BTSnoop logs
- Analyzable with
tools/btsnoop_parser.pyfrom GitHub repository
STDK Log Identification
Major Log Tags
| Tag | Module | Description | |
|---|---|---|---|
iot_main | Core | Main state machine, connection management | |
iot_api | API | External API calls | |
iot_capability | Capability | Capability processing | |
iot_easysetup | EasySetup | Onboarding process | |
iot_mqtt | MQTT | Cloud communication | |
iot_security | Security | Security/encryption | |
iot_nv_data | NV Data | Storage management | |
iot_util | Utility | Utility functions | |
iot_bsp | BSP | Hardware abstraction |
Log Levels
[I]Info: General information[D]Debug: Debugging information[W]Warning: Warnings[E]Error: Errors[T]Trace: Detailed tracing
Major Error Patterns
Automatic Analysis Procedure
This skill performs comprehensive automated analysis on STDK log files:
Phase 1: Log File Parsing & Extraction
Automatically extract:
- Log Structure Analysis
- File size and line count
- Log timestamp range
- Device firmware version
- Serial number, MAC address
- Error/Warning Extraction
- All lines containing
ERROR|error|FAIL|fail|Exception|exception - All lines with
[E](Error level) - All lines with
[W](Warning level) - Error/warning context (3 lines before/after)
- Key Events Extraction
- STDK initialization:
[I] iot_or similar STDK tags - Connection attempts:
connect|CONNECT|mqtt|MQTT - Device state changes:
status|STATE|state|DEVICE_STATUS - Capability/attribute transmission:
publish|attribute|capability - Authentication/security:
TLS|authenticate|auth|key|Key
Phase 2: Operation Flow Reconstruction
Automatically track and visualize:
- Boot & Initialization
- System startup logs
- Module initialization sequence
- Configuration loading
- Onboarding Flow (if present in logs)
- BLE/SoftAP startup
- Mobile app connection
- Credential exchange
- WiFi AP connection
- Cloud registration
- Device state transitions (cmd: sequence)
- Connection Flow (if present in logs)
- WiFi association
- DHCP/IP address assignment
- DNS resolution
- TLS/Certificate handling
- MQTT connection
- MQTT authentication
- Topic subscription
- Initial attribute publishing
- Runtime Operation (if present in logs)
- Capability command reception
- Attribute publishing
- MQTT message exchanges
- Error/recovery sequences
Phase 3: Issue Identification & Diagnosis
Automatically identify:
- Critical Errors
- Error code classification (NE, CE, EE**)
- Error message extraction
- Error context and sequence
- Last successful operation before error
- Warning Analysis
- Driver warnings
- Retry attempts
- Timeout warnings
- Resource warnings
- API Error Analysis
- ConstraintViolationError
- UnprocessableEntityError
- NotValidValue errors
- Component/attribute mismatch
- Data type mismatch
- Attribute/Capability Errors (New)
- Invalid component names (e.g., "statusLed" instead of "main")
- Data type mismatches (object vs. array vs. string)
- Malformed JSON payloads
- Cloud rejection reasons
- Capability attribute structure errors
- Connection State Analysis
- Normal flow vs. abnormal flow
- Connection drops and timing
- Reconnection behavior
- State machine progression
Phase 4: Root Cause Analysis & Solutions
For each identified issue:
- Root Cause
- What actually failed
- When it failed (timestamp)
- Last successful state before failure
- Impact Assessment
- Does it affect functionality?
- Is it blocking or non-blocking?
- Can device still operate?
- Source Code Reference
- Related source files
- Function names
- Error code meanings
- Recommended Solutions
- Immediate actions
- Verification steps
- Prevention measures
Phase 5: Comprehensive Report
Provide structured output:
- Executive Summary
- Overall status (✅ Normal / ⚠️ With Warnings / ❌ Critical Issues)
- Key findings
- Critical issues requiring immediate fix
- Log Overview
- Time range analyzed
- Device info (SN, MAC, FW)
- Log statistics (total lines, errors, warnings)
- Operation Flow Timeline
- Chronological flow of major events
- Device state progression
- Connection status changes
- Issues Found (organized by severity)
- 🔴 Critical - Blocks device operation
- 🟠 Major - Causes functional issues
- 🟡 Warning - Non-blocking but should fix
- 🟢 Info - Non-critical notes
- Issue Details (for each issue)
- What: Error description
- When: Timestamp
- Where: Affected component
- Why: Root cause analysis
- How to fix: Recommended solution
- Code reference: Source files/functions
- Success Metrics
- What is working correctly
- What has been verified as normal
- Positive indicators
- Next Steps
- Priority action items
- Verification checklist
- Code changes needed (if any)
Analysis Examples
Example 1: AP Connection Failure
Log Pattern:
Automated Analysis Output:
Example 2: MQTT Connection Failure
Log Pattern:
Automated Analysis Output:
Example 3: Attribute Publishing Error (New)
Log Pattern:
Automated Analysis Output:
Example 4: Data Type Mismatch Error (New)
Log Pattern:
Automated Analysis Output:
EasySetup Command (cmd) Information
SoftAP/HTTP Onboarding Commands
EasySetup commands displayed as cmd:X format in logs:
| cmd | Enum Name | Description | Required | |
|---|---|---|---|---|
| 0 | IOT_EASYSETUP_STEP_DEVICEINFO | Device info query (protocol version, firmware, serial) | ✅ Required | |
| 1 | IOT_EASYSETUP_STEP_KEYINFO | Key exchange (ECDH, master secret generation) | ✅ Required | |
| 2 | IOT_EASYSETUP_STEP_CONFIRMINFO | Ownership confirmation info (OTM method) | ✅ Required | |
| 3 | IOT_EASYSETUP_STEP_CONFIRM | Ownership confirmation (button/PIN/QR) | ✅ Required | |
| 4 | IOT_EASYSETUP_STEP_WIFISCANINFO | WiFi AP scan results | ⚠️ Optional | |
| 5 | IOT_EASYSETUP_STEP_WIFIPROVIONINGINFO | WiFi credentials received | ✅ Required | |
| 6 | IOT_EASYSETUP_STEP_SETUPCOMPLETE | Onboarding complete confirmation | ✅ Required | |
| 7 | IOT_EASYSETUP_STEP_LOG_SYSTEMINFO | Log system info query | ❌ Diagnostic | |
| 8 | IOT_EASYSETUP_STEP_LOG_CREATE_DUMP | Log dump creation | ❌ Diagnostic | |
| 9 | IOT_EASYSETUP_STEP_LOG_GET_DUMP | Log dump retrieval | ❌ Diagnostic |
BLE Onboarding Commands
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/stdk-log-analysis/SKILL.md
Popularity
- Repository stars
- 138
- Repository forks
- 144
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/smartthingscommunity/st-device-sdk-c/stdk-log-analysis)