coburnw / python-vxi11-server

A VXI-11 Instrument Server written in Python
27 stars 13 forks source link

host and port config #2

Open JaniKallankari opened 4 years ago

JaniKallankari commented 4 years ago

Hi, I'm trying to get this code running in Windows and python 3. Only few modifications is needed to get the syntax right for pyhton3 (exceptions and SocketServer naming). I have some problems how the host='' and port=0 parameters are changed in Vxi11CoreServer and Vxi11AbortServer? The only way I found to do this is change default parameters in instrument_server.py file. Are there any better way to do this?

coburnw commented 4 years ago

Im afraid you might be a trail blazer here. I have never used this code on windows...

And to preface, it has been a year or so since i have messed with the rpc portmapping so be sure to challenge me if something doesnt sound right...

With host='' the socketserver determines the host ip address itself and with port=0 it grabs the next available port number. The resulting ipa and port# are then registered with the rpc portmapper whose role is to return the correct port number to any incoming rpc queries. In other words, in normal use you shouldnt have to define an address or port. The rpc code takes care of all that for you.

Have you managed to get the stock code to work with the demo server? Have you seen an 'rpcbind -i not running' error? If so have a look at the linux man page for rpcbind. I know you are running windows but that might get you started in your research on what the windows analog is.

So the question is: is something not quite set up right or coded right for windows or python3, or are you trying to do something different than the norm and need access to those properties?

Coburn

SamuelDeleglise commented 4 years ago

Hi, I am also desperately trying to have this work on windows. For the moment, I tried python 27 only to make things simpler, and indeed, it looks like one can get slightly closer to a working point when modifying the address and port to 'localhost' and 4880 (resp 111) at lines 169 and 183 of instrument_server.py

In this case, the server seems to be waiting for a connection.

I then change the timer_client.py line 3 to

default_instr = vxi11.Instrument("TCPIP::localhost::111::INSTR")

however the client stalls forever at the line 9

default_instr.write('*IDN?')

@JaniKallankari, I would be very interested if you could post the exact steps you took to have the client/server communicate on windows, this would be already a very nice starting point for me !

Thanks a lot, Samuel

coburnw commented 4 years ago

Hi Samuel,

I suspect the problem you are fighting is the windows RPCBind or Portmapper service isnt running. Have you seen an 'rpcbind -i not running' error with an unmodified clone?

From poking around on the web, it appears that only some editions of windows comes packaged with RPC support. The RPC services must be installed when NFS is enabled in your OS. If you are lucky enough to have one of those editions of windows, try enabling NFS to get the RPC service running. The python_vxi11_server might then work without modification on windows.

To be clear, it is not NFS that you need but the underlying RPC services that support both NFS and VXI-11, specifically the RPCBind/Portmapper service.

These might be avenues to research. They are untested:

That said, i suspect one could subvert the portmapper, but then its not really VXI-11 anymore.

Please keep us posted. It would be nice to know what could be added to the list and what does and doesnt work.

Regards,

Coburn

raphaelvalentin commented 3 years ago

Dear, a solution is to use Cygwin and install rpcbind 0.2.1 as well as python3. On my side, this seems working pretty well on Windows. Raphael

coburnw commented 3 years ago

Raphael,

If you were interested and had the time to draw up a quick gist of the steps required to run rpcbind in a cygwin instance in windows, i would be quite happy to add a link to the readme.

Regards, c.

raphaelvalentin commented 3 years ago

Dear Coburn, Yes, I will do. No time however for the next 2 weeks at least (not in lab)


Raphaël.


From: Coburn @.> Sent: Tuesday, April 20, 2021 1:26:24 AM To: coburnw/python-vxi11-server @.> Cc: raphael valentin @.>; Comment @.> Subject: Re: [coburnw/python-vxi11-server] host and port config (#2)

Raphael,

If you were interested and had the time to draw up a quick gist of the steps required to run rpcbind in a cygwin instance in windows, i would be quite happy to add a link to the readme.

Regards, c.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/coburnw/python-vxi11-server/issues/2#issuecomment-822642953, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC5BEGDNDZW23YKBT5IKWY3TJRRUBANCNFSM4JOITQUQ.

raphaelvalentin commented 3 years ago

Dear Coburn, I apologize for the delay of my response. I have been busy with many parallel tasks last months.

Run rpcbind in a windows environment:

Accessory:

Sincerely, Raphael

coburnw commented 3 years ago

Perfect Thank You!