Skip to content

Commit

Permalink
Merge pull request #39 from Lightsaver7/August-patch-3
Browse files Browse the repository at this point in the history
August patch 3
  • Loading branch information
Lightsaver7 committed Aug 23, 2023
2 parents e3a1fdb + e6dc6ca commit 7598469
Show file tree
Hide file tree
Showing 7 changed files with 293 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-22.04
os: "ubuntu-22.04"
tools:
python: "3.11"
# You can also specify other tool versions:
Expand All @@ -24,7 +24,7 @@ sphinx:
# Build the docs in epub and pdf version
formats:
- epub
# - pdf # Too many latex warnings, internal links do not work with this
- pdf # Too many latex warnings, internal links do not work with this
# - htmlzip


Expand Down
19 changes: 10 additions & 9 deletions appsFeatures/applications/streaming/appXCStreaming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ Overview

X-Channel streaming is suitable for applications that require multiple acquisition or generation channels.

Red Pitaya X-Channel streaming software provides the ability to stream analog and digital signals to client PCs from several Red Pitaya devices simultaneously, with a synchronised clock and trigger among all Red Pitayas in the system.
Red Pitaya X-Channel streaming software allows streaming analog and digital signals to client PCs from several Red Pitaya devices simultaneously, with a synchronised clock and trigger among all Red Pitayas in the system.

Streaming can be done in both directions. Users can stream acquired analog and digital signals from Red Pitaya devices to a client computer or stream analog and digital signals from the client to Red Pitaya device outputs. The X-Channel streaming software also provides the ability to control streaming completely remotely from client PCs.

.. note::

The upstream to X-channel (synchronised generation) is currently under development.

.. figure:: img/RPs_to_PC_conn.png
:scale: 70%
.. image:: img/RPs_to_PC_conn.png
:width: 600


*****
Setup
Expand All @@ -38,7 +39,7 @@ Setup
The Red Pitaya STEMlab 125-14 X-Channel System consists of multiple Low-Noise STEMlab 125-14 devices that are modified for clock and trigger synchronization and also comes with SATA synchronisation cables and software that supports X-Channel RF signal acquisition and generation.

.. figure:: img/Master_and_slaves.jpg
:width: 70%
:width: 800

Notice that the Red Pitaya STEMlab 125-14 X-Channel System includes two types of devices:

Expand Down Expand Up @@ -81,7 +82,7 @@ Setting-up
#. Connect the power supply to the Red Pitaya board.

.. figure:: img/Master_and_slaves_2.jpg
:width: 70%
:width: 800

*******************************************************************
Download and install an X-channel streaming client on your computer
Expand All @@ -90,12 +91,12 @@ Download and install an X-channel streaming client on your computer
1. Connect to the PRIMARY board by entering the URL from the sticker into a web browser and launching the streaming app.

.. figure:: img/run_app.png
:width: 70%
:width: 800

2. Click the "Clients" button to get the client app for Linux or Windows and download it to your client's computer.

.. figure:: img/download_client.png
:width: 70%
:width: 800

*****************
Use case examples
Expand Down Expand Up @@ -128,7 +129,7 @@ In this example, we will show how to set configuration remotely using an already


.. figure:: img/settings.png
:width: 80%
:width: 800

.. code-block:: shell-session
Expand Down Expand Up @@ -232,6 +233,6 @@ In this example, we will show how to set configuration remotely using an already
<a href="https://www.audacityteam.org" target="_blank">Audacity</a>

.. figure:: img/audacity_2.png
:width: 80%
:width: 800

In this example, a 1 kHz sinewave signal was connected to all 6 inputs.
190 changes: 190 additions & 0 deletions appsFeatures/examples/multiboard_sync/daisy_chain-exm1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,196 @@ Wiring example:

**Pictures coming soon...**

Code - MATLAB
*************

The code should work for MATLAB R2019a or higher. There might be problems due to how MATLAB handles strings starting with MATLAB R2022b.

