6 Commits

Author SHA1 Message Date
Kirill Zakharenko
16bc2bdd18 bump version to 1.0.9 2016-02-27 20:52:08 +03:00
Kirill Zakharenko
9cf7377866 collectd: plugin to collect umtrx sensors 2016-02-26 17:52:07 +03:00
Kirill Zakharenko
a4568b4704 bumped version to 1.0.8 2015-12-28 15:15:16 +03:00
Kirill Zakharenko
b24a4d0bb8 Merge branch 'earwin/pythonpack' 2015-12-28 15:05:57 +03:00
Kirill Zakharenko
dc5718daea bumped version to 1.0.7 2015-12-28 15:02:06 +03:00
Kirill Zakharenko
25394541fa debian: packaged python utils in host/utils 2015-12-28 15:01:29 +03:00
8 changed files with 130 additions and 1 deletions

34
debian/changelog vendored
View File

@@ -1,3 +1,37 @@
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
* host: integrate support class for umsel2
* host: integrate support class for umsel2
* host: implement selection for umsel2 + lms
* host: umsel2 register work for adf355-2
* host: umsel2 adf355-2 tuning algorithm
* host: freq update sequence, copied registers from gui
* host: print locked for debugging
* umsel: device args for enabling umsel2 and verbose
* add lmsvga1 device args parameter to override VGA1_DEF
* autodetect DCDC translation version on startup
* add lmsvga2 args parameter to override UMTRX_VGA2_DEF
* turn off vin bypass to amplifiers by default
* throw exception if incorrect DCDC version were provided
-- Kirill Zakharenko <earwin@gmail.com> Mon, 28 Dec 2015 15:07:56 +0300
umtrx (1.0.7) trusty; urgency=low
* host: Properly handle most corner cases in VSWR calculations
* host: Add "STRING" to umtrx_monitor error output
* host: Add string getters/setters to the Python property tree library
* host: Checking in umtrx_query_versions.py
* debian: packaged python utils in host/utils
-- Kirill Zakharenko <earwin@gmail.com> Mon, 25 Dec 2015 19:35:56 +0100
umtrx (1.0.6) trusty; urgency=low
* host: make boost property tree thread safe

View File

@@ -1,2 +1,8 @@
usr/bin
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_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

3
debian/umtrx.links vendored Normal file
View File

@@ -0,0 +1,3 @@
/usr/share/umtrx/umtrx_net_burner.py /usr/bin/umtrx_net_burner
/usr/share/umtrx/umtrx_query_sensors.py /usr/bin/umtrx_query_sensors
/usr/share/umtrx/umtrx_query_versions.py /usr/bin/umtrx_query_versions

View File

@@ -2,7 +2,6 @@
# Build and Install the UmTRX utils
########################################################################
INSTALL(PROGRAMS
umtrx_net_burner
umtrx_nmea
umtrx_gps_coord
umtrx_auto_calibration

View 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>

View File

@@ -0,0 +1,5 @@
Voltages1 PR1:GAUGE:0:32, PR2:GAUGE:0:32, PF1:GAUGE:0:32, PF2:GAUGE:0:32
Voltages2 Zero:GAUGE:0:32, Vin:GAUGE:0:32, VinPA:GAUGE:0:32, DCOUT:GAUGE:0:32
Temperature A:GAUGE:-40:120, B:GAUGE:-40:120
ReturnLoss C1:GAUGE:0:32, C2:GAUGE:0:32
VSWR C1:GAUGE:0:32, C2:GAUGE:0:32

View File

@@ -0,0 +1,76 @@
#!/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
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()
sensors_path = "/mboards/0/sensors"
res = umtrx.list_path_raw(sensors_path)
# ['tempA', 'tempB', 'voltagePR1', 'voltagePF1', 'voltagePR2', 'voltagePF2', 'voltagezero', 'voltageVin', 'voltageVinPA', 'voltageDCOUT']
sensors_list = res.get('result', [])
# Voltages1 PR1:GAUGE:0:32, PR2:GAUGE:0:32, PF1:GAUGE:0:32, PF2:GAUGE:0:32
# Voltages2 Zero:GAUGE:0:32, Vin:GAUGE:0:32, VinPA:GAUGE:0:32, DCOUT:GAUGE:0:32
# Temperature A:GAUGE:-40:120, B:GAUGE:-40:120,
# ReturnLoss C1:GAUGE:0:32, C2:GAUGE:0:32
# VSWR C1:GAUGE:0:32, C2:GAUGE:0:32
def publish_set(name, values):
res = [HOSTNAME, name, INTERVAL]
res.extend(values)
src = "PUTVAL \"%s/UmTRX/%s\" interval=%s N:" + ":".join(["%s"] * len(values))
print src % tuple(res)
def publish():
sets = {'Voltages1': ['VoltagePR1', 'VoltagePR2', 'VoltagePF1', 'VoltagePF2'],
'Voltages2': ['Voltagezero', 'VoltageVin', 'VoltageVinPA', 'VoltageDCOUT'],
'Temperature': ['TempA', 'TempB'], 'VSWR': ['Channel_1_VSWR', 'Channel_2_VSWR'],
'ReturnLoss': ['Channel_1_ReturnLoss', 'Channel_2_ReturnLoss']}
current_sensors = {}
for sensor in sensors_list:
sensor_data = umtrx.query_sensor_raw(sensors_path + "/" + sensor)['result']
current_sensors[sensor_data['name']] = sensor_data['value']
# vswr_calibration = TM10_VSWR_cal
vswr_calibration = 0
for num in [1, 2]:
vpr_name = 'voltagePR' + str(num)
vpf_name = 'voltagePF' + str(num)
if vpr_name in sensors_list and vpf_name in sensors_list:
vpr = float(umtrx.query_sensor_value(sensors_path + '/' + vpr_name))
vpf = float(umtrx.query_sensor_value(sensors_path + '/' + vpf_name))
vswr = umtrx_vswr(vpf, vpr, vswr_calibration)
current_sensors['Channel_%d_VSWR' % num] = vswr.vswr()
current_sensors['Channel_%d_ReturnLoss' % num] = vswr.return_loss()
for key, values in sets.iteritems():
publish_set(key, [current_sensors[name] for name in values])
s = sched.scheduler(time.time, time.sleep)
def timer_loop():
s.enter(float(INTERVAL), 1, timer_loop, ())
publish()
timer_loop()
s.run()
umtrx.close()