A modern, web-based integrated development environment for WebScreen devices with dual theme support, providing serial communication, code editing, and command execution capabilities.
- Serial Communication: Direct Web Serial API connection to WebScreen devices
- Dual Theme System: Switch between "Retro" (amber phosphor) and "Focus" (VS Code-like) themes
- Tabbed Interface: Organized workspace with Serial Console, JavaScript Editor, and File Manager
- URL Theme Selection: Set theme via URL parameter (
?mode=retroor?mode=focus) - Real-time Terminal: Live serial console with command history and auto-completion
- File Management: Upload, list, download, and manage files on the device
- Syntax Highlighting: JavaScript syntax highlighting with theme-appropriate colors
- IntelliSense: Auto-completion with WebScreen API suggestions
- Line Numbers: Easy navigation with contextual line numbering
- Bracket Matching: Automatic bracket pairing and highlighting
- Code Folding: Collapse code blocks for better navigation
- Search & Replace: Built-in search functionality (Ctrl+F)
- Keyboard Shortcuts:
Ctrl+S: Save file to deviceF5: Run script on deviceCtrl+/: Toggle commentsCtrl+Space: Trigger autocomplete
- Amber Phosphor Colors: Classic orange/yellow terminal aesthetic
- Scan Line Effects: Authentic CRT monitor simulation
- Glowing Elements: Neon effects on buttons and text
- Terminal Animation: Animated background with retro styling
- VS Code Inspired: Clean, modern development environment
- Reduced Eye Strain: Muted colors perfect for long coding sessions
- No Animations: Distraction-free interface
- Professional Layout: Clean typography and spacing
All WebScreen serial commands are supported with auto-completion:
- Core:
/help,/stats,/info,/reboot,/brightness - File Operations:
/write,/ls,/cat,/rm - Network:
/wget,/ping - Configuration:
/config get/set,/backup - Monitoring:
/monitor cpu/mem/net - Script Management:
/load,/run
- Responsive Design: Works on desktop and tablet devices
- Tabbed Workspace: Separate areas for console, editor, and files
- Quick Commands: One-click access to common WebScreen commands
- API Documentation: Built-in reference for WebScreen JavaScript API
- Status Bar: Real-time connection info with WebScreen branding
- Credits Section: Creative Commons licensing information
- Browser: Chrome, Edge, or Opera (Web Serial API support required)
- WebScreen Device: Connected via USB with serial commands firmware
-
Open the IDE
Open index.html in a supported browser -
Choose Theme (Optional)
Add theme parameter to URL: - file:///path/to/index.html?mode=retro (amber phosphor theme) - file:///path/to/index.html?mode=focus (clean development theme) -
Connect Device
- Click "Connect Device" button
- Select your WebScreen device from the serial port list
- Wait for successful connection
-
Navigate Interface
- Serial Console: Direct command-line interaction
- JavaScript Editor: Write and edit WebScreen applications
- File Manager: Browse and manage device files
-
Write Code
- Use the JavaScript editor with full syntax highlighting
- Take advantage of WebScreen API autocomplete
- Save your work with Ctrl+S or the Save button
-
Execute Commands
- Use the terminal to execute serial commands
- Try quick commands like
/statsor/help - Upload and run scripts with F5 or the Run button
"use strict";
// Create styles (colors as hex integers, not strings)
let style = create_style();
style_set_text_font(style, 48); // Use available sizes: 14,20,28,34,40,44,48
style_set_text_color(style, 0xFFFFFF); // White text
style_set_text_align(style, 1); // Center align
// Create and style a label
let label = create_label(268, 120); // x, y position
obj_add_style(label, style, 0);
label_set_text(label, "Hello WebScreen!");
// Network example with custom port
let response = http_get("http://192.168.1.20:2000/api/data");
let value = parse_json_value(response, "temperature");
print("Temperature: " + value);
// Storage example
sd_write_file("/config.txt", "My configuration");
let config = sd_read_file("/config.txt");
print("Config loaded: " + config);
// Timer callback (function name as string)
let update = function() {
label_set_text(label, "Updated!");
};
create_timer("update", 1000);1. Choose your preferred theme (Retro for creative work, Focus for long sessions)
2. Write JavaScript code in the editor with API autocomplete
3. Press F5 to upload and run immediately
4. See results on WebScreen display
5. Iterate quickly without SD card swapping
1. Switch to File Manager tab
2. Use /ls to see existing files
3. Save scripts with custom filenames
4. Download files for backup
5. Load different applications with /load
1. Use Serial Console for real-time monitoring
2. Use /stats to monitor memory usage
3. Use /monitor for continuous system stats
4. Use /ping to test network connectivity
5. Debug issues with live serial output
URL Parameters:
- ?mode=retro - Amber phosphor terminal theme
- ?mode=focus - Clean VS Code-like theme
Button Toggle:
- Click theme button in header to switch themes
- Theme preference is saved automatically
- Frontend: Vanilla JavaScript with CodeMirror editor
- Serial Communication: Web Serial API for device connection
- Theming: CSS custom properties with dual-theme system
- UI Framework: Tabbed interface with responsive design
- No Backend: Pure client-side application
- CSS Variables: Dynamic theme switching using custom properties
- LocalStorage: Theme preference persistence
- URL Parameters: Direct theme selection via query strings
- CodeMirror Integration: Editor themes sync with UI themes
- β Chrome 89+: Full support
- β Edge 89+: Full support
- β Opera 75+: Full support
- β Firefox: No Web Serial API support
- β Safari: No Web Serial API support
WebScreen-Serial-IDE/
βββ index.html # Main HTML with tabbed interface
βββ style.css # Dual-theme CSS system
βββ serial.js # Serial communication manager
βββ app.js # Main application with theme management
βββ assets/
β βββ animation.gif # Terminal animation for retro theme
β βββ logo.png # WebScreen logo
β βββ favicon.ico # Browser favicon
βββ README.md # This documentation
Core serial communication functionality:
// Connection management
await serial.connect()
await serial.disconnect()
// Command execution with auto-completion
await serial.sendCommand('/help')
await serial.sendFile('script.js', content)
// WebScreen specific methods
await serial.getStats()
await serial.listFiles()
await serial.loadScript('app.js')
await serial.backup('save', 'production')Main application controller with theme management:
// Editor operations
ide.saveFile()
ide.runScript()
ide.clearTerminal()
// Theme management
ide.loadTheme() // Load theme from URL or localStorage
ide.setTheme('retro') // Set specific theme
ide.toggleTheme() // Switch between themes
// UI management
ide.switchTab('files') // Switch between Console/Editor/Files
ide.updateConnectionStatus(connected)
ide.appendToTerminal(message, className)// URL parameter theme selection
// ?mode=retro or ?mode=focus
// Manual theme switching
const ide = window.webScreenIDE;
ide.setTheme('retro'); // Amber phosphor theme
ide.setTheme('focus'); // VS Code themeModify CSS custom properties to create new themes:
[data-theme="custom"] {
--color-primary: #00ff00;
--bg-primary: #001100;
--shadow-glow: 0 0 10px #00ff00;
/* ... other theme variables */
}Add custom commands by modifying the HTML:
<button class="cmd-btn" data-cmd="/custom command">Custom</button>Modify keyboard shortcuts and editor behavior:
extraKeys: {
'Ctrl-R': () => this.runScript(),
'Ctrl-Shift-S': () => this.saveAs(),
'F1': () => this.showHelp(),
}- Device not found: Ensure WebScreen is connected via USB and drivers are installed
- Permission denied: Try disconnecting and reconnecting the device
- Port busy: Close other serial applications (Arduino IDE, etc.)
- Theme not loading: Check URL parameter spelling (
mode=retroormode=focus) - Theme not persisting: Ensure localStorage is enabled in browser
- Mixed theme elements: Hard refresh the page (Ctrl+F5)
- Syntax highlighting not working: Check if JavaScript mode is loaded
- Autocomplete not working: Ensure show-hint addon is loaded
- Slow performance: Clear terminal history or reduce editor content
- Commands not working: Verify device is running serial commands firmware
- Garbled output: Check baud rate (should be 115200)
- Timeout errors: Ensure stable USB connection
create_label(x, y)- Create a label at position, returns handlelabel_set_text(label, 'text')- Set label textcreate_image('filename')- Display an image filedraw_rect(x, y, w, h, color)- Draw a colored rectangle (color as 0xRRGGBB)show_gif_from_sd('/file.gif', x, y)- Display animated GIF at positionset_brightness(value)- Set display brightness (0-255)get_brightness()- Get current display brightness
wifi_connect('ssid', 'pass')- Connect to WiFi networkhttp_get('url')- HTTP GET (supports custom ports:http://host:port/path)http_post('url', data)- HTTP POST (supports custom ports)http_delete('url')- HTTP DELETE (supports custom ports)
sd_write_file('path', data)- Write data to SD card filesd_read_file('path')- Read data from SD card filesd_list_dir('/')- List files in directory
create_style()- Create a style objectstyle_set_text_font(style, size)- Set font size (14, 20, 28, 34, 40, 44, 48 only)style_set_text_color(style, 0xRRGGBB)- Set text colorstyle_set_bg_color(style, 0xRRGGBB)- Set background colorobj_add_style(obj, style, 0)- Apply style to object
delay(milliseconds)- Pause execution for specified timeprint(message)- Output message to serial consoleparse_json_value(json, key)- Extract value from JSON stringcreate_timer('callback_name', interval_ms)- Create periodic timer
Only these Montserrat sizes are enabled in the firmware:
| Size | Recommended Use |
|---|---|
| 14 | Default, small text |
| 20 | Body text |
| 28 | Subheadings |
| 34 | Medium headings |
| 40 | Large headings |
| 44 | Extra large |
| 48 | Display text |
Important: Sizes like 16, 24, 32 are NOT available.
- PNG β - Recommended for icons and graphics
- GIF β - Animated images (keep under 50KB)
- SJPG β - Split JPG for large images
- BMP β - Not supported
Label, Image, Arc, Line, Button, Button Matrix, Canvas, Chart, Meter, Message Box, Span
- Elk JS heap: 256KB (PSRAM)
- Keep scripts under 3KB for stability
- Limit to 5 styles and 10 labels per app
- Clone the repository
- Open
index.htmlin a supported browser - Connect a WebScreen device for testing
- Test both themes with URL parameters
- Make modifications and test locally
- New Themes: Extend CSS custom properties system
- New Commands: Add to SerialManager class methods
- UI Components: Modify HTML structure and CSS styling
- Editor Features: Extend CodeMirror configuration
| Type | Resource | Description |
|---|---|---|
| π Bug Reports | GitHub Issues | Report bugs and request features |
| π¬ Discussions | GitHub Discussions | Ask questions and share ideas |
| π Documentation | docs/ | API reference and guides |
| π Website | WebScreen.cc | Official project website |
| π Hardware | CrowdSupply | Purchase WebScreen hardware |
If WebScreen has been useful for your projects:
- β Star the repo to show your support
- π΄ Fork and contribute to make it better
- π Report issues to help us improve
- π Improve documentation for other users
- π° Sponsor development to fund new features
This project is open source. See the LICENSE file for details.
