msh100 / modem-stats

Process the channel diagnostics data from a DOCSIS modem for use in Telegraf or Prometheus
28 stars 4 forks source link

Upstream and Downstream rates reversed? (Superhub 3) #6

Closed irvsys closed 1 year ago

irvsys commented 1 year ago

Upstream and Downstream Traffic Rates reversed.

I am using a Virgin Media Superhub3 and the data rates for upstream and downstream seem to be reversed. I am using the Binary for modem-stats-arm5 on a Raspbery pi 4 (but I dont think that is the issue). The results are fed to a Telegraf instance and then on to Grafana.

I attach a screenshot of the SH3 modem status, which correctly shows the Upstream and Downstream rates (approx 270MB down and 26MB up).

The modem-stats (binary) returns these values reversed (see last couple of lines below).

ownstream,channel=22,id=29,modulation=QAM256,scheme=SC-QAM frequency=363000000,snr=403,power=-20,prerserr=44,postrserr=0 downstream,channel=23,id=30,modulation=QAM256,scheme=SC-QAM frequency=371000000,snr=403,power=-20,prerserr=21,postrserr=0 downstream,channel=24,id=31,modulation=QAM256,scheme=SC-QAM frequency=379000000,snr=403,power=-22,prerserr=18,postrserr=0 upstream,channel=1,id=2 frequency=43100000,power=445 upstream,channel=2,id=5 frequency=23600000,power=420 upstream,channel=3,id=4 frequency=30100039,power=430 upstream,channel=4,id=3 frequency=36600000,power=445 upstream,channel=5,id=1 frequency=49600000,power=445 config,config=upstream maxrate=287500061,maxburst=42600 config,config=downstream maxrate=27500061,maxburst=42600 shstatsinfo timems=1127

So when this comes into the Grafana screen, downstream and upstream rates are reversed in the GUI, though other measurements seem fine.

I also don't seem to get any results for PING's, despite having the PING_TARGETS environment variable set - but mabe that is not part of the compiled binary?

router-screenshot Grafana screen

I have learned a LOT so far this last couple of days putting the various bits of this together - THANKS in advance and apologies if I am missing something obvious.

Bob

msh100 commented 1 year ago

How odd! Can you send me the contents of http://192.168.100.1/getRouterStatus (or whatever the SH IP is?)?

Feel free to send that privately to hello@this username.uk

UhtredTheBold commented 1 year ago

I set this up yesterday and I noticed the same problem (SH3). Do you still need the contents of getrouterstatus? I can provide if not

irvsys commented 1 year ago

I sent the log file by PM. Bob

msh100 commented 1 year ago

Thanks for that @irvsys, I have received it. I have been unable to check these past few days but I will try to look into it after work today.

@UhtredTheBold if you could email me over the router status page anyway, that'd be great, then I can confirm whatever I do works for you too.

msh100 commented 1 year ago

I have pushed a potential fix. 64f1c443c53811261bdcf43ff37b1416e4b8d623

Can you try the dev binary and let me know? AMD64 https://b2.msh100.uk/file/modem-stats/modem-stats.dev.x86 ARM5 https://b2.msh100.uk/file/modem-stats/modem-stats.dev.arm5

UhtredTheBold commented 1 year ago

yes, works a treat :)

Thank you

irvsys commented 1 year ago

I concur. Updated Modem-stats works fine. I will figure out the PING separately with Telegraf.

Thanks!

msh100 commented 1 year ago

Thanks for both of your help! I have merged to main and the image and binaries have been updated