0

I have a certain Pi3 OUTSIDE that is collecting multiple data values at specific intervals. From that data set it is possible to generate various types of plots in gnuplot.

I would like to be able to connect into it multiple times in order to have several live plots running at once.

The live plotting is the easy part.

How can you watch gnuplot realtime data plots as a live graph, with automatic updates?

EXCERPT:

Each gnuplot program is using these two commands at the end so the plots update as new data comes in:

pause 24
reread

24 is arbitrary, since the data comes in every 120 seconds. Seemed prudent to try to avoid collisions.

I have tried using Windows Remote Desktop.

First thing to do is edit /etc/xrdp/xrdp.ini file so login screen prompts for the port number, with a default of 5910.

The first time I connect I must backspace over it and input a -1 at login, of course. If I disconnect I can always log back in with port 5910 and find that session still running.

My /etc/xrdp/xrdp.ini includes this:

[xrdp1]
name-sesman-Xvnc
lib-livnc.so
username=ask
password=ask
ip=127.0.0.1
port=ask5910

So first login after a reboot you change it to a -1. Then if you get disconnected you can leave it as 5910 and it will reconnect to your existing virtual session.

To achieve a second virtual session I have tried logging in and changing the port to 5911 the second time, and 5912. But each time it says problem connecting.

When I connect in using 5910 from a second PC it is the same virtual session so if I move a window it happens on both screens.

So, having tried RDP enough to know it isn't the answer, the question stands.

Can I achieve multiple independent sessions into a Raspbian Pi3?

SDsolar
  • 2,208
  • 8
  • 24
  • 42

1 Answers1

0

Short answer is YES.

Instead o fusing RDP, there is a much better way to achieve this, as spelled out in the answer to this question:

How can I set up my G-Mouse USB GPS for use with Raspbian?

EXCERPT (with edits to make it applicable to this answer):

If you want to run a remote graphical program remotely from another Linux machine(s) use these two commands together:

ssh -Y pi@OUTSIDE
gnuplot

The -Y is there to allow SSH to carry the X-11 output over ssh.

Scenario: I want to connect to my outdoor system which controls the solar tracker thaat moves the 3 sets of 2 100W panels to follow the sun. More importantly, it is being ventilated to keep the temperatures in a reasonable range for the electronics. It has a separate fixed 50W panel to keep a separate battery charged out there. It also measures the all-sky light intensity and an anemometer for wind speed. This is all accomplished with a combination of a Rpi3B with external antenna, connected by serial to an Arduino Nano that takes the reasings and prints them to seria where the Rpi has a program waiting to receive all the data, add a date and time stamp and write it to a data file. All readings are taken at 120-sec intervals, and all data is written into a tab-delimited CSV file which gnuplot can read with ease.

Here is the sequence to get three live plots from the same system:

Open terminal window
ssh -Y OUTSIDE
gnuplot
load "plt4    <--loads the data showing 4 temperature sensors

Open terminal window
ssh -Y OUTSIDE
gnuplot
load "pl12

Open terminal window
ssh -Y OUTSIDE
gnuplot
load "plux

Once the plots are running I resize the terminal windows and arrange them on the screen.

For good measure I do another terminal showing the ssh sequence.

Voila, here I have four independent sessions into the OUTSIDE system with three of them displaying live plots and the fourth one to show hostname before and after the ssh command:

enter image description here

That is the answer.


Background on why the ssh command worked so easily:

OpenSSH-server is loaded on both systems:

sudo aptitude install openssh-server

On the ALARMS system I ran these commands, ONCE:

cd
ssh-keygen       (Press enter to the 4 prompts)
ssh-copy-id -i .ssh/id_rsa.pub OUTSIDE      
(enter your password for OUTSIDE)
(It will then prompt you to try ssh to make sure it worked)

This can also be done in Windows with the PuTTY PSSH program.

First, I put C:\windows\Program Files (x86)/putty in my path using environment variables in the system configuration, advanced screen.

pssh pi@OUTSIDE

will do the same as ssh does in Linux.

For it to carry X-11 sessions takes some configuration. I know it works but haven't tested it yet

How to make Putty do the equivalent of “ssh -X”?

EXCERPT:

@baraboom's answer: You can enable X11 Forwarding in Putty's configuration. In the menu on the left, find the Connection tree. In SSH, expand it and you will see Tunnels window. Click "Enable X11 forwarding". It is setting the default to X display at "localhost:0".

SDsolar
  • 2,208
  • 8
  • 24
  • 42
  • 1
    Using xrdp, I am not aware of anything. However: are you limited to using rdp for some reason? – bobstro Jul 08 '17 at 22:47
  • 1
    Try opening a single ssh session with X forwarding enabled, then entering each of the 3 commands followed by '&' to run as a background task. – bobstro Jul 08 '17 at 23:20
  • You hit the nail right on the head, @bobstro. Oncew I took off my blinders I could see SSH and how I had used it for X-11 output when I was installing my GPS. https://raspberrypi.stackexchange.com/questions/68816/how-can-i-set-up-my-g-mouse-usb-gps-for-use-with-raspbian +2 – SDsolar Jul 09 '17 at 00:04