.. code-block:: matlab
%% ### DAISY CHAIN EXAMPLE ###
% This example is for setting up two units (one primary and one secondary)
% For multiple secondary units duplicate the code for the secondary unit
% and change the IP address and RP_SEC to for example, RP_SECx (where x is
% a consecutive secondary unit)
% This example is written for the X-channel System connected with SATA cables
%% Parameters
clear all;
close all;
clc
% Generation
wave_form = 'SINE';
freq = 100e3;
ampl = 1;
% Acquisition
dec = 2;
trig_lvl = 0.5;
trig_dly = 7000;
%% Set up the IP and SCPI server
IP_PRI = 'rp-f066c8.local'; % Primary unit
IP_SEC = 'rp-f0ac90.local'; % Secondary unit
port = 5000;
RP_PRI = tcpclient(IP_PRI, port); % create a TCP client object
RP_SEC = tcpclient(IP_SEC, port);
RP_PRI.ByteOrder = 'big-endian'; % Define byte order and terminator for both units
configureTerminator(RP_PRI, 'CR/LF');
RP_SEC.ByteOrder = 'big-endian';
configureTerminator(RP_SEC, 'CR/LF'); % defines the line terminator (end sequence of input characters)
flush(RP_PRI);
fprintf('Program start');
%% Reseting Generation and Acquisition
writeline(RP_PRI,'GEN:RST');
writeline(RP_PRI,'ACQ:RST');
writeline(RP_SEC,'GEN:RST');
writeline(RP_SEC,'ACQ:RST');
%%% ENABLING THE DAISY CHAIN PRIMARY UNIT %%%
writeline(RP_PRI,'DAISY:SYNC:TRIG ON');
writeline(RP_PRI,'DAISY:SYNC:CLK ON');
writeline(RP_PRI,'DAISY:TRIG_O:SOUR ADC'); % Select which trigger will be passed on over SATA
writeline(RP_PRI,'DIG:PIN LED5,1'); % indicator
fprintf('Trig: %s\n', writeread(RP_PRI,'DAISY:SYNC:TRIG?'));
fprintf('CLK: %s\n', writeread(RP_PRI,'DAISY:SYNC:CLK?'));
fprintf('Source: %s\n', writeread(RP_PRI,'DAISY:TRIG_O:SOUR?'));
%%% ENABLING THE DAISY CHAIN SECONDARY UNIT %%%
% this section must be copied if using multiple secondary devices (once for each device)
writeline(RP_SEC,'DAISY:SYNC:TRIG ON');
writeline(RP_SEC,'DAISY:SYNC:CLK ON');
writeline(RP_SEC,'DIG:PIN LED5,1'); % indicator
%% Generation - Primary unit
writeline(RP_PRI, append('SOUR1:FUNC ', wave_form));
writeline(RP_PRI, append('SOUR1:FREQ:FIX ', num2str(freq)));
writeline(RP_PRI, append('SOUR1:VOLT ', num2str(ampl)));
writeline(RP_PRI, 'OUTPUT1:STATE ON');
fprintf('Generation start\n');
%% Acquisition Setup
% Primary unit
writeline(RP_PRI, append('ACQ:DEC ', int2str(dec)));
writeline(RP_PRI, append('ACQ:TRIG:LEV ', num2str(trig_lvl)));
writeline(RP_PRI, append('ACQ:TRIG:DLY ', num2str(trig_dly)));
% Secondary unit
writeline(RP_SEC, append('ACQ:DEC ', num2str(dec)));
writeline(RP_SEC, append('ACQ:TRIG:LEV ', num2str(trig_lvl)));
writeline(RP_SEC, append('ACQ:TRIG:DLY ', num2str(trig_dly)));
%% Acquisition Start
fprintf('ACQ Start\n');
% First on secondary unit
writeline(RP_SEC, 'ACQ:START');
pause(0.05);
writeline(RP_SEC, 'ACQ:TRIG EXT_NE');
% Then on primary unit
writeline(RP_PRI, 'ACQ:START');
pause(0.05);
writeline(RP_PRI, 'ACQ:TRIG CH1_PE');
pause(0.1);
writeline(RP_PRI, 'SOUR1:TRIG:INT'); % Simulate a trigger
% Acquisition check if data is ready
% ## Primary unit ##
while 1
% Get Trigger Status
trigger = writeread(RP_PRI, 'ACQ:TRIG:STAT?');
if strcmp(trigger,'TD') % Triggerd?
break
end
end
fprintf('Trigger primary condition met.\n');
while 1
if strcmp(writeread(RP_PRI,'ACQ:TRIG:FILL?'),'1')
break
end
end
fprintf('Buffer primary filled.\n');
% ## Secondary unit ##
while 1
% Get Trigger Status
if strcmp(writeread(RP_SEC,'ACQ:TRIG:STAT?'),'TD') % Triggerd?
break
end
end
fprintf('Trigger secondary condition met.\n');
while 1
if strcmp(writeread(RP_SEC,'ACQ:TRIG:FILL?'),'1')
break
end
end
fprintf('Buffer secondary filled.\n');
%% Read and plot data
data_string_pri = writeread(RP_PRI,'ACQ:SOUR1:DATA?');
data_string_sec = writeread(RP_SEC,'ACQ:SOUR1:DATA?');
% Convert values to numbers.
% The first character in string is “{“
% and the last 3 are 2 spaces and “}”.
data_pri = str2num(data_string_pri(1, 2:length(data_string_pri) - 3));
data_sec = str2num(data_string_sec(1, 2:length(data_string_sec) - 3));
% Plotting
x = 0:16383;
% MATLAB 2019b or higher
t = tiledlayout(2,1); % for MATLAB r2023a use 'vertical'
nexttile
plot(x, data_pri)
title('Primary unit data')
ylabel('V')
xlabel('Samples')
nexttile
plot(x,data_sec)
title('Secondary unit data')
ylabel('V')
xlabel('Samples')
title(t, 'Acquired data')
writeline(RP_PRI,'DIG:PIN LED5,0');
writeline(RP_SEC,'DIG:PIN LED5,0');
writeline(RP_PRI, 'OUTPUT1:STATE OFF');
clear RP_PRI RP_SEC;
Code - Python
*************

