14 Commits

Author SHA1 Message Date
Kirill Zakharenko
c9304575bf bumped version to 1.0.16 2019-07-03 21:17:31 +03:00
Kirill Zakharenko
61ac2ee278 umtrx_cal_*: fix for abrupt termination
tx_thread creates a child thread, which it join()s on, when terminating
calling interrupt() on tx_thread interferes with the join()
so we replace interrupt() with an atomic flag

(not sure how this worked before)
2019-07-03 21:17:31 +03:00
Kirill Zakharenko
7199b8667f boost: use minimally required build Boost dependencies
speeds up clean builds
2019-07-03 21:17:31 +03:00
Kirill Zakharenko
91185de06a util: install python utils directly into /usr/bin 2019-07-03 21:17:30 +03:00
Kirill Zakharenko
99d1b8adf3 utils: move umtrx python libraries to PYTHONPATH 2019-07-03 21:17:30 +03:00
Kirill Zakharenko
b81240db26 utils: remove collectd integration, it belongs in another package 2019-07-03 21:17:30 +03:00
Kirill Zakharenko
0d0f0c710c debian: Update deb deps to bionic 2019-07-03 21:17:30 +03:00
sergforce
f528fa442f Merge pull request #23 from pespin/pespin/fix-build
umtrx_monitor.cpp: Fix compilation against newer boost
2018-04-22 18:41:38 +03:00
Pau Espin Pedrol
132f8995ec umtrx_monitor.cpp: Fix compilation against newer boost
Related: github issue #22
2018-04-21 15:23:42 +02:00
satunnainen
93d4343d85 bump version to 1.0.15 2017-08-15 03:04:15 +03:00
Alexander Chemeris
1421327cfe host: Python 2 compatibility for umtrx_property_tree.py
bytes(u'something', 'utf-8') is only available in Python 3. A backwards
compatible version of it is u'something'.encode('utf-8').
2017-08-14 23:46:06 +03:00
Alexander Chemeris
1e0c879f53 utils: s/USRP/UmTRX/g in console output of umtrx_net_burner.py 2017-08-08 21:34:51 +03:00
satunnainen
479d6e9cf6 bump version to 1.0.14 2017-08-07 10:35:28 +03:00
Alexander Chemeris
4bba18b1cf host: Fix build. 2017-08-04 18:44:55 +03:00
18 changed files with 51 additions and 87 deletions

23
debian/changelog vendored
View File

@@ -1,3 +1,26 @@
umtrx (1.0.16) bionic; urgency=medium
* first bionic build
* python libraries are now in PYTHONPATH and reusable
* minimized Boost build deps for faster builds
* dropped collectd integration
* fixed abrupt termination of umtrx_cal_*
-- Kirill Zakharenko <earwin@gmail.com> Wed, 19 Jun 2019 13:39:48 +0300
umtrx (1.0.15) trusty; urgency=medium
* host: Python 2 compatibility for umtrx_property_tree.py
* utils: s/USRP/UmTRX/g in console output of umtrx_net_burner.py
-- Rauf Gyulaliev <rauf.gyulaliev@fairwaves.co> Tue, 15 Aug 2017 03:03:23 +0300
umtrx (1.0.14) trusty; urgency=medium
* Quick build fix.
-- Rauf Gyulaliev <rauf.gyulaliev@fairwaves.co> Mon, 07 Aug 2017 09:15:31 +0300
umtrx (1.0.13) trusty; urgency=low
* [ZPU/host] Read TCXO DAC calibration from EEPROM once on UmTRX boot instead

2
debian/compat vendored
View File

@@ -1 +1 @@
9
11

8
debian/control vendored
View File

@@ -3,9 +3,13 @@ Section: libs
Priority: optional
Maintainer: Josh Blum <josh@pothosware.com>
Build-Depends:
debhelper (>= 9.0.0),
debhelper (>= 11.0.0),
cmake (>= 2.8),
libboost-all-dev,
libboost-date-time-dev,
libboost-filesystem-dev,
libboost-system-dev,
libboost-thread-dev,
libboost-program-options-dev,
libuhd-dev (>= 3.7)
Standards-Version: 3.9.5
Homepage: http://umtrx.org/

View File

@@ -1,8 +1,3 @@
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
host/utils/umtrx_property_tree.py host/utils/umtrx_vswr.py usr/lib/python2.7/dist-packages

3
debian/umtrx.links vendored
View File

@@ -1,3 +0,0 @@
/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

@@ -741,7 +741,7 @@ umtrx_impl::umtrx_impl(const device_addr_t &device_addr)
}
//TCXO DAC calibration control
if (not tcxo_dac.empty()) _tree->create<uint16_t>(mb_path / "tcxo_dac" / "value")
_tree->create<uint16_t>(mb_path / "tcxo_dac" / "value")
.subscribe(boost::bind(&umtrx_impl::set_tcxo_dac, this, _iface, _1));
////////////////////////////////////////////////////////////////////

View File

