Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host and port config #2

Open
JaniKallankari opened this issue Nov 17, 2019 · 8 comments
Open

host and port config #2

JaniKallankari opened this issue Nov 17, 2019 · 8 comments

Comments

@JaniKallankari
Copy link

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
Copy link
Owner

coburnw commented Nov 18, 2019

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
Copy link

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
Copy link
Owner

coburnw commented Dec 4, 2019

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:

  • look into enabling native windows NFS in windows if your edition supports it.
  • look into running a minimal install of Cygwin with RPCBind in windows. In this case Cygwin's only role would be portmapping and would interact with your windows vxi11_server and its clients via localhost.
  • try to find a third party RPCBind such as HaneWIN or others
  • If there isnt one already, implement an RPCBind service in Python. That should be worth a couple Github stars. The RPC client in this repository might be a good starting point.

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
Copy link

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
Copy link
Owner

coburnw commented Apr 19, 2021

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
Copy link

raphaelvalentin commented Apr 19, 2021 via email

@raphaelvalentin
Copy link

raphaelvalentin commented May 13, 2021

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:

  • Install cygwin from Cygwin Setup (setup-x86_64.exe) available for download at the cygwin website.
  • During installation, select and install the package rpcbind (version 0.2.1-1; it seems the version 1.2.5-1 leads somehow to some difficulties). Substantially, it may be relevant to install the packages python38 and python38-pip to start vxi11-server from cygwin.
  • In cygwin terminal, start rpcbind service using the command /usr/sbin/rpcbind.exe -i (insecure mode).

Accessory:

  • since cygwin can be a bit raw without many installed packages, stop rpcbind service can be done using the commands ps | grep rpcbind (which provides the process id) and kill -9 {xxx} where {xxx} is the process id of rpcbind.

Sincerely,
Raphael

@coburnw
Copy link
Owner

coburnw commented May 14, 2021

Perfect
Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants