Matlab to volttron integration - matlab

Below the steps followed to integrate a fake building - fake modbus device (Ubuntu 18.04 LTS) with matlab-based interface.
Following the documentation steps at: https://volttron.readthedocs.io/en/6.0/devguides/walkthroughs/DrivenMatlabAgent-Walkthrough.html
Installation steps for system running Matlab:
Install python (my Python version: 2.7.12)
Steps for system running Matlab:
Install python – done
Install pyzmq –done
Install Matlab-- done (R2019b)
run pyversion --done
version: '2.7'
executable: '/home/USER_NAME/volttron/env/bin/python'
library: 'libpython2.7.so.1.0'
home: '/home/USER_NAME/volttron/env'
isloaded: 0
when I run py.zmq.pyzmq_version() I get
ans =
Python str with no properties.
15.4.0
I copied the example.m to the desktop.
Run and test Matlab VOLTTRON Integration:
To run and test the integration: Assumptions
Device driver agent is already developed (master_driveragent-3.1.1- is installed)
Installation:
Install VOLTTRON –done
Add subtree volttron-applications under volttron/applications by using the following command –
For adding subtree: I used the code: git subtree add --prefix applications https://github.com/VOLTTRON/volttron- applications.git develop --squash error (Working tree has modifications. Cannot add.)
Configuration
Copy example configuration file applications/pnnl/DrivenMatlabAgent/config_waterheater to volttron/config. done
error while installing Drivenmatlabagent in applications/pnnl/DrivenMatlabAgent
(volttron)whygrene#ip-172-31-8-77:~/volttron$ python scripts/install-agent.py -s ./applications/pnnl/DrivenMatlabAgent/setup.py --start
ERROR:install-agent.py:Invalid agent source directory specified.
and running example.m file in matlab server ?
Am i missing something

Related

Why Does the VS Code Jupyter Extension Keep Timing-out Trying to Find a Kernel That Exists?

