issue with Drawnow

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

issue with Drawnow

Cleyderman Guerrero
Hello Team,

I have the following issue when I execute my script. My script once worked
fine it, now, I have this issue.

This is my script:

*clear all;
close all;
clc;

l1 = line (nan, nan, 'Color', 'r', 'LineWidth', 2);

ylim ([-.1 5.1]);
N = 1000;
fs=500;
xlim ([0 (N-1)/fs]);
grid
Stop = 1;
uicontrol('Style', 'Pushbutton', 'String', 'Stop', ...
    'Callback', 'Stop = 0;');
y1 = zeros (N, 1);
t1 = linspace (0, (N-1)/fs, N);
%t2 = linspace (0, (2*N-1)/fs, 2*N);

fl = '/home/pi/Desktop/adc0832/val.txt';
dl1 = ' ';

tic

while Stop

    if toc > inv(fs)
        tic

        var = load ('/home/pi/Desktop/adc0832/val.txt');
        %var = dlmread(fl, dl1);

        %d=var.data;
        %m=mean(d);
        y1 = shift (y1, -1);
        y1(end) = var;

        %test = conv(y2, cos(2*pi*2*t1));
        set (l1, 'XData', t1, 'YData', y1);
        drawnow

    end

end
close all
clear all
clc*


And the output is this:

No protocol specified
octave: unable to open X11 DISPLAY
octave: disabling GUI features
No protocol specified
No protocol specified

gnuplot: unable to open display ':10.0'
gnuplot: X11 aborted.
error: __go_draw_figure__: unknown object class, uicontrol
error: called from
    __go_draw_figure__ at line 187 column 13
    __gnuplot_drawnow__ at line 86 column 5
    adquisicionygraficacion.m at line 39 column 9
No protocol specified

gnuplot: unable to open display ':10.0'
gnuplot: X11 aborted.

gnuplot> nset obj 1;
         ^
         line 0: invalid command

could somebody help me with this?

Best regards,

Cleyderman Guerrero




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: issue with Drawnow

Mike Miller-4
On Mon, Aug 27, 2018 at 11:15:12 -0500, Cleyderman Guerrero wrote:

> And the output is this:
>
> No protocol specified
> octave: unable to open X11 DISPLAY
> octave: disabling GUI features
> No protocol specified
> No protocol specified
>
> gnuplot: unable to open display ':10.0'
> gnuplot: X11 aborted.
> error: __go_draw_figure__: unknown object class, uicontrol
> error: called from
>     __go_draw_figure__ at line 187 column 13
>     __gnuplot_drawnow__ at line 86 column 5
>     adquisicionygraficacion.m at line 39 column 9
> No protocol specified
>
> gnuplot: unable to open display ':10.0'
> gnuplot: X11 aborted.
>
> gnuplot> nset obj 1;
>          ^
>          line 0: invalid command
>
> could somebody help me with this?
It looks like you are trying to plot figures on-screen while logged in
remotely to a Raspberry Pi, is that correct? Are you logging in with
'ssh -X'? Do other graphical programs display correctly?

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: issue with Drawnow

Cleyderman Guerrero
Hello Mike,

I access with RDP to the Raspberry PI. is this the reason?

Thank you in advance.

Kind regards,

Cleyderman Guerrero



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: issue with Drawnow

Cleyderman Guerrero
In reply to this post by Mike Miller-4
Hello Mike,

I tried to execute my script without access to RDP and it works. Why when I
access with RDP don't work? Could you give me a recommendation about what to
do?

Best regards,

Cleyderman Guerrero




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: issue with Drawnow

Mike Miller-4
On Tue, Aug 28, 2018 at 08:16:51 -0500, Cleyderman Guerrero wrote:
> I tried to execute my script without access to RDP and it works.

I guess that means that the DISPLAY environment variable is not set, so
Octave falls back to drawing plots using gnuplot's text terminal output.

> Why when I
> access with RDP don't work? Could you give me a recommendation about what to
> do?

I don't know, I guess this depends a lot on your configuration.

  * What does it mean to run the script "with access to RDP" or "without
    access to RDP"?
  * Are you setting or unsetting environment variables?
  * Are you logging in to the Pi differently with or without RDP?
  * Are you enabling or disabling some service?
  * Are you running the Octave GUI remotely somehow, or are you
    using SSH to run Octave's console mode in both scenarios?
  * Are you setting the DISPLAY environment variable correctly with RDP
    enabled?
  * Do other graphical programs work in this configuration?

--
mike



signature.asc (849 bytes) Download Attachment