PHP Classes

PHP Docsis Config of Cable Modem: Query cable modem configuration via SMNP

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 80 All time: 10,096 This week: 66Up
Version License PHP version Categories
cable-modem-tx-basic 1.0.0BSD License5Networking, PHP 5, Configuration, Har...


This class can query cable modem configuration via SMNP.

It sends SNMP requests to a cable modem to retrieve its configuration values.

Currently it can retrieve configuration values like TX, RX, SNR and firmware version.

Innovation Award
PHP Programming Innovation award nominee
January 2017
Number 18
DOCSIS (Data Over Cable Service Interface Specification) is standard specification that defines how data can be transmitted over cable TV systems.

This package can query several aspects of the configuration of a cable modem using DOCSIS specification using SNMP queries.

Manuel Lemos
Picture of Fernando André
Name: Fernando André is available for providing paid consulting. Contact Fernando André .
Classes: 5 packages by
Country: Portugal Portugal
Age: 41
All time rank: 124416 in Portugal Portugal
Week rank: 276 Up3 in Portugal Portugal Up
Innovation award
Innovation award
Nominee: 2x


require 'Docsismodem.php';

$pdo = new PDO(

if (
array_key_exists("macaddr", $_GET)) {
$mac = $_GET['macaddr'];
$mac = str_replace(":", "", $mac);
$mac = str_replace(".", "", $mac);
} else {
$mac = "";

// This get's me the last ip commited to the cable modem
// I use it to know where the CM lives
// Also one can use reverse DNS if your networking is using such a thing
// check PEAR packages for DNS Queries
$sql = "SELECT macaddr, lastip, serialnum FROM docsismodem WHERE macaddr = ? ";
$sth = $pdo->prepare($sql);

$a = null;
foreach (
$sth->fetchAll(PDO::FETCH_CLASS) as $modem ) {
$dm = new DM_Model_Docsismodem();
$dm->ipaddr = $modem->lastip;
$dm->macaddr = $modem->macaddr;
$a = $dm->remoteQuery();

    <title>TX Information page, <?php print $modem->macaddr ?></title>
    <LINK href="bluedream.css" rel="stylesheet" type="text/css">
    <td><?php print $modem->macaddr ?> , IP: <?php print $a['ip'] ?></td>
    <td><?php print ($a['tx']/10) ?></td>
    <td><?php print ($a['snr']/10) ?></td>
    <td><?php print ($a['rx']/10) ?></td>
    <td><b>firmware version</b></td>
    <td><?php print $a['version'] ?></td>
    <form action="" method="get" name="p">
        <input type="text" name="macaddr" value="<?php print $mac ?>" />
        <input type="submit" value="Ver" />


Simple webpage and PHP class to get cable modem information via SNMP Requires a docsisserver style docsismodem database to work but if you use dynamic DNS with isc DHCP you can use the PEAR Package for DNS Queries for name to IP resolution in my case I used the commited "hook" from isc dhcp server.

  Files folder image Files  
File Role Description
Accessible without login Plain text file bluedream.css Data Auxiliary data
Plain text file Docsismodem.php Class Class source
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file README Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,096
This week:66Up