Skip to content

Docker Container for pydtm (Python (Euro)DOCSIS (3.0) Traffic Meter)

License

Notifications You must be signed in to change notification settings

foorschtbar/pydtm-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Image for pydtm

Docker Container for pydtm (Python (Euro)DOCSIS (3.0) Traffic Meter). This tool uses a DVB-C capable video card (e.g. a cheap USB stick) to measure the EuroDOCSIS 3.0 traffic per frequency, allowing you to send the measurements to a InfluxDB and visualize your local segment's utilization with Grafana.

Example

Configuration

Configure pydtm by specifying environment variables:

Name Default Description
PYDTM_DEBUG (none) Create variable to enable debug logging
PYDTM_ADAPTER 0 Use /dev/dvb/adapterN devices
PYTDM_TUNER 0 Use adapter's frontendN/dmxN/dvrN devices
PYDTM_FREQUENCIES 114:256 A list of 'frequency' or 'frequency:modulation'-pairs
PYDTM_STEP 60 Metrics backend default resolution in seconds
PYDTM_LOCKTIME 1 Locktime for frontend in sec.
PYDTM_INTERVAL 300 Amount of seconds to wait between each scan cycle
PYDTM_INFLUXDB_HOST localhost Address of influxdb
PYDTM_INFLUXDB_PORT 8086 Port of influxdb
PYDTM_INFLUXDB_TLS (none) Create variable to enable TLS for connection
PYDTM_INFLUXDB_USERNAME influx Username for influxdb
PYDTM_INFLUXDB_PASSWORD (none) Password for influxdb
PYDTM_INFLUXDB_DATABASE pydtm Database name for influxdb

Usage

Example docker-compose configuration:

version: "3"

services:
  awtrix:
    image: foorschtbar/pydtm
    restart: unless-stopped
    devices:
      - "/dev/dvb"
    environment:
      - PYDTM_FREQUENCIES=114:256,130:256,138:256,146:256,602:256,618:256,626:256,642:256,650:256,658:256,666:256,674:256,682:256,690:256,698:64,706:64,714:64,722:64,730:64,738:64,746:64,754:64,762:64,770:64,778:64,786:64,794:64,802:64,810:64,818:64,826:64,834:64
      - PYDTM_INFLUXDB_HOST=influxdb.local
      - PYDTM_INFLUXDB_PORT=8086
      - PYDTM_INFLUXDB_USERNAME=influx
      - PYDTM_INFLUXDB_PASSWORD=changeme
      #- PYDTM_INFLUXDB_DATABASE=pydtm
      #- PYDTM_LOCKTIME=1
      #- PYDTM_ADAPTER=0
      #- PYDTM_DEBUG=True
      #- PYDTM_STEP=60
      #- PYDTM_TUNER=0
      #- PYDTM_INTERVAL=300

FAQ

How and why does this even work?

EuroDOCSIS 3.0 uses standard DVB-C mechanisms to transport it's data: It's encoded as a standard MPEG Transport Stream on PID 8190 with either 64- or 256-QAM modulation with a symbol rate of 6952ksyms/s. Since cable is a shared medium, determining the total amount of data transferred and comparing this to the total amount possible after FEC (which is about 51Mbit/s for 256-QAM and 34 MBit/s for 64-QAM) will show you how much capacity is used.

How do I determine downstream frequencies?

Take a look at your cable modem's management pages.

Wait, I can read my neighbours data with this?

No, you can't.

This is downstream only, right?

Yes.

Recommendation for a DVB-C usb tuner?

Yes, the Xbox One Digital TV Tuner works very well and is cheap. For the Xbox One Digital TV Tuner copy the two firmware files from the firmware in this repo folder to the /lib/firmware folder on the Docker HOST. Attach the tuner and check kernel log with dmsg.

Working example:

dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold state, will try to load a firmware
dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw'
dib0700: firmware started successfully.
dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in warm state.
dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
dvbdev: DVB: registering new adapter (Microsoft Xbox One Digital TV Tuner)
usb 1-1.4: media controller created
dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered.
mn88472 11-0018: Panasonic MN88472 successfully identified
tda18250 11-0060: NXP TDA18250BHN/M successfully identified
usb 1-1.4: DVB: registering adapter 0 frontend 0 (Panasonic MN88472)...
dvbdev: dvb_create_media_entity: media entity 'Panasonic MN88472' registered.
dvb-usb: Microsoft Xbox One Digital TV Tuner successfully initialized and connected.
[...]
mn88472 11-0018: downloading firmware from file 'dvb-demod-mn88472-02.fw'

Credits

The Container is based on cite/pydtm from Stefan Förster

About

Docker Container for pydtm (Python (Euro)DOCSIS (3.0) Traffic Meter)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published