Why You Need It
In today’s digital age, managing internet usage efficiently is crucial, especially for home offices, small businesses, or high-traffic environments. A desktop bandwidth display connected to your Mikrotik router gives you a real-time overview of your network’s performance. It visually monitors upload and download speeds across multiple interfaces, helping you:
- Detect and resolve network congestion quickly.
- Monitor bandwidth usage to ensure fair distribution.
- Identify anomalies or unauthorized usage on your network.
- Gain insights into network performance trends at a glance.
Benefits of a Desktop Bandwidth Display
- Real-Time Monitoring: With continuous updates, you’re always informed about your network’s current state.
- Multi-Interface Support: Track bandwidth across multiple router interfaces simultaneously.
- Customizable Settings: Tailor the device to your specific network’s configuration.
- Standalone Device: No need to constantly open a browser or application—everything is displayed directly on the device.
How It Works
This project uses an ESP32 microcontroller connected to a Mikrotik router and a MAX7219-based 8-digit LED matrix. The ESP32 fetches bandwidth data using the Mikrotik API, processes it, and displays it on the LED matrix. Configuration is handled through WiFiManager for seamless setup and customization.
Crucial Parts of the Program
- WiFi and Configuration Handling:
- The device connects to WiFi using stored credentials or launches a configuration portal if no connection is available.
- WiFiManager handles custom parameters for Mikrotik credentials and interface settings.
wifiManager.setSaveConfigCallback(saveConfigCallback);
wifiManager.addParameter(&custom_mikrotik_host);
wifiManager.addParameter(&custom_mikrotik_user);
wifiManager.addParameter(&custom_mikrotik_password);
wifiManager.addParameter(&custom_mikrotik_interfaces);
if (!wifiManager.autoConnect("Mikrotik_2_Bandwidth_Display")) {
ESP.restart();
}
if (shouldSaveConfig) {
saveConfig();
}
Fetching Bandwidth Data:
- Uses HTTPClient to send a POST request to the Mikrotik router’s API.
- Parses the JSON response to extract upload and download speeds for each interface.
Displaying Data:
- Converts speeds into a readable format and displays them on the LED matrix.
void displayNumber(int displayIdx, float valueToDisplay) {
long kbpsValue = valueToDisplay / 1024;
long bpsValue = (long)(valueToDisplay - (kbpsValue * 1024));
for (int i = 0; i < 8; i++) {
int digit = (i < 4) ? bpsValue % 10 : kbpsValue % 10;
lc.setDigit(displayIdx, i, digit, (i == 4 || i == 7));
}
}
Setting Up the Device
- Hardware Requirements:
- ESP32 microcontroller.
- MAX7219-based 8-digit LED matrix.
- Power supply and necessary wiring.
- Software Setup:
- Upload the program to the ESP32 using Arduino IDE.
- Connect to the WiFiManager portal to set up your Mikrotik credentials and interfaces.
- Deployment:
- Place the device on your desk or any visible location.
- Enjoy real-time monitoring of your network’s bandwidth usage.
The full code for this project is not finalized and will not be shared publicly. However, if you’re interested in having a customized version of this project, feel free to email me. I can develop one tailored to your needs and send it to you via courier.
This is an invaluable tool for maintaining and optimizing your network. With features like real-time monitoring, easy setup, and multi-interface support, this project combines practicality with efficiency. It’s perfect for tech enthusiasts, network administrators, or anyone who values detailed insights into their internet usage.