Re: [casper] python version for casperfpga

2021-05-11 Thread Adam Isaacson
Hi Jeff,

Well done on sorting this out - looking forward to this dark energy sensor
;).

Thanks for sharing these links. Just a reminder, that our toolflow supports
Matlab R2018a. The GUI socket timeout issue is because you are using Matlab
R2019a, I think? If you don't use Matlab R2018a, Vivado 2019.1.1 then you
can run into these issues.

The "no programming informs yet. Odd?" issue has burnt me on the Red Pitaya
boards too. Alexander Raymond from the CfA figured the solution out -
thanks Alex.

Thanks for the useful feedback Jeff!

Kind regards,

Adam


On Tue, 11 May 2021, 2:55 PM 'Kobesky, Jeffrey CIV USN NRL ()
Washington DC (USA)' via casper@lists.berkeley.edu, <
casper@lists.berkeley.edu> wrote:

> Spiro,  Adam,
>
>
>
> Thanks for the info. I’ve successfully programmed Red Pitaya_Tutorial 1,
> orange light is blinking, so now I can move onto dark energy sensors next
> (kidding).  I think my main problem was I did not understand the different
> python environments and how they could be used with the Simulink/Vivado
> toolflow and casperfpga, so the info below definitely helped me.
>
>
>
> Otherwise two specific problems were “GUI socket server timed out” solved
> by this post
> https://www.mail-archive.com/casper@lists.berkeley.edu/msg07886.html and
> “no programming informs yet.  Odd?” solved by adding “127.0.0.1 localhost”
> to /etc/hosts on the RP, per this post
> https://www.mail-archive.com/casper@lists.berkeley.edu/msg07885.html .
>
>
>
> Hope this helps other people just starting out!   – Jeff
>
>
>
> Jeffrey Kobesky
>
> Electronics Engineer, Naval Research Laboratory
>
> O: (202) 404-7109 M: (443) 243-1554
>
> OS:  Pop!_OS 18.04 LTS (derived from Ubuntu 18.04 LTS)
>
> Vivado 19.1.1MATLAB 2018amlib_devel branch:  master
>
> Python 2.7 for casperfpga and 3.6 running in (casper_venv) for toolflow
>
> Devices:  Red Pitaya, SKARAB
>
>
>
>
>
> *From:* Spiro Sarris 
> *Sent:* Wednesday, May 5, 2021 6:55 AM
> *To:* casper@lists.berkeley.edu
> *Subject:* Re: [casper] python version for casperfpga
>
>
>
> Hi Jeff,
>
> I have one more suggestion that might help.  When your python
> installation(s) become more complicated, sometimes the seemingly simple
> command "pip" or "pip3" doesn't do what you expect.  It can install
> packages or search for dependencies in directories that you don't expect
> (not matching the python installation / environment that you intend to
> install packages).  I have found helpful to use the command
>
> $ python -m pip 
>
> instead of
>
> $ pip 
>
>
>
> In my experience, this command format has allowed pip to search
> dependencies and install packages to the intended python (the same python
>  referred to by "python" in the command line).
>
>
>
> Cheers,
>
> Spiro
>
>
>
> On Tue, 2021-05-04 at 22:06 +0200, Adam Isaacson wrote:
>
> Hi Jeff,
>
>
>
> Please see my feedback in red below.
>
>
> Kind regards,
>
>
>
> Adam Isaacson
>
> South African Radio Astronomy Observatory (SARAO)
>
> Hardware Manager
>
> Cell: (+27) 825639602
>
> Tel:  (+27) 215067300
>
> email: aisaac...@ska.ac.za
>
>
>
>
>
> On Tue, May 4, 2021 at 4:34 PM 'Kobesky, Jeffrey CIV USN NRL ()
> Washington DC (USA)' via casper@lists.berkeley.edu <
> casper@lists.berkeley.edu> wrote:
>
> Hello CASPER,
>
>
>
> I thought I had the Python stuff figured out, but turns out I'm completely
> lost.
>
>
>
>
>
> AI: No worries, there is still plenty that I don't understand :).
>
>
>
> I followed the instructions on this page:
> https://casper-toolflow.readthedocs.io/en/latest/src/How-to-install-casperfpga.html
>
>
>
> I did both the upper set of instructions using pip, and the lower set of
> instructions using the "traditional method". Both result in errors in the
> third set of instructions using ipython.  Am I supposed to do these steps
> in the vitual python environment casp-venv, or in non-virtual environment,
> or does it matter.  I've actually tried both, and neither works for me.
>
>
>
>
>
> AI: It all depends on which repo and branch you are using. Maybe specify
> the repo and branch. It looks like you are using casper-astro/casperfpga
> repo, but I could be wrong. There is a python 3 branch, which is not
> supported for the SKARAB and the python 2 branch, which is supported for
> SKARAB and SARAO uses that. Personally, I use a virtual environment (Python
> 3.5) for the toolflow and no virtual environment for casperpfga (python
> 2.7). I haven't tested all the permutations, but I know that works for me.
>
>
>
> In the first set of instructions using pip, should I be using pip or pip3?
>
>
>
>
>
> AI: Once again pip is for python 2.7 and above. Pip3 is for python 3.5 and
> above. If the branch you are using has "py3" in the name then you will need
> pip3. All the other branches use Python 2.7 and so pip is fine.
>
>
>
> Some possible clues:
>
>
>
> (casper_venv) labrat@pop-os:~$ python --version Python 3.6.9
>
> (casper_venv) labrat@pop-os:~$ pip --version pip 9.0.1 from
> 

