diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index 73f1a621a2..d2d1a7b638 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -57,7 +57,7 @@ jobs: run: | yum install -y epel-release centos-release-scl yum install -y libusbx-devel curl wget devtoolset-${{ matrix.gcc-version }}-{gcc-c++,make,libasan-devel,libubsan-devel} \ - rh-git227-git-core ccache zlib-devel rsync rh-python3${{ matrix.python-minor }}-python-{devel,pip} mesa-libGL-devel systemd-devel fontconfig p7zip which + rh-git227-git-core ccache zlib-devel rsync rh-python3${{ matrix.python-minor }}-python-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip which yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform @@ -98,7 +98,7 @@ jobs: python3 -m pip install -U pip python3 -m pip install aqtinstall aqt install-qt linux desktop ${{ matrix.qt-version }} -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland - aqt install-tool linux desktop tools_ifw -O /Qt + # aqt install-tool linux desktop tools_ifw -O /Qt echo "Qt5_Dir=$(ls -1d /Qt/5*/* | head -n 1)" >> $GITHUB_ENV echo "IQTA_TOOLS=/Qt/Tools" >> $GITHUB_ENV @@ -123,7 +123,8 @@ jobs: set -xueo pipefail uname -a rsync --version - ls "$IQTA_TOOLS/" "$Qt5_Dir/" + # ls "$IQTA_TOOLS/" + ls "$Qt5_Dir/" qmake --version && qmake -query python3 --version which g++ @@ -174,10 +175,11 @@ jobs: run: | set -vx cd "$GITHUB_WORKSPACE"/installer - export TRIK_PYTHON3_VERSION_MINOR="${{ matrix.python-minor }}" - bash -xv ./build-trik-studio.sh "${Qt5_Dir}/bin" $(ls -1d "${IQTA_TOOLS}"/QtInstallerFramework/*/bin | head -n 1) "${{ env.BUILD_DIR }}" + export TRIK_PYTHON3_VERSION_MINOR=${{ matrix.python-minor }} + # bash -xv ./build-trik-studio.sh "${Qt5_Dir}/bin" $(ls -1d "${IQTA_TOOLS}"/QtInstallerFramework/*/bin | head -n 1) "${{ env.BUILD_DIR }}" - name: Push installer + if: false uses: actions/upload-artifact@v2 with: name: trik-studio-auto-installer-linux-qt${{ matrix.qt-version }} @@ -199,7 +201,7 @@ jobs: run: echo "GITHUB_REF_SLUG=${{ env.CURRENT_TAG }}" >> $GITHUB_ENV - name: Deploy installer - if: ${{ matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }} + if: ${{ false && matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }} run: | install -m 600 -D /dev/null ~/.ssh/id_rsa echo "${{ secrets.DL_PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa diff --git a/plugins/robots/common/nxtKit/src/communication/usbRobotCommunicationThread.cpp b/plugins/robots/common/nxtKit/src/communication/usbRobotCommunicationThread.cpp index 5debd3ae28..b58df33cf8 100644 --- a/plugins/robots/common/nxtKit/src/communication/usbRobotCommunicationThread.cpp +++ b/plugins/robots/common/nxtKit/src/communication/usbRobotCommunicationThread.cpp @@ -116,15 +116,22 @@ bool UsbRobotCommunicationThread::connectImpl(bool firmwareMode, int vid, int pi // old tool libnxt says that it should be 1 const int possibleConfigurations = device_descriptor.bNumConfigurations; - bool configurationFound = false; + int configurationFound = 0; bool interfaceFound = false; for (int configuration = 0; configuration <= possibleConfigurations; configuration++) { const int err = libusb_set_configuration(mHandle, configuration); - if (err < 0 && err != LIBUSB_ERROR_NOT_FOUND && err != LIBUSB_ERROR_INVALID_PARAM) { + if (err < 0) { QLOG_ERROR() << "libusb_set_configuration for NXT returned" << err << "for configuration" << configuration; - } else if (err >= 0) { - configurationFound = true; - libusb_config_descriptor *config_descriptor = new libusb_config_descriptor; + } + if (err >= 0 + || err != LIBUSB_ERROR_NOT_FOUND + || err != LIBUSB_ERROR_INVALID_PARAM +// Seems like a WinUSB driver supports only one configuration +// and sometimes even complains on libusb_set_configuration API call +// Probably, this line for LIBUSB_ERROR_NOT_SUPPORTED is redundant or obsolete in 2023 + || err != LIBUSB_ERROR_NOT_SUPPORTED) { + configurationFound = configuration + 1; // Encode number as boolean value + auto config_descriptor = new libusb_config_descriptor; const int err = libusb_get_active_config_descriptor(devices[i], &config_descriptor); if (err >= 0) { const int possibleInterfaces = config_descriptor->bNumInterfaces; @@ -155,20 +162,20 @@ bool UsbRobotCommunicationThread::connectImpl(bool firmwareMode, int vid, int pi } if (!configurationFound) { - QLOG_ERROR() << "No appropriate configuration found among all possible configurations. Giving up."; - emit connected(false, tr("USB Device configuration problem. Try to restart TRIK Studio and re-plug NXT.")); + QLOG_ERROR() << "No appropriate configuration found among all possible configurations. Giving up."; libusb_close(mHandle); mHandle = nullptr; libusb_free_device_list(devices, 1); + emit connected(false, tr("USB Device configuration problem. Try to restart TRIK Studio and re-plug NXT.")); return false; } if (!interfaceFound) { QLOG_ERROR() << "No appropriate interface found among possible interfaces. Giving up."; - emit connected(false, tr("NXT device is already used by another software.")); libusb_close(mHandle); mHandle = nullptr; libusb_free_device_list(devices, 1); + emit connected(false, tr("NXT device is already used by another software.")); return false; } @@ -186,14 +193,14 @@ bool UsbRobotCommunicationThread::connectImpl(bool firmwareMode, int vid, int pi const bool correctFirmwareResponce = !firmwareMode || (handshakeResponse.length() == 4 && handshakeResponse[2] == '\n' && handshakeResponse[3] == '\r'); if (handshakeResponse.isEmpty() || !correctFirmwareResponce) { - emit connected(false, tr("NXT handshake procedure failed. Please contact developers.")); libusb_close(mHandle); mHandle = nullptr; libusb_free_device_list(devices, 1); + emit connected(false, tr("NXT handshake procedure failed. Please contact developers.")); return false; } - QLOG_INFO() << "Connected successfully!"; + QLOG_INFO() << "NXTUSB: Connected successfully with configuration" << (configurationFound - 1); emit connected(true, QString()); if (!firmwareMode) { diff --git a/qrtranslations/fr/plugins/robots/nxtKit_fr.ts b/qrtranslations/fr/plugins/robots/nxtKit_fr.ts index 95abefc34d..3f636fb040 100644 --- a/qrtranslations/fr/plugins/robots/nxtKit_fr.ts +++ b/qrtranslations/fr/plugins/robots/nxtKit_fr.ts @@ -37,7 +37,7 @@ nxt::communication::UsbRobotCommunicationThread - + USB Device configuration problem. Try to restart TRIK Studio and re-plug NXT. @@ -52,7 +52,7 @@ - + Cannot find NXT device. Check robot connected and turned on and try again. diff --git a/qrtranslations/ru/plugins/robots/nxtKit_ru.ts b/qrtranslations/ru/plugins/robots/nxtKit_ru.ts index 190e917580..63aa2966c6 100644 --- a/qrtranslations/ru/plugins/robots/nxtKit_ru.ts +++ b/qrtranslations/ru/plugins/robots/nxtKit_ru.ts @@ -37,7 +37,7 @@ nxt::communication::UsbRobotCommunicationThread - + USB Device configuration problem. Try to restart TRIK Studio and re-plug NXT. Проблема конфигурации USB-устройства. Попробуйте перезапустить TRIK Studio и перевоткнуть NXT в компьютер. @@ -52,7 +52,7 @@ Процедура рукопожатия с NXT не была успешной. Пожалуйста, попробуйте еще раз, если эта ошибка снова появится, обратитесь к разработчикам. - + Cannot find NXT device. Check robot connected and turned on and try again. Устройство NXT не найдено. Проверьте, что робот включен и подключен к компьютеру и попробуйте еще раз.