diff --git a/RELEASE.txt b/RELEASE.txt index c6bc64449..52526e6b4 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -60,6 +60,7 @@ This document describes the differences between v7.0.0 and v6.x.x - master binary file in json format now - fixed bug introduced in 6.0.0: hdf5 files created 1 file per frame after the initial file which had maxframesperfile - updatedetectorserver - removes old server current binary pointing to for blackfin +- removing copydetectorserver using tftp 2. Resolved Issues diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 2323a0e1d..1806b7753 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -1551,11 +1551,6 @@ void init_det(py::module &m) { .def("resetFPGA", (void (Detector::*)(sls::Positions)) & Detector::resetFPGA, py::arg() = Positions{}) - .def("copyDetectorServer", - (void (Detector::*)(const std::string &, const std::string &, - sls::Positions)) & - Detector::copyDetectorServer, - py::arg(), py::arg(), py::arg() = Positions{}) .def("updateDetectorServer", (void (Detector::*)(const std::string &, sls::Positions)) & Detector::updateDetectorServer, diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index de7bc9a2f..bbd23acf1 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index 589026d84..78c9b4508 100755 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 2a6807c81..b0851e4a3 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index 43f4801a1..5f3c9e40d 100755 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index c5292d46d..f1f57a4c9 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index 950e680a5..4b452afaf 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index b532ad53e..809fe6fbd 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index 385b45ae7..854358d94 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -132,7 +132,6 @@ int check_version(int); int software_trigger(int); int led(int); int digital_io_delay(int); -int copy_detector_server(int); int reboot_controller(int); int set_adc_enable_mask(int); int get_adc_enable_mask(int); diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index f36835664..6b78439b3 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -93,7 +93,6 @@ int updateModeAllowedFunction(int file_des) { F_PROGRAM_FPGA, F_RESET_FPGA, F_CHECK_VERSION, - F_COPY_DET_SERVER, F_REBOOT_CONTROLLER, F_GET_KERNEL_VERSION, F_UPDATE_KERNEL, @@ -322,7 +321,6 @@ void function_table() { flist[F_SOFTWARE_TRIGGER] = &software_trigger; flist[F_LED] = &led; flist[F_DIGITAL_IO_DELAY] = &digital_io_delay; - flist[F_COPY_DET_SERVER] = ©_detector_server; flist[F_REBOOT_CONTROLLER] = &reboot_controller; flist[F_SET_ADC_ENABLE_MASK] = &set_adc_enable_mask; flist[F_GET_ADC_ENABLE_MASK] = &get_adc_enable_mask; @@ -4143,65 +4141,6 @@ int digital_io_delay(int file_des) { return Server_SendResult(file_des, INT32, NULL, 0); } -int copy_detector_server(int file_des) { - ret = OK; - memset(mess, 0, sizeof(mess)); - char args[2][MAX_STR_LENGTH]; - char retvals[MAX_STR_LENGTH] = {0}; - - memset(args, 0, sizeof(args)); - memset(retvals, 0, sizeof(retvals)); - - if (receiveData(file_des, args, sizeof(args), OTHER) < 0) - return printSocketReadError(); - -#ifdef VIRTUAL - functionNotImplemented(); -#else - - // only set - if (Server_VerifyLock() == OK) { - char *sname = args[0]; - char *hostname = args[1]; - LOG(logINFOBLUE, ("Copying server %s from host %s\n", sname, hostname)); - char cmd[MAX_STR_LENGTH] = {0}; - -#ifdef BLACKFIN_DEFINED - // check update is allowed (Non Amd OR AMD + current kernel) - ret = allowUpdate(mess, "copy detector server"); -#endif - - // tftp server - if (ret == OK) { - if (snprintf(cmd, MAX_STR_LENGTH, "tftp %s -r %s -g", hostname, - sname) >= MAX_STR_LENGTH) { - ret = FAIL; - strcpy(mess, "Could not copy detector server. Command to copy " - "server too long\n"); - LOG(logERROR, (mess)); - } else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { - ret = FAIL; - snprintf(mess, MAX_STR_LENGTH, - "Could not copy detector server (tftp). %s\n", - retvals); - // LOG(logERROR, (mess)); already printed in executecommand - } else { - LOG(logINFO, ("\tServer copied\n")); - } - } - -#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) - // a fail here is not a show stopper (just for memory) - deleteOldServers(mess, serverName, "update detector server"); -#endif - if (ret == OK) { - ret = setupDetectorServer(mess, sname); - } - } -#endif - return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals)); -} - int reboot_controller(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 68ccbd2a9..e89e6543c 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1766,23 +1766,11 @@ class Detector { /** [Jungfrau][CTB][Moench] Advanced user Function! */ void resetFPGA(Positions pos = {}); - /** [[deprecated ("Replaced by updateDetectorServer, which does not require - * tftp")]] [Jungfrau][Eiger][Gotthard][CTB][Moench][Mythen3][Gotthard2] - * Advanced user Function! \n - * Copy detector server fname from tftp folder of hostname to detector. Also - * creates a symbolic link to a shorter name (without vx.x.x). Then the - * detector controller reboots (except eiger) \n - * [Jungfrau][Gotthard][CTB][Moench] Also changes respawn server (to the - * link), which is effective after a reboot. - */ - void copyDetectorServer(const std::string &fname, - const std::string &hostname, Positions pos = {}); - /** [Jungfrau][Eiger][Ctb][Moench][Mythen3][Gotthard2] Copies detector * server via TCP (without tftp).\nMakes a symbolic link with a shorter * name (without vx.x.x).\nThen, detector controller reboots (except - * Eiger).\n[Jungfrau][Ctb][Moench]Also changes respawn server to the - * link, which is effective after a reboot. + * Eiger).\n[Jungfrau][Ctb][Moench] Also deletes old server binary and + * changes respawn server to the link, which is effective after a reboot. */ void updateDetectorServer(const std::string &fname, Positions pos = {}); diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index dc61cc538..d41137371 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -2911,35 +2911,6 @@ std::string CmdProxy::ProgramFpga(int action) { return os.str(); } -std::string CmdProxy::CopyDetectorServer(int action) { - std::ostringstream os; - os << cmd << ' '; - if (action == defs::HELP_ACTION) { - LOG(logWARNING) << "Deprecated! Replaced by updatedetectorserver that " - "requires no tftp.\n"; - os << "[server_name (in tftp folder)] " - "[pc_host_name]\n\t[Jungfrau][Eiger][Ctb][Moench][Mythen3][" - "Gotthard2] Copies detector server via TFTP from pc. Ensure that " - "server is in the pc's tftp folder. Makes a symbolic link with a " - "shorter name (without vx.x.x). Then, detector controller " - "reboots (except " - "Eiger).\n\t[Jungfrau][Ctb][Moench]Also changes respawn server " - "to the link, which is effective after a reboot." - << '\n'; - } else if (action == defs::GET_ACTION) { - throw sls::RuntimeError("Cannot get"); - } else if (action == defs::PUT_ACTION) { - if (args.size() != 2) { - WrongNumberOfParameters(2); - } - det->copyDetectorServer(args[0], args[1], std::vector{det_id}); - os << "successful\n"; - } else { - throw sls::RuntimeError("Unknown action"); - } - return os.str(); -} - std::string CmdProxy::UpdateDetectorServer(int action) { std::ostringstream os; os << cmd << ' '; diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 293bda371..839f1eea4 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -743,7 +743,11 @@ class CmdProxy { /* Pattern */ /* Moench */ + /* Advanced */ + {"copydetectorserver", "updatedetectorserver"}, + + /* Insignificant */ {"nframes", "framecounter"}, {"now", "runtime"}, @@ -1062,7 +1066,6 @@ class CmdProxy { /* Advanced */ {"programfpga", &CmdProxy::ProgramFpga}, {"resetfpga", &CmdProxy::resetfpga}, - {"copydetectorserver", &CmdProxy::CopyDetectorServer}, {"updatedetectorserver", &CmdProxy::UpdateDetectorServer}, {"updatekernel", &CmdProxy::UpdateKernel}, {"rebootcontroller", &CmdProxy::rebootcontroller}, @@ -1189,7 +1192,6 @@ class CmdProxy { std::string JsonParameter(int action); /* Advanced */ std::string ProgramFpga(int action); - std::string CopyDetectorServer(int action); std::string UpdateDetectorServer(int action); std::string UpdateKernel(int action); std::string UpdateFirmwareAndDetectorServer(int action); diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 31720a1ec..9ec8f71cd 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -2242,15 +2242,6 @@ void Detector::resetFPGA(Positions pos) { pimpl->Parallel(&Module::resetFPGA, pos); } -void Detector::copyDetectorServer(const std::string &fname, - const std::string &hostname, Positions pos) { - LOG(logINFO) << "Updating Detector Server (via tftp)..."; - pimpl->Parallel(&Module::copyDetectorServer, pos, fname, hostname); - if (getDetectorType().squash() != defs::EIGER) { - rebootController(pos); - } -} - void Detector::updateDetectorServer(const std::string &fname, Positions pos) { LOG(logINFO) << "Updating Detector Server (no tftp)..."; std::vector buffer = readBinaryFile(fname, "Update Detector Server"); diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 7178e75f1..18b6ca3fa 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -2611,28 +2611,6 @@ void Module::programFPGA(std::vector buffer, void Module::resetFPGA() { sendToDetector(F_RESET_FPGA); } -void Module::copyDetectorServer(const std::string &fname, - const std::string &hostname) { - char args[2][MAX_STR_LENGTH]{}; - sls::strcpy_safe(args[0], fname.c_str()); - sls::strcpy_safe(args[1], hostname.c_str()); - LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname - << "): Sending detector server " << args[0] << " from host " - << args[1]; - auto client = DetectorSocket(shm()->hostname, shm()->controlPort); - client.Send(F_COPY_DET_SERVER); - client.Send(args); - if (client.Receive() == FAIL) { - std::cout << '\n'; - std::ostringstream os; - os << "Module " << moduleIndex << " (" << shm()->hostname << ")" - << " returned error: " << client.readErrorMessage(); - throw DetectorError(os.str()); - } - LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname - << "): Detector server copied"; -} - void Module::updateDetectorServer(std::vector buffer, const std::string &serverName) { switch (shm()->detType) { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index fe5c5f5b3..cef1349cf 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -548,8 +548,6 @@ class Module : public virtual slsDetectorDefs { void programFPGA(std::vector buffer, const bool forceDeleteNormalFile); void resetFPGA(); - void copyDetectorServer(const std::string &fname, - const std::string &hostname); void updateDetectorServer(std::vector buffer, const std::string &serverName); void updateKernel(std::vector buffer); diff --git a/slsSupportLib/include/sls/sls_detector_funcs.h b/slsSupportLib/include/sls/sls_detector_funcs.h index 13db10087..a6e5569e1 100755 --- a/slsSupportLib/include/sls/sls_detector_funcs.h +++ b/slsSupportLib/include/sls/sls_detector_funcs.h @@ -111,7 +111,6 @@ enum detFuncs { F_SOFTWARE_TRIGGER, F_LED, F_DIGITAL_IO_DELAY, - F_COPY_DET_SERVER, F_REBOOT_CONTROLLER, F_SET_ADC_ENABLE_MASK, F_GET_ADC_ENABLE_MASK, @@ -477,7 +476,6 @@ const char* getFunctionNameFromEnum(enum detFuncs func) { case F_SOFTWARE_TRIGGER: return "F_SOFTWARE_TRIGGER"; case F_LED: return "F_LED"; case F_DIGITAL_IO_DELAY: return "F_DIGITAL_IO_DELAY"; - case F_COPY_DET_SERVER: return "F_COPY_DET_SERVER"; case F_REBOOT_CONTROLLER: return "F_REBOOT_CONTROLLER"; case F_SET_ADC_ENABLE_MASK: return "F_SET_ADC_ENABLE_MASK"; case F_GET_ADC_ENABLE_MASK: return "F_GET_ADC_ENABLE_MASK"; diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 7d080b49c..2fe84872b 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -2,14 +2,14 @@ // Copyright (C) 2021 Contributors to the SLS Detector Package /** API versions */ #define GITBRANCH "developer" -#define APILIB 0x211125 -#define APIRECEIVER 0x211124 -#define APIGUI 0x211124 -#define APICTB 0x220404 -#define APIGOTTHARD 0x220404 -#define APIGOTTHARD2 0x220404 -#define APIJUNGFRAU 0x220404 -#define APIMYTHEN3 0x220404 -#define APIMOENCH 0x220404 -#define APIEIGER 0x220404 +#define APILIB 0x220405 +#define APIRECEIVER 0x220405 +#define APIGUI 0x220328 +#define APICTB 0x220405 +#define APIGOTTHARD 0x220405 +#define APIGOTTHARD2 0x220405 +#define APIJUNGFRAU 0x220405 +#define APIMYTHEN3 0x220405 +#define APIMOENCH 0x220405 +#define APIEIGER 0x220405