DIYables Web Apps Web Monitor
Overview
The WebMonitor example replaces the traditional Serial Monitor with a web-based interface that's accessible from any device on your network. Designed for Arduino Uno R4 WiFi and DIYables STEM V4 IoT educational platform with enhanced IoT capabilities, built-in sensor monitoring, and seamless integration with the educational ecosystem.

Watch this step-by-step video tutorial demonstrating how to use WebMonitor with the DIYables WebApps app:
Features
- Real-time Serial Output: View Arduino messages instantly in browser
- Command Input: Send commands from web interface to Arduino
- Dark Theme: Easy-on-eyes terminal-style interface
- Auto-scroll: Automatically scrolls to latest messages
- Timestamp: All messages include timestamps
- Command History: Navigate previous commands with arrow keys
- Clear Function: Clear the monitor display
- Copy/Paste: Full text selection and copying support
- Platform Extensible: Currently implemented for Arduino Uno R4 WiFi, but can be extended for other hardware platforms. See DIYables_WebApps_ESP32
Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables STEM V4 IoT Starter Kit (Arduino included) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Setup Instructions
Detailed Instructions
Follow these instructions step by step:
- If this is your first time using the Arduino Uno R4 WiFi/DIYables STEM V4 IoT, refer to the tutorial on setting up the environment for Arduino Uno R4 WiFi/DIYables STEM V4 IoT in the Arduino IDE.
- Connect the Arduino Uno R4/DIYables STEM V4 IoT board to your computer using a USB cable.
- Launch the Arduino IDE on your computer.
- Select the appropriate Arduino Uno R4 board (e.g., Arduino Uno R4 WiFi) and COM port.
- Navigate to the Libraries icon on the left bar of the Arduino IDE.
- Search "DIYables WebApps", then find the DIYables WebApps library by DIYables
- Click Install button to install the library.

- You will be asked for installing some other library dependencies
- Click Install All button to install all library dependencies.

- On Arduino IDE, Go to File Examples DIYables WebApps WebMonitor example, or copy the above code and paste it to the editor of Arduino IDE
- Configure WiFi credentials in the code by updating these lines:
- Click Upload button on Arduino IDE to upload code to Arduino UNO R4/DIYables STEM V4 IoT
- Open the Serial Monitor
- Check out the result on Serial Monitor. It looks like the below
- If you do not see anything, reboot Arduino board.
- Take note of the IP address displayed, and enter this address into the address bar of a web browser on your smartphone or PC.
- Example: http://192.168.0.2
- You will see the home page like below image:

- Click to the Web Monitor link, you will see the Web Monitor app's UI like the below:

- Or you can also access the page directly by IP address followed by /web-monitor. For example: http://192.168.0.2/web-monitor
- Try sending commands to your Arduino through the web monitor interface and view real-time serial output from your Arduino.
How to Use
Viewing Serial Output
- Open the web monitor interface
- Arduino automatically sends status messages every 5 seconds
- All Serial.println() output appears in the monitor
- Messages are timestamped automatically
Sending Commands
- Type commands in the input field at the bottom
- Press Enter or click Send button
- Arduino processes the command and responds
Built-in Commands
The example includes these demonstration commands:
LED Control
- "led on" → Turns on built-in LED
- "led off" → Turns off built-in LED
- "led toggle" → Toggles LED state
- "blink" → Blinks LED 3 times
System Commands
- "status" → Shows Arduino status and uptime
- "help" → Lists available commands
- "reset counter" → Resets message counter
- "memory" → Shows free memory information
Debug Commands
- "test" → Sends test message
- "echo [message]" → Echoes back your message
- "repeat [n] [message]" → Repeats message n times
Interface Features
Keyboard Shortcuts
- Enter → Send command
- ↑/↓ Arrow Keys → Navigate command history
- Ctrl+L → Clear monitor (if implemented)
- Ctrl+A → Select all text
Monitor Controls
- Auto-scroll → Automatically scrolls to new messages
- Clear → Clears the monitor display
- Copy → Copy selected text to clipboard
Creative Customization - Build Your Advanced Debugging Tool
Expand this web monitor example to create a powerful debugging and control interface for your projects! Add custom commands, sensor monitoring, and real-time data visualization to suit your creative needs.
Code Structure
Main Components
- WebApp Server: Handles HTTP and WebSocket connections
- Monitor Page: Provides terminal-style web interface
- Message Handler: Processes incoming commands
- Serial Bridge: Forwards Serial output to web interface
Key Functions
Adding Custom Commands
To add new commands, modify the handleWebCommand function:
Practical Applications
Development and Debugging
Remote System Monitoring
Configuration Management
Advanced Features
Message Filtering
Add message types and filtering:
Command Parsing
Implement sophisticated command parsing:
Data Logging
Log monitor data to SD card or EEPROM:
Troubleshooting
Common Issues
1. No output in web monitor
- Check Serial.begin() is called in setup()
- Verify WebSocket connection (green status indicator)
- Check browser console for errors
2. Commands not working
- Ensure commands are exactly as specified
- Check command case sensitivity
- Look for response messages in monitor
3. Interface loading slowly
- Check WiFi signal strength
- Reduce message frequency
- Clear browser cache
4. WebSocket disconnections
- Check network stability
- Reduce message size
- Implement reconnection logic
Debug Tips
Enable detailed debugging:
Monitor WebSocket status:
Security Considerations
Command Validation
Always validate incoming commands:
Access Control
Implement basic authentication:
Integration Examples
Sensor Monitoring System
Home Automation Monitor
Arduino Uno R4 WebMonitor with DIYables WebApps
The below code is an adaptation of the WebMonitor example, and the result is shown in the video demo below:
Next Steps
After mastering the WebMonitor example, try:
- Chat - For interactive communication
- DigitalPins - For controlling outputs
- Slider - For analog value control
- MultipleWebApps - Combining monitoring with control
Support
For additional help:
- Check the API Reference documentation
- Visit DIYables tutorials: https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-diyables-webapps
- Arduino community forums