epics-modules / xspress3

EPICS areaDetector xspress3 module
GNU Lesser General Public License v3.0
4 stars 18 forks source link

EPICS ioc can't connect to xspress3 for versions 3.2.7 and 3.2.8 #51

Closed oksanagit closed 6 months ago

oksanagit commented 7 months ago

Since CentOS7 is retiring this June, I am porting xspress3 to RHEL8 and using this opportunity to update the software. We have xspress3 mini 1 channel. I built RHEL8 system on Z-Box, and epics support using the latest released modules required.
Swapped the cable from the existing CentOS 7 to the new system and could not connect to the xspress3 unit. The error message generated while I was connecting the cable was:

2024/04/11 13:48:52.370 API Error Message: xsp3_config: xsp3_config: Cannot initialise Fem 192.168.0.2 on port 30123.
2024/04/11 13:48:52.370 EPICS Driver Calling Function: Xspress3::connect.
2024/04/11 13:48:52.370 XF:23ID2-ES{Xsp:1}:det1:CONNECT devAsynInt32::processCallbackOutput process write error 
2024/04/11 13:48:52.370 Xspress3::checkConnected ERROR: We are not connected.
2024/04/11 13:48:52.370 XF:23ID2-ES{Xsp:1}:det1:TriggerMode devAsynInt32::processCallbackOutput process write error 

Then I checked out and rebuilt different versions of xspress3. 2-6 I can connect to the device 3.2.7, 3.2.8, and master I have a connection error. epics> dbgf XF:23ID2-ES{Xsp:1}:det1:DetectorState_RBV DBF_STRING: "Disconnected"

May be the 3.x.x versions are for the latest Quantum hardware/firmware?

newville commented 7 months ago

@oksanagit Sorry for the trouble. I am not sure what the trouble is, and I am sure that the 3.2 series has been used with xspress3 mini. Are you using the same settings files, and have you checked (or cleared) the xspress files in /dev/shm? Maybe show the whole log?

FWIW, we build xspress3 on CentOS9 stream many months ago. With the APS shut down and my main detector still in the shop, I have not done any testing or work with xspress3 in many months. Over the next couple of months, I hope to a) install RHEL9.3 on the machine running our xspress3, b) test basic functionality with an ME-4 detector, and c) continue investigating "circular buffer mode" which was giving me troubles. But at the moment, nothing is hooked up.

oksanagit commented 6 months ago

@newville thanks. I am using same settings, I think I did. The default location of the settings has been changed in the 3.2, I pointed to right place.

This is the content of my /dev/shm/ folder

-rw-------. 1 root   root       82488 Feb 22 03:20 libpod_lock
-rwxrwxrwx. 1 oksana oksana 268432562 Apr 11 12:58 xsp3_scope0

not sure what to delete. This is a freshly built RHEL8. I do not see the log. Where it is supposed to be?

For now we are running 2-6 . I will continue looking into this issue as access to the equipment allows.

newville commented 6 months ago

@oksanagit I don't recognize the libpod file. You should be able to remove that xsp3_scope0 file: any "xsp3' file there should be created by the xspress3 server (and so any IOC). Well, I think "if connected".

It's hard for me to guess what could be going wrong.

Can you run the autocalibration script /usr/local/bin/xspress3_autocalib?

Did you have any trouble building the xspress3 code?

Do you see any error messages when loading the databases from the startup script?

oksanagit commented 6 months ago

Can you run the autocalibration script /usr/local/bin/xspress3_autocalib?

I was not able to install xspress3_autocalib software and in-contact with Quantum. What I did is copied the "perfect" calibration from Centos7 machine.

Did you have any trouble building the xspress3 code?

No problem building

Do you see any error messages when loading the databases from the startup script?

Let me get access to the detector and repeat everything .

Thank you @newville

oksanagit commented 6 months ago

@newville , Attaching the startup log. epicsOutput.txt

I see now this error: 2024/04/19 12:33:37.867 API Error Message: xsp3_set_run_flags: path 0, flags=0000010C, Circulr buffer mode only available with 64 bit event list mode or Xspress3Mini with 64 bit time frame.

newville commented 6 months ago

@oksanagit Ah, I did not know that was a setting. Depending on how you are starting the IOC, you might try changing st.cmd to have

  epicsEnvSet("CIRC_BUFFER", "0")

or set the final value of xspress3Config() (say in DefineXSP3Driver.cmd) to be 0.

It has been a while since I have tested this (and will be a while longer), but I was not very happy with the performance of circular buffer mode anyway. Hopefully QD is continuing to work on improvements.....

TomQD-94 commented 6 months ago

Hi @oksanagit, It looks like you may have conflicting packages somehow. Did you only download this module as a method of getting the libraries etc?

I will test to see if I get the same error by copying CentOS7 calibration to a CentOS8 server but I suspect the API error has to do with older firmware on the xspress3 system rather than operating systems.

If Matt's suggestion doesn't fix things it might require a bit more fiddling on our end. I remember I had to create some sym links to libraries to get it to work in the end going from 7 -> 8.

oksanagit commented 6 months ago

Hi @newville and @TomQD-94, Setting CIRC_BUFFER to 0 fixed the connection problem. Thank you, I am closing this issue