EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Solved] g_file_read (used in aravislib, areadetector) fails when running on a remote machine via ssh
From: Heinz Junkes <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Fri, 20 Nov 2015 17:24:08 +0100
Packets for gvfs (and gvfs-backends where missing) :-(

After installing 

ii  gvfs:amd64                                  1.20.3-0ubuntu1.2                          amd64        userspace virtual filesystem - GIO module
ii  gvfs-backends                               1.20.3-0ubuntu1.2                          amd64        userspace virtual filesystem - backends
ii  gvfs-bin                                    1.20.3-0ubuntu1.2                          amd64        userspace virtual filesystem - binaries
ii  gvfs-common                                 1.20.3-0ubuntu1.2                          all          userspace virtual filesystem - common data files
ii  gvfs-daemons                                1.20.3-0ubuntu1.2                          amd64        userspace virtual filesystem - servers
ii  gvfs-libs:amd64                             1.20.3-0ubuntu1.2                          amd64        userspace virtual filesystem - private libraries

aravislib runs on an ioc too.

Heinz


> On 19 Nov 2015, at 15:00, Heinz Junkes <[email protected]> wrote:
> 
> Hi all,
> 
> I am still fighting with glib running within procserv (or remote via ssh).
> 
> The aravislib used in areadetector to connect to GigE (Genicam) cameras uses glib.
> 
> Running the stuff locally works well. Running it remotely it fails.
> 
> Testfile:
> 
> h1@earth:~/ARAVIS/aravis/tests$ more loadhttptest.c
> 
> #include <glib.h>
> #include <gio/gio.h>
> #include <stdlib.h>
> #include <stdio.h>
> #include <arv.h>
> 
> int
> main (int argc, char **argv)
> {
> 	GFile *file;
> 	GFileInputStream *stream;
> 	const char *filename;
> 	char *genicam = NULL;
> 	char **tokens;
> 	gsize len = 0;
> GError *err = NULL;
> 
> 	if (argc != 2) {
> 		printf ("Usage: load-http-test <URL>\n");
> 		return EXIT_FAILURE;
> 	}
> 
> 	filename = argv[1];
> 
> 	tokens = g_regex_split (arv_gv_device_get_url_regex (), filename, 0);
> 
> 	if (tokens[0] != NULL && tokens[1] != NULL) {
> 		if (g_ascii_strcasecmp (tokens[1], "http:") == 0) {
> 			file = g_file_new_for_uri (filename);
> 			stream = g_file_read (file, NULL, &err);
> 
> if (err != NULL) {
>             g_error("Could not open %s for reading: %s\n", filename, err->message);
>             g_error_free(err);
>             return 1;
>      }
> 
> 
> 			if(stream) {
> 				GDataInputStream *data_stream;
> 
> 				data_stream = g_data_input_stream_new (G_INPUT_STREAM (stream));
> 				genicam = g_data_input_stream_read_upto (data_stream, "", 0, &len, NULL, NULL);
> 
> 				g_object_unref (data_stream);
> 				g_object_unref (stream);
> 			}
> 			g_object_unref (file);
> 		}
> 	}
> 
> 	g_strfreev (tokens);
> 
> 	printf ("size = %lu\n", len);
> 	printf ("%s\n", genicam != NULL ? genicam : "NULL");
> 
> 	g_free (genicam);
> 
> 	return EXIT_SUCCESS;
> }
> 
> 
> Running it locally it shows:
> 
> h1@earth:~/ARAVIS/aravis/tests$ ./load-http-test http://141.14.128.47/dias_gige_desc.xml
> size = 64451
> <?xml version="1.0" encoding="utf-8"?>
> 
> <RegisterDescription
>        ModelName="Pyroview"
>        VendorName="DIAS"
>        StandardNameSpace="None"
>        SchemaMajorVersion="1"
>        SchemaMinorVersion="0"
>        SchemaSubMinorVersion="1"
>        MajorVersion="1"
>        MinorVersion=“ …
> 
> …
> 	<IntSwissKnife Name="NOT_TLParamsLocked">
> 		<ToolTip>Negation of the TLParamsLocked value</ToolTip>
> 		<Visibility>Invisible</Visibility>
> 		<pVariable Name="TLPL">TLParamsLocked</pVariable>
> 		<Formula>(TLPL = 0) ? 1 : 0</Formula>
> 	</IntSwissKnife>		
> 
> </RegisterDescription>
> 
> Running it remote via ssh it shows :
> 
> h1@earth:~/ARAVIS/aravis/tests$ ./load-http-test http://141.14.128.47/dias_gige_desc.xml
> 
> ** (process:11455): ERROR **: Could not open http://141.14.128.47/dias_gige_desc.xml for reading: Operation not supported
> 
> Trace/breakpoint trap (core dumped)
> 
> 
> I assume problems with dbus/session/stream stuff. About one year ago I could overcome the problem by adding the
> following to the st.cmd used by procserv :
> 
> 
> #!/bin/bash 
> 
> PID_FILE=/tmp/dbus_pid
> 
> if [ -a $PID_FILE ]
>  then
> #   echo "$PID_FILE exists ..."
>    PID=`cat $PID_FILE` 
> #   echo "kill_pid $PID"
>    kill -9 $PID
> fi
> 
> if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
>  ## if not found, launch a new one
>  eval `dbus-launch --sh-syntax --exit-with-session`
>  echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
>  echo "$DBUS_SESSION_BUS_PID" >$PID_FILE
> fi
> #date
> #sleep 1
> #/usr/local/bin/arv-tool-0.4 -n 'DIAS Infrared GmbH-C1076026' genicam >/tmp/dias_genicam.out
> #sleep 1
> #date
> cd /srv/ioc/sys/iocBoot/iocdias
> ./st.cmd
> #kill -9 $DBUS_SESSION_BUS_PID
> 
> 
> But this doesn’t help anymore.
> 
> Any Ideas?
> Thx Heinz
> 
> 
> 
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


References:
g_file_read (used in aravislib, areadetector) fails when running on a remote machine via ssh Heinz Junkes

Navigate by Date:
Prev: g_file_read (used in aravislib, areadetector) fails when running on a remote machine via ssh Heinz Junkes
Next: Re: synApps modules will move to GitHub: optics, softGlue, sscan, stream, support Pete Jemian
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: g_file_read (used in aravislib, areadetector) fails when running on a remote machine via ssh Heinz Junkes
Next: Successfully locked memory using mlockAll Henrique Dante de Almeida
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·