mirror of
https://github.com/fairwaves/UHD-Fairwaves.git
synced 2025-11-03 13:33:15 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1e80e5c27 | ||
|
|
014e8123a3 | ||
|
|
16bc2bdd18 | ||
|
|
9cf7377866 |
12
debian/changelog
vendored
12
debian/changelog
vendored
@@ -1,3 +1,15 @@
|
|||||||
|
umtrx (1.0.10) trusty; urgency=low
|
||||||
|
|
||||||
|
* collectd: rewritten counter collection plugin
|
||||||
|
|
||||||
|
-- Kirill Zakharenko <earwin@gmail.com> Mon, 21 Mar 2016 19:21:00 +0100
|
||||||
|
|
||||||
|
umtrx (1.0.9) trusty; urgency=low
|
||||||
|
|
||||||
|
* collectd: osmo-nitb counter collection plugin
|
||||||
|
|
||||||
|
-- Kirill Zakharenko <earwin@gmail.com> Mon, 24 Feb 2016 19:35:56 +0300
|
||||||
|
|
||||||
umtrx (1.0.8) trusty; urgency=low
|
umtrx (1.0.8) trusty; urgency=low
|
||||||
|
|
||||||
* host: integrate support class for umsel2
|
* host: integrate support class for umsel2
|
||||||
|
|||||||
4
debian/umtrx.install
vendored
4
debian/umtrx.install
vendored
@@ -2,3 +2,7 @@ usr/bin
|
|||||||
images/u2plus_umtrx_v2.bin images/umtrx_txrx_uhd.bin usr/share/umtrx/firmware
|
images/u2plus_umtrx_v2.bin images/umtrx_txrx_uhd.bin usr/share/umtrx/firmware
|
||||||
host/utils/umtrx_property_tree.py host/utils/umtrx_vswr.py usr/share/umtrx
|
host/utils/umtrx_property_tree.py host/utils/umtrx_vswr.py usr/share/umtrx
|
||||||
host/utils/umtrx_query_sensors.py host/utils/umtrx_query_versions.py host/utils/umtrx_net_burner.py usr/share/umtrx
|
host/utils/umtrx_query_sensors.py host/utils/umtrx_query_versions.py host/utils/umtrx_net_burner.py usr/share/umtrx
|
||||||
|
|
||||||
|
host/utils/collectd/umtrx.types.db usr/share/collectd
|
||||||
|
host/utils/collectd/umtrx2collectd.py usr/share/umtrx
|
||||||
|
host/utils/collectd/umtrx.conf etc/collectd/collectd.conf.d
|
||||||
|
|||||||
6
host/utils/collectd/umtrx.conf
Normal file
6
host/utils/collectd/umtrx.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
TypesDB "/usr/share/collectd/umtrx.types.db"
|
||||||
|
|
||||||
|
LoadPlugin exec
|
||||||
|
<Plugin exec>
|
||||||
|
Exec "fairwaves:fairwaves" "/usr/share/umtrx/umtrx2collectd.py"
|
||||||
|
</Plugin>
|
||||||
1
host/utils/collectd/umtrx.types.db
Normal file
1
host/utils/collectd/umtrx.types.db
Normal file
@@ -0,0 +1 @@
|
|||||||
|
sensor value:GAUGE:U:U
|
||||||
54
host/utils/collectd/umtrx2collectd.py
Executable file
54
host/utils/collectd/umtrx2collectd.py
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/python -u
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sched, time
|
||||||
|
|
||||||
|
from umtrx_property_tree import umtrx_property_tree
|
||||||
|
from umtrx_vswr import umtrx_vswr
|
||||||
|
|
||||||
|
BOARD_ID = "0"
|
||||||
|
SENSORS_PATH = "/mboards/{id}/sensors".format(id=BOARD_ID)
|
||||||
|
VSWR_CALIBRATION = 0 # = TM10_VSWR_cal
|
||||||
|
|
||||||
|
HOSTNAME = os.environ['COLLECTD_HOSTNAME'] if 'COLLECTD_HOSTNAME' in os.environ else 'localhost'
|
||||||
|
INTERVAL = os.environ['COLLECTD_INTERVAL'] if 'COLLECTD_INTERVAL' in os.environ else '60'
|
||||||
|
|
||||||
|
umtrx = umtrx_property_tree()
|
||||||
|
umtrx.connect()
|
||||||
|
|
||||||
|
# typically this yields: ['tempA', 'tempB', 'voltagePR1', 'voltagePF1', 'voltagePR2', 'voltagePF2', 'voltagezero', 'voltageVin', 'voltageVinPA', 'voltageDCOUT']
|
||||||
|
sensors_list = umtrx.list_path_raw(SENSORS_PATH).get("result", [])
|
||||||
|
|
||||||
|
|
||||||
|
def publish():
|
||||||
|
now = time.time()
|
||||||
|
|
||||||
|
current_sensors = {sensor: umtrx.query_sensor_value(SENSORS_PATH + "/" + sensor) for sensor in sensors_list}
|
||||||
|
|
||||||
|
for channel in ["1", "2"]:
|
||||||
|
vpf_name = "voltagePF" + channel
|
||||||
|
vpr_name = "voltagePR" + channel
|
||||||
|
|
||||||
|
if vpf_name in current_sensors and vpr_name in current_sensors:
|
||||||
|
vswr = umtrx_vswr(float(current_sensors[vpf_name]), float(current_sensors[vpr_name]), VSWR_CALIBRATION)
|
||||||
|
current_sensors["VSWR" + channel] = vswr.vswr()
|
||||||
|
current_sensors["ReturnLoss" + channel] = vswr.return_loss()
|
||||||
|
|
||||||
|
for name, value in current_sensors.items():
|
||||||
|
print "PUTVAL {host}/umtrx-{id}/sensor-{name} interval={interval} {now}:{value}".format(
|
||||||
|
host=HOSTNAME, id=BOARD_ID, name=name, interval=INTERVAL, now=now, value=value)
|
||||||
|
|
||||||
|
|
||||||
|
s = sched.scheduler(time.time, time.sleep)
|
||||||
|
|
||||||
|
|
||||||
|
def timer_loop():
|
||||||
|
s.enter(float(INTERVAL), 1, timer_loop, ())
|
||||||
|
publish()
|
||||||
|
|
||||||
|
|
||||||
|
timer_loop()
|
||||||
|
s.run()
|
||||||
|
|
||||||
|
umtrx.close()
|
||||||
Reference in New Issue
Block a user