Table of Contents generated with DocToc
cgrlib
cgrlib provides functions for taking data with the CGR-101 USB oscilloscope from Syscomp Electronic Design.
Installation
For Windows with Cygwin
-
Download the Cygwin installer
Download the appropriate version of setup.exe from cygwin.com. I like to copy it to my Windows desktop so I can easily run it again when I need to add packages.
-
Run the installer, selecting
install from internet
I like to install the root directory to C:\cygwin for all users. I also like to store package information to C:\cygstore, but this doesn't really matter. After selecting file locations, you can use the Cygwin mirrors site to choose a mirror near you.
-
Install the default packages, plus the following:
gnuplot
-
python
(2.7 branch) -
python-numpy
This along with lapack and liblapack-devel really should be pulled in with cgrlib's installation script, but there are some problems with dependencies that make this hard right now.
lapack
liblapack-devel
-
xorg-server
We need to set up the X server to display waveforms with gnuplot.
xinit
xorg-docs
-
Start the
Cygwin Terminal
This creates your home directory and some useful configuration files.
-
Create a .startxwinrc file
This is what you can use to start various X applications when the server starts. If you, like me, don't want to start any, a simple
touch .startxwinrc
from your home directory will suffice. -
Edit your
.bashrc
file to set your DISPLAY variableecho 'export DISPLAY=:0' >> ~/.bashrc
will keepgnuplot
from complaining that it can't open the display. You'll need to restart your shell or re-read the rc file after adding the line. I like just typingbash
to do this. -
Install pip
- Download
get-pip.py
from pip. I like to save it toC:\cygwin\usr\
. - Run the installer with
python get-pip.py
.
- Download
-
Repair numpy
I copied these instructions from centilemma.com. There's a lot of good information there.
cp /usr/lib/lapack/cygblas-0.dll /usr/bin
cp /usr/lib/lapack/cyglapack-0.dll /usr/bin
-
Install
gnuplot-py
This should be handled by
setup.py
, but I don't know how to specify allowing external and unverified packages.pip install --allow-external gnuplot-py --allow-unverified gnuplot-py gnuplot-py
-
Finally, install
cgrlib
pip install cgrlib
Start X using
startxwin
Try capturing a waveform with the
cgr-capture
command.