-
Notifications
You must be signed in to change notification settings - Fork 18
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
Could not read system.ini!!! #3
Comments
@vedrancek Sorry for the trouble. FWIW, I am using this code with an XPS-D (and C and Q!), so I think that we should be able to get it to work. Offhand, I have 3 thoughts: a) can you provide the full traceback to see where |
@vedrancek a quick test suggests that |
@newville thank you for the quick response and sorry for my later one. I was out of the office. Yesterday I went through the code and for starters I wanted to know if all libraries and modules can be manually loaded from python prompt. When entering:
Did I something forgotten to install? When installing your driver I ran setup.py Also since I am at the beginning of my Phthon journey, could you please guide me, how to do a traceback to see where read_systemini() is failing? Cheers, |
@vedraneck Well, after installing with
Connecting to a running XPS could then be
or whatever IP address your XPS is using. Alternatively, you could connect to the XPS using the lower-level interface:
and so forth. |
Hi @newville I am facing the same issue. I have attempted both remote (DHCP-assigned IP In both cases, system.ini could not be read. Any suggestions? How do I run full trace on |
@hududed When you say that you are saying that you are "facing the issue" to an issue that is six months old, you force anyone who might try to help you to read the older issue, see what that was about, what any resolution might have been and how it might apply to the new report. So rather than spend time trying to understand your trouble, I went back to try to understand the previous problem. As it turns out, I don't know what the solution to the earlier report really was. I made some suggestions but never heard back what the problem was. Do want to focus on how this is like that unresolved issue? You include no code and no traceback or any indication that you tried any of the suggestions made for the apparently similar problem. |
I apologize. I ran the following:
and got the first error: I ran
I ran just these codes above with the device connected as remote, as host, and manual configuration (pg. 7 of this) of X Y and Z axes as single axes, as well as XY-grouped and Z axes - as you suspected from the previous issue above (see also my As to the traceback, I am not sure how to provide this and need your advise. My system.ini file:
|
@hududed Hm, not sure. I guess we should comment out the bare "try / except" in
I would suggest making that change and trying again - that should at least try to expose the problem better. |
I think you're right. Continuing from before, if I run
I am not too familiar with sftp and hostkeys, I am inclined to set this off (although I am not sure how to do that) but this maybe a security-risk. Is the hostkey something delivered with the XPS-D instrument? Or something we set ourselves? Or was this code written with an older version of |
@hududed Hm, I'm not sure - I don't see that problem, and I'm pretty sure I don't have hostkeys set for the XPS-D. Please let us know if you figure something out that works! |
Hello @newville after some debugging I am more certain it has to do with the connection and
The code stops at the final line here, which steps into
then the connection would not work but the ValueError is not raised:
Could you check which version of the |
@hududed I'm using pysftp 0.2.9 and Python 3.7.4 (from Anaconda Python) on Centos7. I think the good news is that you can just debug that to figure out what is going on with the This all sort of worked for me, so I have not investigated in detail. But I do see this:
So, I would guess that is probably what you need to get too. The XPS-D I connect to is listed in my
I do not recall adding that by hand, but I probably did a test using the command-line sftp to this machine early on. I hope we can come up with a better "user guide" on this topic, once we figure it out! |
Oh! I have an intermediate solution by disabling the hostkey check - but ofc this has security risks.
I made the PR for the intermediate solution anyway. So, I guess the question is how does one attain this |
@hududed Oh, for me that is just the real IP address of the XPS-D I'm using, assigned with our DHCP server. |
Hello all, long time no hear from me. I had to focus on another project with the system so I had to put this aside. I still want to try to run the driver from Python so as soon as I will be finished I will go back and try to make it work. Hopefully, this will be in the next 3-4 months. I will be back with updates on my progress. Thanks and regards, |
@vedrancek Well, I think I never really understood the problem you were having. @hududed sort of took over this conversation, with an issue that is maybe related. From my perspective, revisiting old conversations sort of means that you expect me to remember the details of the unresolved issue. And, like, I'm not going to remember. And for sure, give a good report. If you don't include an actual script and a traceback that will be the first thing I ask about. |
if need be we I can open new issue - but I thought there's overlap here. With regards to setting the SSH, I am using puttyGen to create the keys, but from what I read I have to place the public key in |
@hududed I think that |
I have decided to skip this ssh problem, since the read_systemini works and I can control the motors for now. |
@hududed OK, did you ever resolve the problem with |
@newville unfortunately I didn't, but this may be due to my inexperience with assigning SSH public key specifically to the instrument. I used these steps which did not work (see the steps in Copy Public Key To Server):
|
fwiw I'm seeing the exact same symptoms after installing newportxps from the repo using conda pip. The first symptom was "Could not read system.ini!!!" with no other clues. After installing pysftp the error gets more specific as indicated in the thread:
I'll pursue the other clues in this thread to see if I can get past this. (The "_sftp_live" issue would seem to be a separate small problem). Thanks! (edit)
Thanks for the thread! |
@lockhart OK, that sounds like several people have seen this and agree on a fix. The current master version is tagged as v0.2 and should have better error messages when pysftp fails to connect in this way. |
Not sure if this is relevant here, but somehow my PC has a specific error with pysftp. I updated newportxps to v0.2, although its the same error with v0.1 now .. When initializing Looking further, it seems pysftp never finds any keys for me now. I previously overcome this by disabling the
Has anyone experienced this ? Or does anyone know where the official pysftp repo is so I can raise the issue there |
@hududed that looks very much like the same real problem: "No Host Keys Found" is sftp telling you that it cannot find host keys. To communicate with the XPS-D, you do need to be able to connect to it with sftp. |
@newville This is rather different, from this quote from Aug 3 above - I was able to run |
@hududed yeah, sorry but I just don't think I can really offer any advice other than "get sftp" to work. If you have done I think this is really not an issue with the newportxps python module, except insofar as it wasn't giving a very informative message about why it could not read the system.ini file, and that is now fixed. |
I have found the issue.
|
@openindus Sorry for the trouble. But I think that as with previous cases here, the issue is probably really about getting your workstation/ computer to connect with sftp to the Newport XPS-D controller. Well, I'm assuming that you are trying to connect to an XPS-D, but am not certain of that. It seems odd that your traceback looks like it is using the ftplib. Can you verify whether this is an XPS-D or an older "Q" or "C" model? Maybe the problem is in our "identify the firmware model of this XPS" code. |
Thanks for this remark. |
@openindus Ah, OK. That must be some new variation of a controller - I see now that's a hexapod controller, possibly with some different functionality -- and you can get a little game controller to run it... that's kind of cool. I have not looked any further, but are there any other features to expose? If changing the "firmware version" to match "HXP-D" or "XPS-D" works, then I can update the code for the next person who wants to use one of these. |
Hello, |
@openindus I don't know what the new hexapod functions are. Do you know whether there is an update to |
I am using the HXP50-MECA Hexapod with the HXP50-ELEC-D controller. I ran into the same problem cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
self._conn = pysftp.Connection(self.host,
username=self.username,
password=self.password,
cnopts=cnopts) They say this might be a bug in pysftp but as long as its not fixed on their side i think it should be circumvented in the newportxps module. However, with this small change everything works like a charm! Thank you so much for this!! |
@maxawake hm, weird but believable. Do you think it would be reasonable to do something like this in SFTPWrapper.connect():: try:
self._conn = pysftp.Connection(self.host, username=self.username, password=self.password)
except: # should this be a specific exception about Hostkeys?
try:
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
self._conn = pysftp.Connection(self.host, username=self.username, password=self.password,
cnopts=cnopts)
except: # ok, really failed
print(f"ERROR sftp connection to {self.host} failed")
print(helpful_hints_for_sftp) |
Hello,
I have a XPS-D controller with the following information:
Snapshot version: XPS-D-N13018
QNX kernel version: QNX kernel configuration V3.0.22 (20191107, SYSTEM, apic mode)
Stage database revision: StageDataBase V4.3.6 - XPS Controller
When trying to connect to connect to it:
I have system.ini file on the controller and when connecting the controller with dedicated software that came with the whole system there is no problem. Also, everything from the web interface of the controller side looks fine.
Also when trying to connect to it, there are no other open connections with the controller.
I am using Python 3.7.4.
Any ideas, suggestions? What did I miss? Please advise.
This is the system.ini file:
`; #########################################################################################
; # Generated from manual configuration by Administrator on Fri, 20 Dec 2019 18:07:40 GMT #
; #########################################################################################
[GENERAL]
BootScriptFileName = SetGPIO3output1.tcl
BootScriptArguments =
[GROUPS]
SingleAxisInUse = Z, P
SpindleInUse =
XYInUse = XY
XYZInUse =
MultipleAxesInUse =
; #############################################
; # Single axis group 'Z' and its positioner: Z
[Z]
PositionerInUse = Z
[Z.Z]
PlugNumber = 5
StageName = IMS@IMS100V@XPS-DRV11
SecondaryPositionerGantry = Disabled
; #############################################
; # Single axis group 'P' and its positioner: P
[P]
PositionerInUse = P
[P.P]
PlugNumber = 4
StageName = AXIS_PZ
SecondaryPositionerGantry = Disabled
; ##############################################
; # XY axes group 'XY' and its positioners: X, Y
[XY]
PositionerInUse = X, Y
InitializationAndHomeSearchSequence = Together
XMappingFileName =
XMappingLineNumber = 0
XMappingColumnNumber = 0
XMappingMaxPositionError = 0
YMappingFileName =
YMappingLineNumber = 0
YMappingColumnNumber = 0
YMappingMaxPositionError = 0
[XY.X]
PlugNumber = 1
StageName = AXIS_X
SecondaryPositionerGantry = Disabled
[XY.Y]
PlugNumber = 2
StageName = AXIS_Y
SecondaryPositionerGantry = Disabled
`
Thank you in advance!
Best regards,
Vedrancek
The text was updated successfully, but these errors were encountered: