Should Py-Visa be usable as is on a BBB? I'll be attempting to install it tonight.
Should Py-Visa be usable as is on a BBB? I'll be attempting to install it tonight.
I suspect it should be usable on most platforms which have access to Python. By default, PyVISA relies on the National Instruments VISA installation if it is available, but can also fallback to using pyvisa-py which is implemented in pure Python. See https://pyvisa.readthedocs.io/en/master/configuring.html
- Gough
I now have PyVisa and PyVisa-Py installed. are there any other things I should consider installing for my instrument control? I will have limited network access to this BBB so I'd like to do it in one go.
Thanks
It really depends what you want to do ...
In the instance that you're setting something up with limited access, I think it's probably best to first prototype or design the whole set-up first and get it working before "locking it down" or even migrating to a more "limited" platform such as an SBC. Defining your project aims/goals/functions/deliverables is vitally important if you ever want to "finish" the project. You could (in theory) smatter a few packages which might be useful (e.g. an editor of sorts, maybe a version control system, some remote access abilities on a protocol you'd like, perhaps an HTTP or SMB file-sharing if necessary), but installing too many bloats your installation, slows down upgrades in the future and potentially opens security holes in bugs, exploits or misconfiguration.
As a result, I'd probably suggest you have a good hard think of what you'd want to do, actually make something working on something less restrictive and then port that over knowing exactly your dependencies as it varies from project to project and also depending on how you choose to code your project and the libraries you choose to use.
- Gough
When I try to load the following into cloud9, I get the following error. How do I get the dang module to load?
# Import libraries
import visa
import os
import time
# Open a VISA resource manager pointing to the installation folder for the Keysight Visa libraries.
rm = visa.ResourceManager()
# ALTER LINE BELOW - Update the VISA resource string to match your specific VNA
myFF = rm.open_resource("TCPIP0::192.168.7.20::inst0::INSTR")
myFF.write(':FORMat:DATA %s,%d' % ('ASCii', 0))
Traceback (most recent call last):
File "/var/lib/cloud9/PILOT_Test/FFtransfer.py", line 8, in <module>
import visa
ImportError: No module named visaThis implies your Python installation doesn't have pyvisa installed because it fails in import visa.Try installing it again?
- Gough
Trying to log in from either the serial connection or the terminal on the BBB desktop, It errors saying pip is not valid/installed
Then its likely you have a very outdated version of Python. Try updating all the packages on your OS. If not, perhaps you can install pip - https://www.makeuseof.com/tag/install-pip-for-python/
I am typing these commands directly into my BBB... I am using the latest BBB image to boot from
The latest image doesn't necessarily mean it has the latest packages installed. Likewise, I don't use BBB at present, but its easier to update packages and install pip as I mentioned above. I don't know but I suspect BBB uses pacman instead of apt.
- Gough
The BBB does use apt, not pacman. JonA says he's using "latest" images, so it will be debian, which uses apt. Gough's link to make-use-of has clear instructions for installation and updating, just in case pip is an old version.
I just did a:
$ sudo apt-get install python3-pip
on my debian (ubuntu) laptop, and the version command returns this:
t440-ubuntu:~$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
JonA, did you check/confirm whether you're using python 2 (2.7), or python 3.x? After the above, I installed python-pip (pip2) and get the following:
t440-ubuntu:~$ pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)