I need to set up virtual environments for each language that I use. To do this, I'm running the Ubuntu 20.04 LTS Windows Subsystem for Linux (WSL) on Windows 10. Within WSL, I'm using Anaconda, installed in /usr/local/Anaconda, to create conda virtual environments for each language (i.e. one environment contains all my Python stuff, another contains my R stuff, etc.).
Since WSL doesn't come with a GUI, I'm using Visual Studio Code's (VSCode) Jupyter Notebook Extension to run Jupyter Notebooks to see plots/graphics. So far, I managed to easily create conda environments for Python (with ipython and ipykernel) and R (with IRkernel) and run their code in a notebook via the extension. Each time I set up an environment, the extension is easily able to find the kernel, connect to it and run the code.
However, I've not been able to set up an environment for Julia. I followed the documentation on the Julia website for installing the kernel, which is successfully found by the extension. But, when I try running a cell, the extension says it is trying to connect to the kernel, only for it to timeout and fail.
Here are the steps I have taken so far:
Create a clean conda environment (conda create -n Julia && conda activate Julia)
Install the latest version of Julia (conda install -c conda-forge julia)
Install the latest version of Jupyter (conda install -c conda-forge jupyter)
Install the Julia kernel with the built-in Julia package manager (using Pkg; Pkg.add("IJulia"))
Build the IJulia package (using Pkg; Pkg.build("IJulia"))
Confirm the presence of the Julia kernel (jupyter kernelspec list) which indeed shows the presence of a Julia kernel
Reload the VSCode connection to WSL (Ctrl + Shift + P; >Reload Window)
Shut down WSL via CMD (wsl --shutdown) for changes to take effect and reconnect
After I restart VSCode and WSL, the extension shows an option to use the Julia kernel installed in my conda environment: Julia 1.7.2 (~/.conda/envs/Julia/bin/julia). But when I create a cell and run code in a notebook, the extension creates a popup saying that it is connecting to the kernel and after some time an error message shows up:
Failed to start the Kernel.
Unable to start Kernel `Julia 1.7.2` due to connection timeout.
View Jupyter log for further details
I can also see the kernel spec JSON file in ~/.local/share/jupyter/kernels/julia-1.7/kernel.json
{
"display_name": "Julia 1.7.2",
"argv": [
"/home/USER/.conda/envs/Julia/bin/julia",
"-i",
"--color=yes",
"--project=#.",
"/home/USER/.conda/envs/Julia/share/julia/packages/IJulia/AQu2H/src/kernel.jl",
"{connection_file}"
],
"language": "julia",
"env": {},
"interrupt_mode": "signal"
}
The log file starts showing problems here:
info 17:50:48.378: Process Execution: cwd: ~
cwd: ~
warn 17:50:48.893: StdErr from Kernel Process [91m[1mERROR: [22m[39m
warn 17:50:49.138: StdErr from Kernel Process LoadError:
warn 17:50:49.795: StdErr from Kernel Process ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
The extension says it cannot find the IJulia kernel. This perplexes me because I can see the kernel spec in my home directory, the jupyter binary I installed from conda says that its there and the Jupyter Notebook extension can see the kernel. I have no explanation as to why the extension can see the kernel, match up the kernelspec but not be able to connect to it. Help would greatly be appreciated!

How to install Oracle SQL Developer on Linux (Pop!_OS)

I am trying to install SQL Developer on my laptop. I've download the file from Oracle and follow the instruction, I have RPM installed, but when I run rpm -Uhv sqldeveloper-21.4.3-063.0100.noarch.rpm, I encountered the following:
rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
warning: RPM v3 packages are deprecated: sqldeveloper-21.4.3-063.0100.noarch
error: Failed dependencies:
/bin/sh is needed by sqldeveloper-21.4.3-063.0100.noarch
What can I try next?
It looks like you are trying to run a package made for redhat based systems, but PopOS is debian based.
To proceed with the installation you must first install rpm2cpio, then you can extract it by running the command "# rpm2cpio datamodeler-21.4.2.059.0838-1.noarch.rpm", then you can access the extracted directory.
Then you can use the command "# ./sqldeveloper.sh" to run the application.
But, ensure you have a JDK installed You will be prompted to enter a jdk path. (ie usr/java/jdk1.8.0_181) SQL Developer will automatically launch once jdk location is provided

VCPKG_FORCE_SYSTEM_BINARIES Errors when Running vcpkg on raspberry pi

I installed the latest version of cmake and was following some instructions i made to integrate a project that used vcpkg with grpc. After installing vcpkg I try to install package with ./vcpkg install grpc which resulted in the error bellow. The instructions worked on a OSX and Ubuntu but I run into issues with raspberry pi.
I have set tried both 0 and 1 like so $VCPKG_FORCE_SYSTEM_BINARIES=1 but neither option is working. Using ./vcpkg result in a VCPKG_FORCE_SYSTEM_BINARIES error:
pi#raspberrypi:~/vcpkg $ ./vcpkg
Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm and s390x platforms.
pi#raspberrypi:~/vcpkg $ VCPKG_FORCE_SYSTEM_BINARIES=1
pi#raspberrypi:~/vcpkg $ echo $VCPKG_FORCE_SYSTEM_BINARIES
1
pi#raspberrypi:~/vcpkg $ ./vcpkg
Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm and s390x platforms.
In bash the environment variable is set with export:
export VCPKG_FORCE_SYSTEM_BINARIES=1
./vcpkg install grpc
The export command can be put in .bashrc to persist this setting.
src: https://github.com/microsoft/vcpkg/issues/14140

Python venv is giving errno 2 in visual studio code

I tried to make a virtual environment as stated in the documentation of the visual studio code. I have already installed python 3.7.3 and anaconda on the system.
I did the following and I'm using vs code version 1.34 and windows 10:
I made an empty folder and used this line of code as stated in official documentation:
py -3 -m venv .venv
I expected a folder named .venv that has scripts folder with 'activate' file in it. As i have tested this method which worked on other systems with the same configuration, But instead i get the below error message:
Error: [Errno 2]: no such file or directory : 'C:\\ProgramData\\Anaconda3\\lib\\venv\\scripts\\nt\\python.exe'
It look like installer is broken, or so...
Copy from Python 3 installation folder:
C:\Users{user}\AppData\Local\Programs\Python\Python37
Files: python.exe, python.pdb, python_d.exe, python_d.pdb, pythonw.exe & pythonw.pdb to folder: C:\ProgramData\Anaconda3\lib\venv\scripts\nt\
That's because, in the python version you are trying create virtual environment venv [ in other cases -> vitualenv] has not been installed.
environment building process fails after python global version hand over to the specific version.
you can get idea how to install vitualenv on a specific version from the link below.
Dealing with multiple python versions and pip

How do install tensor flow gpu?

I am currently having some problems installing tensor flow with gpu support.
This is the guide i've followed.
Install NVIDIA CUDA (preinstalled)
Install NVIDIA cuDNN (preinstalled)
Install bazel
wget https://github.com/bazelbuild/bazel/releases/download/0.4.3/bazel-0.4.3-installer-linux-x86_64.sh
chmod +x bazel-0.4.3-installer-linux-x86_64.sh
./bazel-0.4.3-installer-linux-x86_64.sh --user
install tensor flow from source
git clone https://github.com/tensorflow/tensorflow
cd tensorflow/
./configure
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
the last one don't finish.. or it does.. it comes up with an error message
a#fe1:~/tensorflow$ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
.
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
Server finished RPC without an explicit exit code
after this should i be able to do this
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tenso
rflow_pkg
according to the guide, but is not possible.
i've previously had tensor flow cpu version running, but since the need of gpu were sincerely pressing i decided to install it... but didn't think it would be this troublesome..
any idea on why it is not possible to build it?
os:centOS 7.1
gpu:nvidea
I've had problems attemping to install Tensorflow from source using Bazel as well.It could be that the current bazel build has problems,since that occured in the past with me.It would help if you provided us with information about your system(OS & GPU),but you're probably better off using pip(or pip3) and doing sudo pip(3) install tensorflow-gpu.