We are trying to access the daqhats and pi through a connection with matlab it appears that the virtual environment is causing issues. We were not able to get the daqhat library to install outside of a virtual environment. We used the instructions at mccdaq.github.io/daqhats/install.html on a raspberry pi 3b with bullseye. We were able to install it in a virtual environment using the following code in the raspberry pi terminal:
"
python3 -m venv environments
source environments/bin/activate
pip install daqhats
"
The virtual environment is fine while running code in a python interpreter, or directly in the raspberry pi terminal, but we have not been able to make it work for running the code from matlab, so we would like to not need to use it.
Question
floordoc
We are trying to access the daqhats and pi through a connection with matlab it appears that the virtual environment is causing issues. We were not able to get the daqhat library to install outside of a virtual environment. We used the instructions at mccdaq.github.io/daqhats/install.html on a raspberry pi 3b with bullseye. We were able to install it in a virtual environment using the following code in the raspberry pi terminal:
"
python3 -m venv environments
source environments/bin/activate
pip install daqhats
"
The virtual environment is fine while running code in a python interpreter, or directly in the raspberry pi terminal, but we have not been able to make it work for running the code from matlab, so we would like to not need to use it.
python code:
is attached
terminal commands:
"
source environments/bin/activate
python3 /home/aset/daqhats/examples/python/mcc172/bert2.py
"
matlab code:
"
if exist('rpi',"var")
else
rpi = raspi("[ip address]","[username]","[password]");
end
system(rpi, 'source environments/bin/activate')
system(rpi, 'python3 /home/aset/daqhats/examples/python/mcc172/bert2.py')
getFile(rpi,'/home/aset/Documents/pythonTests/test.csv')
"
bert2.py
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now