Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Add --json to dvb plugin for timed front end stats. #1455

Open
SonnyWalkman opened this issue May 6, 2024 · 2 comments
Open

[FEAT] Add --json to dvb plugin for timed front end stats. #1455

SonnyWalkman opened this issue May 6, 2024 · 2 comments

Comments

@SonnyWalkman
Copy link

SonnyWalkman commented May 6, 2024

Is your feature request related to a problem?

No..

Proposed solution:

As with tsanalyse plugin the options to send reports via tcp and udp is perfect for remote monitoring. Is it possible to do the same for the input dvb plugin to cater for interval updates on frontend stats please? Lock, signal, Snr, BER? etc ? This would be super handy for my application.

Alternatives:

Alternate is to use demon to read fe however the stats are already called in verbose mode with tslstdvb. Add option example:- tsp -I dvb --interval 1000000000 --json-UDP --fe_stats

Additional information:

none

@lelegard
Copy link
Member

lelegard commented May 7, 2024

Hi @SonnyWalkman

Good idea. Therefore implemented right away...

$ tsp -I dvb --help
...
  --json-buffer-size value
      With --json-tcp or --json-udp, specify the network socket send buffer
      size in bytes.

  --json-interval seconds
      With --json-line, --json-tcp, --json-udp, specify the interval between
      two status reports. The default is 60 seconds.

  --json-line[='prefix']
      Produce a status report in JSON format at regular intervals. Report the
      JSON text as one single line in the message logger. The optional string
      parameter specifies a prefix to prepend on the log line before the JSON
      text to locate the appropriate line in the logs.

  --json-tcp ip-address:port
      Produce a status report in JSON format at regular intervals. Report the
      JSON text as one single line in a TCP connection. The address specifies
      an IP address or a host name that translates to an IP address. The port
      specifies the destination TCP port. By default, a new TCP connection is
      established each time a JSON message is produced. Be aware that a
      complete TCP connection cycle may introduce some latency in the
      processing. If latency is an issue, consider using --json-udp.

  --json-tcp-keep
      With --json-tcp, keep the TCP connection open for all JSON messages. By
      default, a new TCP connection is established each time a JSON message is
      produced.

  --json-udp ip-address:port
      Produce a status report in JSON format at regular intervals. Report the
      JSON text as one single line in a UDP datagram. The address specifies an
      IP address which can be either unicast or multicast. It can be also a
      host name that translates to an IP address. The port specifies the
      destination UDP port. Be aware that the size of UDP datagrams is limited
      by design to 64 kB. If larger JSON contents are expected, consider using
      --json-tcp.

  --json-udp-local ip-address
      With --json-udp, when the destination is a multicast address, specify the
      IP address of the outgoing local interface. It can be also a host name
      that translates to a local address.

  --json-udp-ttl value
      With --json-udp, specifies the TTL (Time-To-Live) socket option. The
      actual option is either "Unicast TTL" or "Multicast TTL", depending on
      the destination address. Remember that the default Multicast TTL is 1 on
      most systems.

These options are the same as in other tools or plugins such as analyze. The code to manage them and implement their logic is in a common C++ class. This is why it was rather straightforward to implement in the dvb plugin.

Sample JSON message (after reformatting through jq):

{
  "bandwidth": 8000000,
  "ber": "0%",
  "delivery-system": "DVB-T",
  "frequency": 482000000,
  "guard-interval": "1/32",
  "hierarchy": "none",
  "high-priority-fec": "auto",
  "low-priority-fec": "auto",
  "modulation": "64-QAM",
  "packet-index": 326720,
  "per": "0%",
  "signal-locked": true,
  "snr": "20.861 dB",
  "strength": "-29.342 dB",
  "time": "2024-05-07 21:15:22",
  "transmission-mode": "8K"
}

Note that the capability to report strength or SNR depends on the driver and OS. The message above was reported on Ubuntu using a Pinnacle PCTV 72e tuner. An Hauppauge Nova-T Stick on the same system was only able to report signal-locked, no strength, no SNR.

Let us know if it works for you.

@SonnyWalkman
Copy link
Author

SonnyWalkman commented May 7, 2024

Hi there @lelegard ,

Much appreciated.. I was using dvb and tsanalyse together and though only if!

I'll give it a shot after a rebuild from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants