UHD Drivers installation failure - usrp

I am somewhat new to posting so please forgive and correct any mistakes I make in this post (and if I lack any necessary information please tell me)
I am following Ch.6 of this guide here https://pysdr.org/content/usrp.html, and am attempting to install the UHD drivers with these following steps
sudo apt-get install git cmake libboost-all-dev libusb-1.0-0-dev python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools build-essential
cd ~
git clone https://github.com/EttusResearch/uhd.git
cd uhd/host
mkdir build
cd build
cmake -DENABLE_TESTS=OFF -DENABLE_C_API=OFF -DENABLE_MANUAL=OFF ..
make -j8
sudo make install
sudo ldconfig
However, when I run the test code to ensure that I installed it correctly,
python3
import uhd
usrp = uhd.usrp.MultiUSRP()
samples = usrp.recv_num_samps(10000, 100e6, 1e6, [0], 50)
print(samples[0:10])
I get the following output.
>> Traceback (most recent call last):
>> File <stdin>, line 1, in <module>
>> AttributeError: module 'uhd' has no attribute usrp`
I am unsure as to why I get this output. I had looked up this error and found this https://www.mail-archive.com/usrp-users#lists.ettus.com/msg11331.html where the person had the exact same error, and the recommendation was to alter the PYTHONPATH variable, but was unsure how to do so.
I'm running a virtual machine with Ubuntu 22.04 LTS 5GB of Ram and 3 dedicated CPUs.
>> -- # UHD enabled components
>> -- ######################################################
>> -- * LibUHD
>> -- * LibUHD - C API
>> -- * LibUHD - Python API
>> -- * Examples
>> -- * Utils
>> -- * Tests
>> -- * USB
>> -- * B100
>> -- * B200
>> -- * USRP1
>> -- * USRP2
>> -- * X300
>> -- * MPMD
>> -- * N300
>> -- * N320
>> -- * E320
>> -- * E300
>> -- * OctoClock
>> -- * DPDK
>> -- * SIM
I also attempted pybombs installation "pybombs install uhd" and still got the same error output.
If anybody knows the issue/a solution please tell me!
Thanks!

I have installed the UHD driver by following https://pysdr.org/content/usrp.html. While installing, I did not get any error, but while testing, I was getting the same error:
Traceback (most recent call last):
File <stdin>, line 1, in <module>
AttributeError: module 'uhd' has no attribute usrp
Solution: I resolved the error just by exporting the python3 path
export PYTHONPATH="/usr/local/lib/python3.6/site-packages/"

Related

command which repeats one line of its normal output

on ( debian 11 / Xfce ) to show lightdm.conf at first I used this command
~$ /usr/sbin/lightdm --show-config
[Seat:*]
-----------
Sources:
B /usr/share/lightdm/lightdm.conf.d/01_debian.conf
B /usr/share/lightdm/lightdm.conf.d/01_debian.conf ---> same as above
C /etc/lightdm/lightdm.conf.d/lightdm.conf
D /etc/lightdm/lightdm.conf
then I tried
~$ sudo lightdm --show-config
[Seat:*]
----------
Sources:
A /usr/share/lightdm/lightdm.conf.d/01_debian.conf
B /etc/lightdm/lightdm.conf.d/lightdm.conf
C /etc/lightdm/lightdm.conf
which gives normal output. But even more puzzling, for me, is that if I use sudo with the first command, which I normally should not do, I get the right output :
~$ sudo /usr/sbin/lightdm --show-config
[Seat:*]
---------
Sources:
A /usr/share/lightdm/lightdm.conf.d/01_debian.conf
B /etc/lightdm/lightdm.conf.d/lightdm.conf
C /etc/lightdm/lightdm.conf
I tried nothing because I am completely puzzled by this problem. I have no idea whatsoever where to start looking or what to look for.

Output from running Matlab (Linux) as a Cron job in Bash includes many ">>" in the email

I am running a Matlab script on Linux (RedHat Enterprise Linux RHEL 7.6, 64-bit) as a cron job. I am not admin on that machine, therefore, I use crontab -e to schedule the job. The installed version of Matlab is 2018b. The email which I recieve upon execution includes a couple of >> at the beginning and end which I find a bit irritating.
Here, an example of the email:
MATLAB is selecting SOFTWARE OPENGL rendering.
< M A T L A B (R) >
Copyright 1984-2018 The MathWorks, Inc.
R2018b (9.5.0.944444) 64-bit (glnxa64)
August 28, 2018
To get started, type doc.
For product information, visit www.mathworks.com.
>> >> >> >>
Matlab started: 2020-07-31 21:50:26.
>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
Going to update from 2015-01-01 00:00:00 UTC to 2015-12-31 23:00:00 UTC.
[...]
>> Matlab closes: 2020-07-31 23:26:41.
>>
The corresponding lines at the beginning of the Matlab script look exactly like this:
close all
clearvars
% profile on % to check performance
fprintf('\nMatlab started: %s.\n', char(datetime()))
%% Database user parameters
% connects always to the soecified database on "localhost"
DB_conn_name = 'abc';
DB_username = 'def';
DB_password = 'ghi';
% Add path and subfolders
if isunix
addpath(genpath('/project/abc'));
elseif ispc
addpath(genpath('C:\Branches\abc'));
end
% Change working folder
if isunix
cd /project/abc
elseif ispc
cd C:\Branches\abc
end
% Add database driver to path
javaaddpath JDBC_driver/mysql-connector-java.jar % Forward slashes within Matlab work even on Windows
% Set default datetime format
datetime.setDefaultFormats('default','yyyy-MM-dd HH:mm:ss')
%% Begin and end of update period
% now_UTC = datetime('now','TimeZone','UTC');
% time_2 = datetime(now_UTC.Year, now_UTC.Month, now_UTC.Day-1, 22, 0, 0); % Set the end time not too late, otherwise, some data might not yet be available for some areas leading to ugly "dips" in Power BI.
% During each update, we update e.g. the past 30 days
% datetime_month_delay = time_1 - days(30);
% Override automatic dates obtained below, for testing purposes
% time_1 = datetime(2020,1,1,0,0,0);
% time_2 = datetime(2020,2,1,23,0,0);
% Updating several years, one at a time
for iYear = 2015:2019
time_1 = datetime(iYear,1,1,0,0,0);
time_2 = datetime(iYear,12,31,23,0,0);
fprintf(['\nGoing to update from ',char(time_1),' UTC to ',char(time_2),' UTC. \n'])
[...]
Looks as though each row that is outside the for loop produces an empty line and therefore such a >> prompt in the output. Also visible at the end (not included here).
The crontab -e looks like the following:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=<my email address>
HOME=/project/abc
HTTP_PROXY=<proxy address>:8086
HTTPS_PROXY=<proxy address>:8086
# Run script regularly: minute hour day month dayofweek command
# No linebreaks allowed
15 2 * * * ~/script.sh
The shell script script.sh looks like this:
#!/bin/bash
/prog/matlab2018b/bin/matlab -nodesktop < ~/git-repos/abc/matlabscript.m
Does anyone have an idea what I need to change to get rid of these >>? That would be great! Thanks in advance!
The -nodesktop flag is still giving you an interactive shell, which is why crontab is capturing the prompts at all. You need to tell the matlab command what statement to execute.
I know you are using R2018b; but, I am going to give you BOTH answers for before and after R2019a, in case you ever upgrade.
For both answers: Because you called this in your crontab, make sure to use full path for your MATLAB executable for security reasons; and, it would be good to make sure you use the -sd flag as well so that your statement to execute is first in the path. The statement to execute is to be typed the same way you would type it on the MATLABcommand line.
Before R2019a: Per the doc page for the R2018b matlab (Linux) command, you need to run your command with the -r and -sd flags together. The -sd flag specifies your startup directory. Also, your code needs to have an exit statement at the end so that the matlab executable knows its done.
/path/before_R2019a/matlab -sd /path/startup_directory -b statement
Starting in R2019a, the -batch flag in your invocation of MATLAB is the recommended way to run automated jobs like this, per the matlab (Linux) command doc page
Note that starting in R2019a, the -r flag is NOT recommended; and, it should NOT be used with the -batch flag.
The -batch flag is simpler to use, and was added to make automation tasks easier. For starters, you no longer need to have an exit statement in your code with this approach.
Also remember that if you need quotes, starting in R2016b, MATLAB handles both double and single quoted strings. Choose appropriately in your script or cron call to handle your linux shell replacements - or avoid them.
/path/R2019a+/matlab -sd /path/startup_directory -b statement
As an added bonus, if you use the -batch flag, you can tell from inside your script whether it is running from a -batch call or interactively using the MATLAB variable batchStartupOptionUsed.

Cef Compilation 64 bit Binaries not generated for Cocoa

CEF :
Branch : 2987
Terminal Commands for Generating binary distrib files after all the data gets downloaded
$ export GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome
$ python /Users/imfinity/Documents/CEF_2987/automate/automate-git.py --download-dir=/Users/imfinity/Documents/CEF_2987/download --branch=2987 --x64-build --force-config --force-build
$ cd /Users/imfinity/-dir/chromium/src/cef/tools
$ ./make_distrib.sh --ninja-build
ERROR : Traceback (most recent call last):
File "make_distrib.py", line 468, in
raise Exception('Missing generated header file: %s' % include)
Exception: Missing generated header file: cef_pack_resources.h
This leads to creation of : Incomplete Folder : cef_binary_3.2987.1574.g4232c4c_macosx32
Any help is appreciated!!
I tried this command
$ export GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome
$ python /Users/imfinity/Documents/CEF_20March/automate/automate-git.py --download-dir /Users/imfinity/Documents/CEF_20March/download --branch=2987 --x64-build --force-config
and finally it worked and 64 bit binaries were generated
still surprised it worked after 5 different attempts!!!

Vagrant - Not Supported the capability 'change_host_name'

The problem is about the capability 'change_host_name' isn't supported by the guest when I try to execute the following command line:
vagrant up
It gives me an error as the following:
Vagrant attempted to execute the capability 'change_host_name'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.
Note that my OS is:
OS X Yosemite 10.10.5
Guest Additions Version: 4.2.0 and VirtualBox Version: 5.0
I've tried many solutions of others who face this issue, but I couldn't fix it.
This is https://github.com/mitchellh/vagrant/issues/7625. It will be fixed in the next release, until then if its blocking you, you can patch vagrant yourself
If you want to patch yourself
Method1 :
search for the plugins/guests/ubuntu/guest.rb file in your vagrant installation
e.g. /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb on mac/linux default install
or /opt/vagrant/embedded/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb
windows : C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.5\plugin‌​s\guests\ubuntu\gues‌​t.rb
replace with
https://raw.githubusercontent.com/carlosefr/vagrant/1c631c18d1a654405f6954459a42ac19a1a2f096/plugins/guests/ubuntu/guest.rb (make sure to be with correct rights if you install as admin, you must be admin user to save the file)
alternatively edit the file and replace all contents by
module VagrantPlugins
module GuestUbuntu
class Guest < Vagrant.plugin("2", :guest)
def detect?(machine)
# This command detects if we are running on Ubuntu. /etc/os-release is
# available on modern Ubuntu versions, but does not exist on 14.04 and
# previous versions, so we fall back to lsb_release.
#
# GH-7524
# GH-7625
#
machine.communicate.test <<-EOH.gsub(/^ {10}/, "")
if test -r /etc/os-release; then
source /etc/os-release && test xubuntu = x$ID
elif test -x /usr/bin/lsb_release; then
/usr/bin/lsb_release -i 2>/dev/null | grep -q Ubuntu
else
exit 1
fi
EOH
end
end
end
end
Method2 : An Alternative method to patch the file using patch command :
save the following file under vagrant-guest.patch
commit 00fa49191dba2bb7c6322fa8df9327ca505c0b41
Author: Seth Vargo <sethvargo#gmail.com>
Date: Sat Jul 23 11:40:36 2016 -0400
guests/ubuntu: Revert detection
- Semi-reverts GH-7524
- Fixes GH-7625
diff --git a/plugins/guests/ubuntu/guest.rb b/plugins/guests/ubuntu/guest.rb
index 9aeb7aa..f60108e 100644
--- a/plugins/guests/ubuntu/guest.rb
+++ b/plugins/guests/ubuntu/guest.rb
## -2,7 +2,22 ## module VagrantPlugins
module GuestUbuntu
class Guest < Vagrant.plugin("2", :guest)
def detect?(machine)
- machine.communicate.test("test -r /etc/os-release && . /etc/os-release && test xubuntu = x$ID")
+ # This command detects if we are running on Ubuntu. /etc/os-release is
+ # available on modern Ubuntu versions, but does not exist on 14.04 and
+ # previous versions, so we fall back to lsb_release.
+ #
+ # GH-7524
+ # GH-7625
+ #
+ machine.communicate.test <<-EOH.gsub(/^ {10}/, "")
+ if test -r /etc/os-release; then
+ source /etc/os-release && test xubuntu = x$ID
+ elif test -x /usr/bin/lsb_release; then
+ /usr/bin/lsb_release -i 2>/dev/null | grep -q Ubuntu
+ else
+ exit 1
+ fi
+ EOH
end
end
end
and run the following command to apply the patch
sudo patch -p1 --directory /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/ < vagrant-guest.patch
Just replace /opt/vagrant/embedded/gems/gems/vagrant-1.8.5 (or /opt/vagrant/embedded/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb) with your vagrant folder installation

Steps for installing Orbfit 4.2

I'm trying to install Orbfit4.2 on a using linux mint maya edition. I'm trying to follow the on line help. I have unzipped the tared file, configured with $ ./config -0 gfortran and then $ make. Both appears to be successful. I am now trying to create the DE405 data files in the /orbfit/src/jpleph directory. I have downloaded the header.405 and the ascp*date* ascii files into the directory from JPL. I have run $ make ephemerides and get the following;
cat header.405 ascp1960.405 ascp1980.405 ascp2000.405 ascp2020.405> input.430
asc2eph.x < input.430
/bin/sh: 1: asc2eph.x: not found
make: *** [ephemerides] Error 127
(I have also used input value of 405 instead of 430)
I have also tried just running from with in
the directory
$ ./asc2eph.x which was the previous method before the Makefile was included. All I get with this is 'authors' introductory message and the flashing working box-still running 6 hrs later.
If anybody has any experience or advice with installing Orbfit 4.2 from the start or can help me move on from the above blockage I would appreciate.
Note I am a real novice and would appreciate idiot step by step guide- I'm the idiot.
Eric
The Makefile assumes that the current directory "." is in your path. This is a security risk. You can either edit the Makefile to rename these binaries:
$ diff -u Makefile.orig Makefile
--- Makefile.orig 2014-01-09 07:14:10.000000000 -0800
+++ Makefile 2014-10-21 11:40:00.850236839 -0700
## -10,7 +10,7 ##
make clean
ephemerides: input asc2eph.x
- asc2eph.x < input.430
+ ./asc2eph.x < input.430
mv JPLEPH jpleph
make clean
Or you can add . to your path (but this is insecure!) by doing
$ PATH=.:$PATH

Resources