Introducing Serial Commands: A Game-Changer for WebScreen Development
WebScreen just got a massive productivity boost with the introduction of a comprehensive serial command system. What started as a simple embedded display project has evolved into a full-fledged development platform, and these new commands make managing your JavaScript applications easier than ever.
The Problem We Solved
Previously, developing for WebScreen meant a constant cycle of:
■ Write JavaScript code in your editor
■ Copy files to SD card manually
■ Insert SD card into WebScreen
■ Restart device to test
■ Remove SD card to make changes
■ Repeat...
This workflow was not only tedious but also made rapid prototyping and debugging a nightmare. We needed a better way.
Enter Serial Commands
The new serial command system transforms WebScreen into an interactive development environment. All commands start with a forward slash (/) and are available in both fallback mode and while running JavaScript applications.
Core Development Commands
Script Management:
/write clock.js # Interactive script editor
/load weather.js # Switch to different app instantly
/cat my_app.js # View script contents
/rm old_script.js # Clean up unused filesConfiguration on the Fly:
/config set wifi.ssid MyNetwork
/config set wifi.password MyPassword
/config get script_fileSystem Monitoring:
/stats # Memory, storage, WiFi status
/info # Device specs and version
/ls / # Browse SD card contentsInteractive Script Editor
The /write command deserves special attention. It provides a line-by-line JavaScript editor right in your serial console:
WebScreen> /write weather.js
Enter JavaScript code. End with a line containing only 'END':
---
+ // Weather display app
+ let temp = http_get('https://api.weather.com/current');
+ let data = parse_json_value(temp, 'temperature');
+ create_label_with_text('Temperature: ' + data + '°C');
+ END
[OK] Script saved: /weather.js (234 bytes)The editor provides real-time feedback, showing each line as it's entered with a + prefix, making it clear what's being captured.
Configuration Management Made Simple
WebScreen's JSON configuration system is now fully accessible via commands:
# Check current WiFi network
/config get wifi.ssid
wifi.ssid = MyHomeNetwork
# Update to new network
/config set wifi.ssid OfficeNetwork
/config set wifi.password NewPassword123
# Restart to apply changes
/rebootThe system supports nested JSON keys using dot notation, making it intuitive to navigate complex configurations.
Live System Monitoring
The /stats command provides instant insight into your device's health:
WebScreen> /stats
=== System Statistics ===
Free Heap: 234.5 KB
Total Heap: 320.0 KB
Free PSRAM: 7.2 MB
Total PSRAM: 8.0 MB
SD Card Size: 32.0 GB
SD Card Used: 2.4 MB
SD Card Free: 31.9 GB
WiFi: Connected to MyNetwork
IP Address: 192.168.1.100
Signal Strength: -45 dBm
Uptime: 3247 seconds
CPU Frequency: 240 MHzThis is invaluable for debugging memory issues, checking connectivity, and monitoring long-running applications.
Universal Availability
Perhaps the most powerful aspect of this system is that commands work in both operating modes:
■ Fallback Mode: When no JavaScript app is loaded
■ Dynamic Mode: While JavaScript applications are actively running
This means you can monitor, debug, and even switch applications without interrupting your workflow.
File System Operations
The command system provides complete file system access:
/ls / # List root directory
/ls /apps # Browse apps folder
/cat webscreen.json # View configuration
/rm debug.log # Clean up filesThis eliminates the need to remove the SD card for basic file operations.
Development Best Practices
The serial commands enable new development patterns:
Rapid Prototyping:
/write prototype.js # Quick idea testing
/load prototype.js # Instant testing
/stats # Check resource usageA/B Testing:
/write version_a.js # Create variant A
/write version_b.js # Create variant B
/load version_a.js # Test A
/load version_b.js # Test BLive Configuration:
/config set display.brightness 150 /reboot # Apply immediately
Technical Implementation
■ The command system is built with robustness in mind:
■ Comprehensive error handling with clear messages
■ Smart path completion (auto-adds .js extension)
■ Memory-efficient parsing
■ Non-blocking serial processing
■ Consistent command syntax
Future Possibilities
This foundation opens doors for exciting features:
■ Remote command execution over WiFi
■ Batch script execution
■ Configuration templates
■ Application marketplace integration
■ Advanced debugging tools
Getting Started
Using the serial commands is straightforward:
■ Connect to WebScreen via USB serial (115200 baud)
■ Type /help to see all available commands
■ Start with /stats to check system health
■ Try /write hello.js to create your first script
The system provides helpful prompts and clear feedback, making it accessible to both beginners and advanced developers.
Impact on the WebScreen Ecosystem
These commands transform WebScreen from a display device into a complete embedded development platform. The ability to iterate quickly, monitor systems in real-time, and manage configurations dynamically makes WebScreen suitable for rapid prototyping, educational environments, and production deployments alike.
Conclusion
The serial command system represents a fundamental shift in how we interact with WebScreen. By eliminating the friction in the development process, we've made it possible to focus on what matters most: creating amazing applications.
Whether you're building a weather station, digital art display, or IoT dashboard, the new serial commands will accelerate your development process and make debugging a breeze.
The future of embedded development is interactive, immediate, and intuitive. With WebScreen's serial commands, that future is here today.
Ready to try the new serial commands? Flash the latest firmware (development branch), connect to your WebScreen and type /help to get started. Happy coding!
Support Us on Crowd Supply
We’re on Crowd Supply, and we need your help to bring WebScreen to more people. Your backing makes it possible to keep prices low and quality high—so everyone can enjoy the power of an open-source secondary display.
Check out the campaign and get involved: WebScreen on Crowd Supply