@@ -118,7 +118,7 @@ void umtrx_impl::status_monitor_handler(void)
void umtrx_impl::server_query_handler(void)
{
//accept the client socket (timeout is 100 ms, task is called again)
if (not wait_read_sockfd(_server_query_tcp_acceptor->native(), 100)) return;
if (not wait_read_sockfd(_server_query_tcp_acceptor->native_handle(), 100)) return;
boost::shared_ptr<asio::ip::tcp::socket> socket(new asio::ip::tcp::socket(_server_query_io_service));
_server_query_tcp_acceptor->accept(*socket);

View File

@@ -6,6 +6,9 @@ INSTALL(PROGRAMS
umtrx_gps_coord
umtrx_auto_calibration
umtrx_firmware
umtrx_net_burner
umtrx_query_sensors
umtrx_query_versions
DESTINATION bin
)

View File

@@ -1,6 +0,0 @@
TypesDB "/usr/share/collectd/umtrx.types.db"
LoadPlugin exec
<Plugin exec>
Exec "fairwaves-monitoring" "/usr/share/umtrx/umtrx2collectd.py"
</Plugin>

View File

@@ -1 +0,0 @@
sensor value:GAUGE:U:U

View File

@@ -1,54 +0,0 @@
#!/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.lower(), 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()

View File

@@ -18,6 +18,7 @@
#include "usrp_cal_utils.hpp"
#include <uhd/utils/safe_main.hpp>
#include <boost/ref.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <boost/math/special_functions/round.hpp>
@@ -342,8 +343,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);
//create a transmitter thread
std::atomic<bool> interrupted(false);
boost::thread_group threads;
threads.create_thread(boost::bind(&tx_thread, usrp, tx_wave_freq, tx_wave_ampl));
threads.create_thread(boost::bind(&tx_thread, usrp, tx_wave_freq, tx_wave_ampl, boost::ref(interrupted)));
//store the results here
std::vector<result_t> results;
@@ -403,7 +405,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << std::endl;
//stop the transmitter
threads.interrupt_all();
interrupted = true;
threads.join_all();
if (not vm.count("single_test"))

View File

@@ -18,6 +18,7 @@
#include "usrp_cal_utils.hpp"
#include <uhd/utils/safe_main.hpp>
#include <boost/ref.hpp>
#include <boost/program_options.hpp>
#include <boost/math/special_functions/round.hpp>
#include <iostream>
@@ -83,8 +84,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);
//create a transmitter thread
std::atomic<bool> interrupted(false);
boost::thread_group threads;
threads.create_thread(boost::bind(&tx_thread, usrp, tx_wave_freq, tx_wave_ampl));
threads.create_thread(boost::bind(&tx_thread, usrp, tx_wave_freq, tx_wave_ampl, boost::ref(interrupted)));
//re-usable buffer for samples
std::vector<samp_type> buff;
@@ -177,7 +179,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << std::endl;
//stop the transmitter
threads.interrupt_all();
interrupted = true;
threads.join_all();
store_results(usrp, results, "tx", "iq", vm.count("append"));

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python
#
# Copyright 2010-2011 Ettus Research LLC
# Copyright 2013-2017 Fairwaves, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,10 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: make it autodetect UHD devices
import optparse
import math
import os
import re
import struct
@@ -495,7 +493,7 @@ class burner_socket(object):
########################################################################
def get_options():
parser = optparse.OptionParser()
parser.add_option("--addr", type="string", help="USRP-N2XX device address", default='')
parser.add_option("--addr", type="string", help="UmTRX device address", default='')
parser.add_option("--fw", type="string", help="firmware image path (optional)", default='')
parser.add_option("--fpga", type="string", help="fpga image path (optional)", default='')
parser.add_option("--reset", action="store_true", help="reset the device after writing", default=False)
@@ -527,7 +525,7 @@ if __name__=='__main__':
if options.overwrite_safe and not options.read:
print("Are you REALLY, REALLY sure you want to overwrite the safe image? This is ALMOST ALWAYS a terrible idea.")
print("If your image is faulty, your USRP2+ will become a brick until reprogrammed via JTAG.")
print("If your image is faulty, your UmTRX will become a brick until reprogrammed via JTAG.")
response = raw_input("""Type "yes" to continue, or anything else to quit: """)
if response != "yes": sys.exit(0)

View File

@@ -26,7 +26,7 @@ class umtrx_property_tree:
d = dict(action=action, path=path)
if value_type is not None: d['type'] = value_type
if value is not None: d['value'] = value
return self.s.send(bytes(json.dumps(d)+'\n', 'UTF-8'))
return self.s.send((json.dumps(d)+'\n').encode('UTF-8'))
def _recv_response(self):
resp = self.f.readline().strip()

View File

@@ -31,6 +31,7 @@
#include <complex>
#include <cmath>
#include <fstream>
#include <atomic>
namespace fs = boost::filesystem;
@@ -227,7 +228,7 @@ static void capture_samples(
/***********************************************************************
* Transmit thread
**********************************************************************/
static void tx_thread(uhd::usrp::multi_usrp::sptr usrp, const double tx_wave_freq, const double tx_wave_ampl){
static void tx_thread(uhd::usrp::multi_usrp::sptr usrp, const double tx_wave_freq, const double tx_wave_ampl, std::atomic<bool> &interrupted){
uhd::set_thread_priority_safe();
//create a transmit streamer
@@ -246,7 +247,7 @@ static void tx_thread(uhd::usrp::multi_usrp::sptr usrp, const double tx_wave_fre
wave_table table(tx_wave_ampl);
//fill buff and send until interrupted
while (not boost::this_thread::interruption_requested()){
while (not interrupted){
for (size_t i = 0; i < buff.size(); i++){
buff[i] = table(index += step);
}