aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_hwd.py
Commit message (Collapse)AuthorAgeFilesLines
* sim: Integrate simulator into UHDSamuel O'Brien2020-10-281-2/+14
| | | | | | | | | This commit adds a device::register_device which allows uhd to start up a simulator when uhd is called with the arguments type=sim. Creating the device object creates a subprocess using pybind and an embedded interpreter, and destroying the object cleans up those subprocesses. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* mpm: Fix more gevent errors on SIGTERMSamuel O'Brien2020-07-281-6/+19
| | | | | | | | | | | | | Sometimes when running usrp_hwd.py in a terminal and then canceling it with Ctrl+C, it prints a really large stacktrace into the terminal resulting from an uncaught gevent BlockingSwitchOutError. This comes from trying to block on Process#join inside a gevent signal handler. This commit resolves this issue by simply triggering an event in the signal handler which prompts a different non-daemon thread to join the subprocesses and end the parent process. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* mpm: Fix gevent errors on SIGTERMSamuel O'Brien2020-07-241-3/+0
| | | | | | | | | | | | | | | | | | | | | | Sometimes when running usrp_hwd.py in a terminal and then canceling it with Ctrl+C, it prints a really large stacktrace into the terminal resulting from an uncaught gevent BlockingSwitchOutError. It seems like there was an attempt to catch this in usrp_hwd.py:kill_time(). This try-except was surrounding a call to Process.join() which, to the best of my knowledge, can't ever throw this exception. Based on my troubleshooting, this error comes from the SIGTERM signal handler of the RPC process. The handler (defined in rpc_server.py:_rpc_server_process), is just a direct call to RPCServer.stop(). When the server's backed is a thread pool, this call may block when joining the thread pool, causing gevent to complain about execution attempting to block in a signal handler. This commit resolves this issue by simply triggering an event in the signal handler which prompts a different thread to clean up the server and end the process. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* mpm: Fix various Pylint issuesMartin Braun2020-07-091-2/+2
| | | | | | | | No functional changes. Fixes for things that PyLint complains about, but are safe to change anyway, as well as a minor improvement to a docstring that referenced non-existant args. This touches files that are mpm.conf-related.
* mpm: usrp_hwd: fix for gevent 1.4.0Joerg Hofrichter2019-10-081-2/+4
| | | | | | | | | | | Openembedded release warrior includes python3-gevent 1.4.0 which leads to the following error when starting usrp-hwd.py: ImportError: cannot import name 'BlockingSwitchOutError' from 'gevent.hub' This commit fixes the issue. Signed-off-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
* mpm: n3xx: Init device on bootMartin Braun2018-07-181-0/+4
| | | | | Specify skip_boot_init=1 to not init during boot. This will increase boot time for an N310, typically by around 15 seconds.
* mpm: cmake: Add git hash and version info to Python moduleMartin Braun2018-04-021-0/+4
| | | | Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
* mpm: Rename n310 to n3xxMartin Braun2018-03-051-1/+1
| | | | | This module (and class) are, in fact, used for all N3xx-derivates so renaming it is the more correct thing to do.
* mpm: Update all license headersMartin Braun2018-02-191-2/+2
| | | | | - Fix typo in company name (missing 'a') - Updated SPDX license identifier to version 3.0
* mpm: Use prefs API for periph managerMartin Braun2018-02-081-9/+9
| | | | | | | | - Allow to set default args via config file - Read them from prefs API - override-db-pids uses the same APIs now ([overrides] section in config file, prefs API, and same dictionary as --default-args when used on the command line
* mpm: Enable systemd watchdog and update it from MPMMartin Braun2018-01-151-2/+7
| | | | | | | | - Updated systemd service file - Added health status flag in shared data object - Added thread in RPC process to update watchdog Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
* mpm: usrp_hwd: Fix logging issue on default_args failureMartin Braun2018-01-111-3/+7
| | | | | | Failure to provide valid default args no longer results in an unexpected error. Also fixed minor formatting issues (PyLint).
* mpm: Spawn periph manager inside the RPC processMartin Braun2018-01-101-39/+48
| | | | Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
* mpm: Harmonize all license headerMartin Braun2017-12-221-13/+2
| | | | Now uses SPDX headers everywhere.
* mpm: Return correct value for usrp_hwd.py --init-onlyMartin Braun2017-12-221-1/+1
| | | | Before, it would always return success even if that failed.
* mpm: Reset periph manager on updateBrent Stapleton2017-12-221-2/+3
| | | | | | | | | | Upon updating certain components (the FPGA, for example), the Peripheral Manager is restarted, and the overlay is reapplied. In order to facilitate this, the RPC server intercepts and handles the update_component function. Tested on the RJ45 ethernet connection. It probably won't work as well if the SFP connection goes down when the overlay is removed.
* mpm: Let usrp_hwd.py --init-only show init status and durationMartin Braun2017-12-221-1/+10
| | | | Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
* mpm: discovery returns 'product' informationBrent Stapleton2017-12-221-1/+2
| | | | | - Added 'product' information to N310 - MPM discovery checks for 'product' field
* mpm: Add configurable log levelsMartin Braun2017-12-221-2/+17
|
* mpm: Remove leading _ from _get_device_info()Martin Braun2017-12-221-2/+2
| | | | Use @norpc instead. This fixes some linting issues.
* mpm: Catch multiprocess exception on exitMartin Braun2017-12-221-1/+6
|
* mpm: Made Python3 the default interpreter for all N3xx-related executablesMartin Braun2017-12-221-1/+1
|
* mpm: discovery can now be bound to subnetMartin Braun2017-12-221-1/+8
|
* mpm/mpmd: Call init() during UHD session init, not on hwd spawnMartin Braun2017-12-221-2/+1
|
* mpm: Moved device and dboard init/deinit to their own methodsMartin Braun2017-12-221-0/+18
| | | | Also cleaned up some cruft.
* mpm: Added command line args to usrp_hwd.pyMartin Braun2017-12-221-1/+40
|
* mpm: Fixed python import in discovery moduleMartin Braun2017-12-221-2/+2
|
* mpm: Fixed logging in exit caseMartin Braun2017-12-221-2/+2
|
* mpm: Moved over to new logging infrastructureMartin Braun2017-12-221-25/+17
| | | | Also currently hardcodes some settings.
* mpm: mpm reorganizationAndrej Rode2017-12-221-10/+23
|
* mpm: CMake cleanup, Python code enhancementsAndrej Rode2017-12-221-19/+38
| | | | | - Send user defined data in ping - Improve rpc_shell, add mpm_debug.py, fix tracebacks in multiprocessing
* Initial commit for N3xx development.Martin Braun2017-12-221-0/+57
- Creates mpm/ subdirectory - First pass at hardware daemon/MPM - New code for LMK04828, AD9371 - spidev integration Contributions by: Martin Braun <martin.braun@ettus.com> Derek Kozel <derek.kozel@ettus.com> Mark Meserve <mark.meserve@ni.com> Andrej Rode <andrej.rode@ettus.com>