RE: [casper] python version for casperfpga

2021-05-11 Thread 'Kobesky, Jeffrey CIV USN NRL (5555) Washington DC (USA)' via casper@lists.berkeley.edu
Spiro,  Adam,

Thanks for the info. I’ve successfully programmed Red Pitaya_Tutorial 1, orange 
light is blinking, so now I can move onto dark energy sensors next (kidding).  
I think my main problem was I did not understand the different python 
environments and how they could be used with the Simulink/Vivado toolflow and 
casperfpga, so the info below definitely helped me.

Otherwise two specific problems were “GUI socket server timed out” solved by 
this post https://www.mail-archive.com/casper@lists.berkeley.edu/msg07886.html 
and “no programming informs yet.  Odd?” solved by adding “127.0.0.1 localhost” 
to /etc/hosts on the RP, per this post 
https://www.mail-archive.com/casper@lists.berkeley.edu/msg07885.html .

Hope this helps other people just starting out!   – Jeff

Jeffrey Kobesky
Electronics Engineer, Naval Research Laboratory
O: (202) 404-7109 M: (443) 243-1554
OS:  Pop!_OS 18.04 LTS (derived from Ubuntu 18.04 LTS)
Vivado 19.1.1MATLAB 2018amlib_devel branch:  master
Python 2.7 for casperfpga and 3.6 running in (casper_venv) for toolflow
Devices:  Red Pitaya, SKARAB


From: Spiro Sarris 
Sent: Wednesday, May 5, 2021 6:55 AM
To: casper@lists.berkeley.edu
Subject: Re: [casper] python version for casperfpga

Hi Jeff,
I have one more suggestion that might help.  When your python installation(s) 
become more complicated, sometimes the seemingly simple command "pip" or "pip3" 
doesn't do what you expect.  It can install packages or search for dependencies 
in directories that you don't expect (not matching the python installation / 
environment that you intend to install packages).  I have found helpful to use 
the command
$ python -m pip 
instead of
$ pip 

In my experience, this command format has allowed pip to search dependencies 
and install packages to the intended python (the same python  referred to by 
"python" in the command line).

Cheers,
Spiro

On Tue, 2021-05-04 at 22:06 +0200, Adam Isaacson wrote:
Hi Jeff,

Please see my feedback in red below.

Kind regards,

Adam Isaacson
South African Radio Astronomy Observatory (SARAO)
Hardware Manager
Cell: (+27) 825639602
Tel:  (+27) 215067300
email: aisaac...@ska.ac.za






On Tue, May 4, 2021 at 4:34 PM 'Kobesky, Jeffrey CIV USN NRL () Washington 
DC (USA)' via casper@lists.berkeley.edu 
mailto:casper@lists.berkeley.edu>> wrote:
Hello CASPER,

I thought I had the Python stuff figured out, but turns out I'm completely lost.


AI: No worries, there is still plenty that I don't understand :).

I followed the instructions on this page: 
https://casper-toolflow.readthedocs.io/en/latest/src/How-to-install-casperfpga.html

I did both the upper set of instructions using pip, and the lower set of 
instructions using the "traditional method". Both result in errors in the third 
set of instructions using ipython.  Am I supposed to do these steps in the 
vitual python environment casp-venv, or in non-virtual environment, or does it 
matter.  I've actually tried both, and neither works for me.


AI: It all depends on which repo and branch you are using. Maybe specify the 
repo and branch. It looks like you are using casper-astro/casperfpga repo, but 
I could be wrong. There is a python 3 branch, which is not supported for the 
SKARAB and the python 2 branch, which is supported for SKARAB and SARAO uses 
that. Personally, I use a virtual environment (Python 3.5) for the toolflow and 
no virtual environment for casperpfga (python 2.7). I haven't tested all the 
permutations, but I know that works for me.

In the first set of instructions using pip, should I be using pip or pip3?


AI: Once again pip is for python 2.7 and above. Pip3 is for python 3.5 and 
above. If the branch you are using has "py3" in the name then you will need 
pip3. All the other branches use Python 2.7 and so pip is fine.

Some possible clues:

(casper_venv) labrat@pop-os:~$ python --version Python 3.6.9
(casper_venv) labrat@pop-os:~$ pip --version pip 9.0.1 from 
/home/labrat/casper_venv/lib/python3.6/site-packages (python 3.6)
(casper_venv) labrat@pop-os:~$ deactivate labrat@pop-os:~$ python --version 
Python 3.6.9 labrat@pop-os:~$ pip --version pip 9.0.1 from 
/usr/lib/python2.7/dist-packages (python 2.7)


AI: These versions should work, but I haven't tested on them. I think my pip 
version was 8.1, Python 3.5 and Python 2.7.

The closest I got in ipython, I think, yielded this (which is probably wrong 
version, but at least no errors):

In [1]: import casperfpga

In [2]: casperfpga.__version__
Out[2]: '0.0+unknown.202105040928'


AI: It looked like it has installed correctly. Don't worry too much about the 
"unknown" version. We have a ska-sa/casperfpga repo and the branch is devel. if 
you install this casperfpga version then you won't see the "unknown" in the 
field. I think once we have merged our changes into the casper-astro/ 
casperfpga repo then this field will be populated.  Do you have a board