From: daniele p. <pag...@ya...> - 2005-05-12 22:41:37
|
I think that corresponding to the interface there is a file named /dev/gpib or /dev/gpib0. Try chmod 777 /dev/gpib* I'm not sure... i'm not working with gpib for the moment and don't have access to the machine where I worked. BTW, python is a very good choose :) I used it with ctypes importing directly the functions from the C library and worked fine. Bye, daniele Tate Wilson ha scritto: > Daniele, > Thanks for the reply. You are correct that the libraries are > available to an ordinary user after running gpib_config as root. But > the python module seems to need further root input. The functions in > the python module, such as gpib.write() or gpib.read() take a device > id as an argument. This id is set using gpib.find(), but this can > only be done by root. So, for example, I have a voltmeter at address > 4 and there is an entry for it in /etc/gpib.conf . I can access it > as a regular user using C or using example scripts that came with > linux-gpib, so I know it works. The following python works if I run > it as root, but fails on the gpib.find() call if I run it as an > ordinary user: > > >>>import gpib > >>>dmm = gpib.find('voltmeter') > >>>gpib.write(dmm, 'F1R1X') > > If I run this as an ordinary user the error is: > > >>>dmm = gpib.find('voltmeter') > libgpib: ibBoardOpen failed to open device file > libgpib: Permission denied > libgpib: error in is_cic()! > libgpib: ibfind failed to get descriptor > Traceback (most recent call last): > File "<stdin>", line 1, in ? > gpib.error: Find Error: can't find device! > >>> > > If I don't use gpib.find() at all, I have no way to tell the other > functions which device to talk to. > > thanks, > tate > > > daniele paganelli wrote: > >> You should configure your devices and interfaces in /etc/gpib.conf >> with all necessary information. >> Then, the only command you need to run from root is "gpib_config", >> without any command. All the interfaces and devices you configured >> will be available from python or C (as far I have experienced) from >> the userspace. >> So, if you don't want to or you can't run from root that program, you >> can try to link it in the rc2.d directory, so it is called at startup. >> You will not need to call again gpib_config as long as your hardware >> configuration doesn't change, or a serious error occur. >> Anyway, you need root priviledges to modify /etc/gpib.conf and link >> gpib_config for autorun, at least one time. >> >> hope it works, >> daniele paganelli >> >> Tate Wilson ha scritto: >> >>> Hello all, >>> I am trying to use the built-in python extension for linux-gpib in a >>> data taking program written entirely in python. The problem is, so >>> far I can only get the extension to work running as root, and I need >>> it to run as an ordinary user. The problem seems to be that I have >>> to use gpib.find() to set an id for a device, but this function can >>> only run as root. Is that true? Am I missing something? >>> >>> thanks, >>> tate >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by Oracle Space Sweepstakes >>> Want to be the first software developer in space? >>> Enter now for the Oracle Space Sweepstakes! >>> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click >>> _______________________________________________ >>> Linux-gpib-general mailing list >>> Lin...@li... >>> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general >>> >> >> > -- )))))))))))))))))))))))))))))))))))))))) Daily Indigest: http://blog.daniele.homelinux.org Vieni a visitarmi nel mio nuovo blog! ()()))))()))))))))))())))))()()()()()))) ()))()))())))))))))())())))()))))))()))) ()))()))()))))))))())))()))()))))))))))) ()(())))())))))))()))))()))()))))))))))) ()))()))())))))))())))())))()))()()()))) ()))()))()))))))))())()))))()))))()))))) ())())))()()()())))()))))))()()()())))() -- )))))))))))))))))))))))))))))))))))))))) Daily Indigest: http://blog.daniele.homelinux.org Vieni a visitarmi nel mio nuovo blog! ()()))))()))))))))))())))))()()()()()))) ()))()))())))))))))())())))()))))))()))) ()))()))()))))))))())))()))()))))))))))) ()(())))())))))))()))))()))()))))))))))) ()))()))())))))))())))())))()))()()()))) ()))()))()))))))))())()))))()))))()))))) ())())))()()()())))()))))))()()()())))() |
From: Mike D. <mik...@nr...> - 2005-05-13 13:08:03
|
On Fri, 13 May 2005 00:40:36 +0200 daniele paganelli <pag...@ya...> wrote: > I think that corresponding to the interface there is a file named > /dev/gpib or /dev/gpib0. > > Try chmod 777 /dev/gpib* > I'm not sure... i'm not working with gpib for the moment and don't > have access to the machine where I worked. This is not the best idea from a security viewpoint. > Tate Wilson ha scritto: > > > > >>>import gpib > > >>>dmm = gpib.find('voltmeter') > > >>>gpib.write(dmm, 'F1R1X') > > > > If I run this as an ordinary user the error is: > > > > >>>dmm = gpib.find('voltmeter') > > libgpib: ibBoardOpen failed to open device file > > libgpib: Permission denied I think the way it is supposed to work is that you should add your user account to the gpib group. Log out and back in and your user should now have access to the gpib driver. Mike -- Mike Denhoff |