Expand Down
33 changes: 32 additions & 1 deletion developerGuide/software/console/ssh/ssh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Access information for SSH connection:
* Password: ``root``

If you are unable to connect, check that Red Pitaya is connected to your :ref:`local network <isConnected>`.

Connection instructions are available for:

.. contents::
Expand Down Expand Up @@ -47,6 +47,37 @@ When connected to RP via SSH (PuTTy), you get the following command prompt scree

The last command prompt/terminal line should read as “root@rp-xxxxxx:~#“ (the default home directory on Red Pitaya is /root).

.. note::

After updating the OS or after some time has passed since the last SSH connection, you might get the following message when trying to establish an SSH connection.

.. code-block:: console
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
06:ea:f1:f8:db:75:5c:0c:af:15:d7:99:2d:ef:08:2a.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:4
RSA host key for domain.com has changed and you have requested strict checking.
Host key verification failed.
Do not worry, nothing is wrong with your Red Pitaya. The problem is that the Red Pitaya identification key has changed. To fix this use the following code:

.. code-block:: console
ssh-keygen -R rp-xxxxxx.local
And try to establish the SSH connection again.

Alternatively, open Explorer and go to **C:/Users/<your-username>/.ssh** and open the **known_hosts** file. Delete all lines containing *rp-xxxxxx.local*.


=====
Linux
=====
Expand Down
21 changes: 13 additions & 8 deletions quickStart/alucase/alucase.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Components

.. figure:: rp_alucase_02.jpg
:align: center
:scale: 50 %
:width: 600

Components of the Red Pitaya Aluminium Case.

Expand All @@ -24,7 +24,7 @@ Contents:

.. figure:: rp_alucase_03.jpg
:align: center
:scale: 50 %
:width: 600

Interior of the Red Pitaya Aluminium Case.

Expand All @@ -36,12 +36,12 @@ On the lower part, there are fits for a few air vents (left).
Apertures in the case expose connections to the expansion ports **E1** and **E2**.

.. figure:: rp_alucase_04.jpg
:scale: 40 %
:align: center
:width: 600

.. figure:: rp_alucase_05.jpg
:scale: 40 %
:align: center
:width: 600

*********************
Assembly Instructions
Expand All @@ -52,7 +52,7 @@ Assembly Instructions

.. figure:: rp_alucase_07.jpg
:align: center
:scale: 50 %
:width: 600

The bottom of the Red Pitaya board showing the plastic feet.

Expand All @@ -62,11 +62,10 @@ Assembly Instructions

.. figure:: STEMlab_10_heatsink.png
:align: center
:scale: 50 %

.. figure:: rp_alucase_08.jpg
:align: center
:scale: 50 %
:width: 600

The top of the Red Pitaya board showing the removed heat sink.

Expand All @@ -87,4 +86,10 @@ Assembly Instructions

.. figure:: rp_alucase.jpg
:align: center
:scale: 50 %
:width: 600






0 comments on commit 7598469

Please sign in to comment.