Hi there,
- Set Up MySQL for Network Access
Ensure your MySQL server is configured to accept connections from other devices on the local network by editing the MySQL config file (e.g., /etc/mysql/mysql.conf.d/mysqld.cnf
) and setting bind-address = 0.0.0.0
to listen on all interfaces.
Create a MySQL user with privileges to connect from your client device IPs and access the necessary database/tables.
Open port 3306 on your server firewall/router to allow MySQL traffic within your LAN.
- Develop the Plugin Logic
Database Interaction: Use a programming language you know (e.g., Python, Node.js, PHP) with MySQL client libraries to connect to the MySQL server over the local network, query for print jobs, and update device info.
Network Scanning: Implement a network scanner to detect devices on the local subnet. You can:
Use ARP scanning or ping sweeps to find active IPs.
Retrieve MAC addresses from ARP tables or by sending network probes.
Extract OUIs from MAC addresses to identify device manufacturers.
Update Database: For each detected device matching your target OUIs (e.g., printers), insert or update their IP and OUI info in your MySQL database.
- Web Interface Near the Device
Develop a lightweight web server (e.g., using Flask for Python, Express for Node.js) running on the same device as the plugin.
This web interface can display current devices, allow manual addition/removal, and show print job status.
Access the web interface via the device’s IP address on the local network.
- Remote Access and Adding Devices Anywhere
To manage devices remotely, consider:
Using secure tunnels or VPNs to access your local network.
Tools like LocalXpose can expose your local MySQL or web server securely over the internet.
Implement authentication and encryption to protect your database and web interface.
- Development Workflow
Start by writing a simple script that connects to your MySQL server over the LAN and runs basic queries.
Add network scanning functionality to detect devices and extract OUIs.
Integrate the scanning results with database updates.
Build the web interface for local management.
Test the entire setup on your local network.
Finally, add remote access capabilities if needed.
Summary
You are essentially building a custom client-server application that:
Connects to a MySQL database over the local network.
Scans the network for devices by OUI.
Updates the database with device IPs.
Provides a local web interface for management.
Optionally supports remote access via tunneling or VPN.
This approach leverages your web development skills and standard networking/database tools. You will need to learn some network scanning techniques and database connectivity programming, but plenty of tutorials exist for these topics.
Regardsm
Arturas