From 835aa575b07b51f5f9361e4d5255a3bdfd32d3d5 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 5 Apr 2022 14:55:45 +0200 Subject: [PATCH] remaining for removing copydetectorserver --- docs/src/pygettingstarted.rst | 2 +- docs/src/serverupgrade.rst | 56 ++++++++++++++------- slsDetectorSoftware/include/sls/Detector.h | 13 ----- slsDetectorSoftware/src/CmdProxy.cpp | 21 ++------ slsDetectorSoftware/src/Detector.cpp | 10 ---- slsDetectorSoftware/tests/test-CmdProxy.cpp | 19 ------- 6 files changed, 45 insertions(+), 76 deletions(-) diff --git a/docs/src/pygettingstarted.rst b/docs/src/pygettingstarted.rst index f84f25a53..424416a78 100644 --- a/docs/src/pygettingstarted.rst +++ b/docs/src/pygettingstarted.rst @@ -136,7 +136,7 @@ can use dir() '__str__', '__subclasshook__', '_adc_register', '_frozen', '_register', 'acquire', 'adcclk', 'adcphase', 'adcpipeline', 'adcreg', 'asamples', 'auto_comp_disable', 'clearAcquiringFlag', - 'clearBit', 'clearROI', 'client_version', 'config', 'copyDetectorServer', + 'clearBit', 'clearROI', 'client_version', 'config', 'counters', 'daclist', 'dacvalues', 'dbitclk', 'dbitphase' ... Since the list for Detector is rather long it's an good idea to filter it. diff --git a/docs/src/serverupgrade.rst b/docs/src/serverupgrade.rst index 889673528..d7e7a3510 100644 --- a/docs/src/serverupgrade.rst +++ b/docs/src/serverupgrade.rst @@ -5,17 +5,42 @@ Detector Server Upgrade **Location:** slsDetectorPackage/serverBin/ folder for every release. +.. note :: + + For Mythen3, Gotthard2 and Eiger, you need to add scripts to automatically start detector server upon power on. See :ref:`Automatic start` for more details. + + .. note :: + + Eiger requires a manual reboot. Or killall the servers and restart the new linked one. If you are in the process of updating firmware, then don't reboot yet. + + +From 6.1.1 and above (no tftp required) +--------------------------------------- + +#. Program from console + + .. code-block:: bash + + # the following command copies new server, creates a soft link to xxxDetectorServerxxx + # [Jungfrau][CTB][Moench] also deletes the old server binary and edits initttab to respawn server on reboot + # Then, the detector controller will reboot (except Eiger) + sls_detector_put updatedetectorserver /complete-path-to-binary/xxxDetectorServerxxx + +#. Copy the detector server specific config files or any others required to the detector: + + .. code-block:: bash + + sls_detector_put execcommand "tftp pcxxx -r configxxx -g" + +5.0.0 - 6.1.1 +-------------- #. Install tftp and copy detector server binary to tftp folder #. Program from console - .. note :: - - These instructions are for upgrades from v5.0.0. For earlier versions, contact us. - .. code-block:: bash - # copies new server from pc tftp folder, creates a soft link to xxxDetectorServerxxx + # the following command copies new server from pc tftp folder, creates a soft link to xxxDetectorServerxxx # [Jungfrau][CTB][Moench] also edits initttab to respawn server on reboot # Then, the detector controller will reboot (except Eiger) sls_detector_put copydetectorserver xxxDetectorServerxxx pcxxx @@ -27,18 +52,15 @@ Detector Server Upgrade sls_detector_put execcommand "tftp pcxxx -r configxxx -g" -.. note :: - - For Mythen3, Gotthard2 and Eiger, you need to add scripts to automatically start detector server upon power on. See :ref:`Automatic start` for more details. - - .. note :: - - Eiger requires a manual reboot. Or killall the servers and restart the new linked one. If you are in the process of updating firmware, then don't reboot yet. - - -Errors ------- +Troubleshooting with tftp +^^^^^^^^^^^^^^^^^^^^^^^^^ #. tftp write error: There is no space left. Please delete some old binaries and try again. -#. text file busy: You are trying to copy the same server. \ No newline at end of file +#. text file busy: You are trying to copy the same server. + + +Older than 5.0.0 +----------------- + +Please contact us. \ No newline at end of file diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index e89e6543c..e5f49cc42 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1785,19 +1785,6 @@ class Detector { * Function! */ void rebootController(Positions pos = {}); - /** [[deprecated ("Replaced by overloaded updateDetectorServer, which does - * not require tftp and has one less argument")]] Advanced user Function!\n - * [Jungfrau][Gotthard][CTB][Moench] Updates the firmware, detector server, - * make a soft link and then reboots detector controller. \n - * [Mythen3][Gotthard2] Will require a script to start up the shorter named - * server link at start up \n sname is name of detector server binary found - * on tftp folder of host pc \n hostname is name of pc to tftp from \n fname - * is programming file name with full path to it - */ - void updateFirmwareAndServer(const std::string &sname, - const std::string &hostname, - const std::string &fname, Positions pos = {}); - /** * Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the * firmware, detector server, make a soft link and then reboots detector diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index d41137371..af69163e0 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -2967,23 +2967,21 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "\n\tUsing tftp: Deprecated!! [server_name" - " (in tftp folder)] [pc_host_name] [fname.pof (incl full path)]" - "\n\tWithout tftp: Recommended [server_name (incl fullpath)] " + os << "\n\tWithout tftp: [server_name (incl fullpath)] " "[fname.pof (incl full path)] " "This does not use tftp." "\n\t\t[Jungfrau][Gotthard][CTB][Moench] Updates the " - "firmware, detector server, creates the symbolic link and then " + "firmware, detector server, deletes old server, creates the symbolic link and then " "reboots detector controller. \n\t\t[Mythen3][Gotthard2] will " "require a script to start up the shorter named server link at " - "start up. \n\t\tsname is full path name of detector server " + "start up. \n\t\tserver_name is full path name of detector server " "binary" "\n\t\tfname is full path of programming file" << '\n'; } else if (action == defs::GET_ACTION) { throw sls::RuntimeError("Cannot get"); } else if (action == defs::PUT_ACTION) { - if (args.size() != 3 && args.size() != 2) { + if (args.size() != 2) { WrongNumberOfParameters(2); } @@ -2992,17 +2990,8 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) { args[fpos].find(".rbf") == std::string::npos) { throw sls::RuntimeError("Programming file must be a pof/rbf file."); } - - if (args.size() == 3) { - LOG(logWARNING) - << "Deprecated! Recommend to use same command without tftp (no " - "pc name) and using full path to the server binary"; - det->updateFirmwareAndServer(args[0], args[1], args[2], + det->updateFirmwareAndServer(args[0], args[1], std::vector{det_id}); - } else { - det->updateFirmwareAndServer(args[0], args[1], - std::vector{det_id}); - } os << "successful\n"; } else { throw sls::RuntimeError("Unknown action"); diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 9ec8f71cd..912cdfd3b 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -2263,16 +2263,6 @@ void Detector::rebootController(Positions pos) { pimpl->Parallel(&Module::rebootController, pos); } -void Detector::updateFirmwareAndServer(const std::string &sname, - const std::string &hostname, - const std::string &fname, - Positions pos) { - LOG(logINFO) << "Updating Firmware and Detector Server (with tftp)..."; - LOG(logINFO) << "Updating Detector Server (via tftp)..."; - pimpl->Parallel(&Module::copyDetectorServer, pos, sname, hostname); - programFPGA(fname, false, pos); -} - void Detector::updateFirmwareAndServer(const std::string &sname, const std::string &fname, Positions pos) { diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index ff451bff5..b851775e0 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -2776,25 +2776,6 @@ TEST_CASE("resetfpga", "[.cmd]") { } } -TEST_CASE("copydetectorserver", "[.cmd]") { - Detector det; - CmdProxy proxy(&det); - auto det_type = det.getDetectorType().squash(); - if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD || - det_type == defs::MOENCH || det_type == defs::MYTHEN3 || - det_type == defs::GOTTHARD2) { - // TODO: send real server? - // std::ostringstream oss; - // proxy.Call("copydetectorserver",{"jungfrauDetectorServerv4.0.1.0", - // "pc13784"}, -1, PUT, oss); - // REQUIRE(oss.str() == "copydetectorserver successful\n"); - REQUIRE_THROWS(proxy.Call("copydetectorserver", {}, -1, GET)); - } else { - REQUIRE_THROWS(proxy.Call("copydetectorserver", {}, -1, GET)); - REQUIRE_THROWS(proxy.Call("copydetectorserver", {}, -1, PUT)); - } -} - TEST_CASE("updatekernel", "[.cmd]") { Detector det; CmdProxy proxy(&det);