Manually configuring hundreds of routers is a nightmare. It involves:
- Reading tiny text on labels (SSID, Password, S/N).
- Manually connecting to each router's WiFi.
- Clicking through a slow web interface (Region, Timezone, etc.).
- Typing in new credentials without making mistakes.
- Repeating this 500+ times.
NS_LINK is a hybrid automation system designed to turn this manual slog into a streamlined assembly line. It consists of two parts:
A Next.js web application (deployed on Vercel) that uses AI to instantly "read" router labels.
- Input: Photos of router labels.
- AI: Extracts Serial Number, Default SSID, and Default Password.
- Output: A clean CSV file (
router_queue.csv) ready for the bot.
A Python script that acts as a virtual robot.
- Input: The
router_queue.csvfile from the Scanner. - Action: It continuously scans the airwaves for the routers in your queue. When it sees one, it:
- Auto-connects to its WiFi.
- Runs the setup wizard (Region: Malaysia, Timezone, etc.).
- Sets the new SSID and Admin Password.
- Verifies the configuration.
Follow these steps to configure a batch of routers.
Goal: Create a digital list of all routers to be configured.
- Open the Web App: Navigate to your Vercel deployment URL.
- Scan Labels:
- Use the Camera tab to snap photos of router labels on your phone/laptop.
- OR use Upload if you have existing photos.
- Verify & Edit:
- The AI will extract the details. Check them quickly.
- CRITICAL: Enter the Target SSID for each router (e.g., "NS Room 801", "Lobby WiFi"). This is what the router will become.
- Preview & Download:
- Click Preview CSV to double-check your batch.
- Click Download CSV. This will save
router_queue.csvto your computer.
Goal: Let the robot do the work.
- Prepare the Environment:
- Ensure you have the
router_queue.csvfile in the same folder asmain.py. - Power ON the routers you want to configure. You can do them in batches (e.g., 5-10 at a time).
- Ensure you have the
- Run the Bot:
- Open your terminal (Command Prompt or PowerShell).
- Navigate to the project folder.
- Run the command:
python main.py
- Watch the Magic:
- The bot will say:
🏭 NS ROUTER MILL: FACTORY MODE ACTIVATED. - It will scan for WiFi networks.
- When it finds a match from your CSV, it will say
🎯 MATCH!. - It will launch a browser window, log in, and click through the setup wizard for you.
- Do not touch the mouse/keyboard while the browser window is open.
- The bot will say:
- Completion:
- Once a router is done, the bot will mark it as complete and start looking for the next one.
- Label the finished router and move to the next batch.
If you are setting this up on a new laptop, you need:
- Python: Install Python 3.x from python.org.
- Dependencies: Open terminal and run:
pip install playwright pandas requests playwright install
- WiFi Adapter: The laptop MUST have a working WiFi adapter to scan and connect to routers.
- Bot gets stuck on "Region": We recently fixed this! Ensure you have the latest version of
router_bot.py. - "Connection Failed": If the bot can't connect to WiFi, move closer to the router or try restarting the script.
- AI missed a digit: Always glance at the "Preview CSV" table before downloading. You can edit the fields directly in the Web App before downloading.
use "rm debug_.html debug_.png" to remove debug files