Cable Modem Restarter (Turn Off & On )

How to check Internet connectivity of a DOCSIS 2.0 cable modem and restart it with an ESP8266 (WEMOS D1 Mini) ?

Similar projects worth following
I 'm using an old DOCSIS 2.0 cable modem (CXC-150) with a wireless router. Nowadays it starts to disconnect from Internet (because of the DOCSIS 3.0 infrastructure) and does not reconnect until it is turned off & on for 2-3 times. I don't want to buy a new one, so need to check Internet connectivity and turn off & on the modem automaticly. I decided to use an ESP8266 (WEMOS D1 Mini) with a relay module and Arduino Software IDE to upload the program.

You can monitor the ESP8266 status on Arduino IDE with Serial Monitor under Tools menu.

ESP8266 will use for the host address and  D1 PIN for the relay module connection.

It will turn off the onboard led and wait for 30 seconds after the boot.

Connect to the WiFi with your SSID and Password and check the host address

If it is connected:

  • Turn the onboard led on,
  • Stop the client
  • Wait 30 seconds for the next connection

If it is not connected:

  • Send a HIGH signal to relay module to power off the cable modem
  • Wait 3 seconds
  • Power it on again
  • Wait 30 seconds for the next connection

If there are two connection errors ESP8266 will reboot again.

ESP8266 wifi client sketch file for Arduino IDE to restart the cable modem.

Zip Archive - 1.21 kB - 10/28/2020 at 10:10


  • 1 × ESP8266 (WEMOS D1 Mini) To check Internet connectivity and control the relay
  • 1 × Relay shield for WEMOS D1 Mini To turn off & on cable modem
  • 1 × YwRobot power supply To power WEMOS D1 Mini and relay shield directly with 5V
  • 1 × Double side coopper prototype PCB Electronic Components / Misc. Electronic Components
  • 1 × Jumper Wires

View all 7 components

  • 1
    Setting up ESP32 and relay module

    1. ESP8266 WiFi chip installation on Arduino IDE and sketch file

    You need to first install Arduino Sofware (

    I modified the WifiClientBasic example under the File >> Examples >> Examples for LOLIN (WEMOS D1 R2 & Mini)>> ESP8266WiFi menu. Change the SSID and Password in sketch and upload it to the ESP8266 board.

    2. Connect +5V and GND pins of YwRobot to WEMOS D1 Mini then connect the ESP8266 PINs to relay module:

    • 5V to 5V PIN
    • GND to GND PIN
    • D1 to D1 PIN (Signal PIN for relay)

    3. Connect the jumper cables to DC power jack supply sockets:

    • Connect YwRobot DC-in +PIN to the middle socket (Common PIN) of the relay with red a cable.
    • Connect NC (Normally Closed) PIN of relay module to the +12V out header.
    • Connect YwRobot DC-in -PIN to the -12V out header.

    4. Connect the power cables.

    • Plug the 12V adapter power cable to female power jack socket on the YwRobot.
    • Plug the 12V out cable to the modem power socket.

View all instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates