This is a project to automate the control of MY ROUTER using Puppeteer and Express. This code should be adapted if you want to use it with other devices.
- Power on the router: The "Turn On" button sends a request to the
/turnon
route, executing the code to power on the router. - Power off the router: The "Turn Off" button sends a request to the
/turnoff
route, executing the code to power off the router.
- Node.js (v12 or higher)
- Clone the repository:
git clone https://github.com/your-username/automated-router-control.git
- Install the dependencies:
cd automated-router-control
npm install
- Create a
.env
file in the project root with the following environment variables:
URL=http://192.168.0.1/tcpipwan.htm
USERNAME=
PASSWORD=
- Make sure to adjust the information in the
.env
file according to your router.
- Start the server:
npm start
-
Access the application in your browser at
http://localhost:3000
. -
Click on the "Turn On" or "Turn Off" button to control the router.
Contributions are welcome! If you find any issues, have suggestions, or want to add a new feature, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.