Sign inSign up

agusalex/modem_reboot

By agusalex

•Updated over 5 years ago

Reboot modem on a schedule using puppeteer, add your script for your own make and model.

Image
0

3.7K

agusalex/modem_reboot repository overview

⁠ModemReboot

Docker Hub package

Puppeteer container for rebooting Modems

⁠Modem List:

Set this as your SCRIPT Env var

ModemSCRIPT
Technicolor CGA4233TCH3 modem (Fibertel)example.js
Arris (Modem Undefined)arris.js
Mitrastar 2541GNA (Movistar)Movistar_Mitrastar_2541GNAC.js
ZTE_MF258ZTE_MF258.js

By default will run example.js you can change that by setting SCRIPT parameter.

⁠Environmental Variables

VariableDescription
URLModem URL (for example http://192.168.0.1/⁠ )
USERModem USER
PASSModem Password
SCRIPTModem Model js Script
CRONCron Schedule⁠

⁠Running

If your modem is already supported, run this container with these ENV options :

docker run -it -e URL=URL -e USER=USER -e PASS=PASS -e SCRIPT=yourModem.js -e CRON="* * * * *" agusalex/modemReboot

Otherwise see the next section

⁠Configuring it for your own modem model

To debug with your particular modem first install nodeJs then install dependencies:

npm install puppeteer date-and-time is-docker

And run it: node app.js

Finally when you have it ready, make a PR or create an Issue with your script and I will add it.

If you want to build your own docker container thats easy too:

docker build -t "myModemRebooter" .

docker run -it -e URL=URL -e USER=USER -e PASS=PASS -e SCRIPT=yourModem.js -e CRON="* * * * *" myModemRebooter

⁠Tips

Open the developer tools in the browser, inspect element click it and get the ID then you can use it.

For example login-button is the id of the button:

const form = await page.$('#login-button'); await form.evaluate( form => form.click() );

If the element does not have an ID, after inspecting it right click on the DOM of the element and select Copy Selector

Then you can use it like so:

cpage.click( "OUTPUT FROM COPY SELECTOR" )

More info in https://pptr.dev/⁠

⁠Future Work

In order for this to be usefull we need as many Modem models scripts as possible, this cant be done without the help of others

Tag summary

Content type

Image

Digest

Size

225.9 MB

Last updated

over 5 years ago

docker pull agusalex/modem_reboot