Skip to content

Instantly share code, notes, and snippets.

@takurx
Last active February 25, 2024 18:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save takurx/941c80fce4619f65120b936dd719d0d7 to your computer and use it in GitHub Desktop.
Save takurx/941c80fce4619f65120b936dd719d0d7 to your computer and use it in GitHub Desktop.
build vesc tool on Ubuntu 20.04

command list of build vesc tool

git clone https://github.com/vedderb/vesc_tool.git
sudo apt install -y qtbase5-dev qttools5-dev-tools qt5-default
sudo apt install -y qtquickcontrols2-5-dev
sudo apt-get install -y libqt5serialport5-dev
sudo apt-get install -y libqt5bluetooth5 qtpositioning5-dev libqt5gamepad5-dev
sudo apt-get install -y qtconnectivity5-dev
sudo apt install -y libqt5svg5-dev
cd vesc_tool
./biuld_lin
cd build/lin/
unzip vesc_tool_free_linux.zip
./vesc_tool_3.00

log of build vesc tool -1

chino@chino-Legion-5-15IAH7H:~/JetsonWorks_240220/vesc_tool$ ./build_lin
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!
WARNING: Failure to find: res/firmwares/res_fw.qrc
/usr/lib/qt5/bin/rcc: File does not exist 'res/firmwares/res_fw.qrc'
/usr/lib/qt5/bin/qmake -o Makefile vesc_tool.pro -config release 'CONFIG += release_lin build_original'
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!
WARNING: Failure to find: res/firmwares/res_fw.qrc
/usr/lib/qt5/bin/rcc: File does not exist 'res/firmwares/res_fw.qrc'
/usr/lib/qt5/bin/qmake -o Makefile vesc_tool.pro -config release 'CONFIG += release_lin build_original'
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!
WARNING: Failure to find: res/firmwares/res_fw.qrc
/usr/lib/qt5/bin/rcc: File does not exist 'res/firmwares/res_fw.qrc'
/usr/lib/qt5/bin/qmake -o Makefile vesc_tool.pro -config release 'CONFIG += release_lin build_original'
......
......
^Cmake: *** Deleting file 'Makefile'
make: *** [Makefile:1171: Makefile] Interrupt

chino@chino-Legion-5-15IAH7H:~/JetsonWorks_240220/vesc_tool$ 

read build_lin

cd /opt
sudo mkdir qt5
sudo chown $USER qt5
git clone https://code.qt.io/qt/qt5.git
cd qt5
git checkout 5.15
perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine
mkdir build
cd build
../configure -prefix /opt/Qt/5.15-static/ -release -opensource -confirm-license -static -no-sql-mysql -no-sql-psql -no-sql-sqlite -no-journald -qt-zlib -no-mtdev -no-gif -qt-libpng -qt-libjpeg -qt-harfbuzz -qt-pcre -no-glib -no-compile-examples -no-cups -no-iconv -no-tslib -dbus-linked -no-xcb-xlib -no-eglfs -no-directfb -no-linuxfb -no-kms -nomake examples -nomake tests -skip qtwebsockets -skip qtwebchannel -skip qtwebengine -skip qtwayland -skip qtwinextras -skip qtsensors -skip multimedia -no-libproxy -no-icu -qt-freetype -skip qtimageformats -opengl es2
make -j9
sudo make install
chino@chino-Legion-5-15IAH7H:~/JetsonWorks_240220/vesc_tool$ ./build_lin
Project WARNING: Plugin class name could not be determined for plugin 'composeplatforminputcontextplugin'.
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!
qmlimportscanner: No such file or directory: "/home/chino/JetsonWorks_240220/vesc_tool/res/firmwares/res_fw.qrc"
/opt/Qt/5.15-static/mkspecs/features/qt.prf:326: Error parsing JSON at 1:1: illegal value
Project ERROR: Failed to parse qmlimportscanner output.

log of build vesc tool -2

git checkout release3_01
sudo apt install qtbase5-private-dev
./build_lin

fatal error: QtGui/private/qtguiglobal_p.h: No such file or directory · Issue #7 · fcitx/fcitx5-qt fcitx/fcitx5-qt#7

log of build vesc tool

chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ./build_all
Info: creating stash file /home/chiya/JetsonWorks/vesc_tool/.qmake.stash
Project ERROR: Unknown module(s) in QT: quickcontrols2 serialport bluetooth positioning gamepad
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ./build_lin
Project ERROR: Unknown module(s) in QT: quickcontrols2 serialport bluetooth positioning gamepad
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ sudo apt install qtbase5-dev qttools5-dev-tools qt5-default
Reading package lists... Done
Building dependency tree       
Reading state information... Done
qt5-default is already the newest version (5.12.8+dfsg-0ubuntu1).
qtbase5-dev is already the newest version (5.12.8+dfsg-0ubuntu1).
qttools5-dev-tools is already the newest version (5.12.8-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 624 not upgraded.
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ sudo apt install qtquickcontrols2-5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libqt5quickcontrols2-5 libqt5quicktemplates2-5
The following NEW packages will be installed:
  libqt5quickcontrols2-5 libqt5quicktemplates2-5 qtquickcontrols2-5-dev
0 upgraded, 3 newly installed, 0 to remove and 623 not upgraded.
......
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ./build_lin
Project ERROR: Unknown module(s) in QT: serialport bluetooth positioning gamepad
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ sudo apt-get install libqt5serialport5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libqt5serialport5 is already the newest version (5.12.8-0ubuntu1).
libqt5serialport5 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 623 not upgraded.
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ sudo apt-get install libqt5serialport5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libqt5serialport5-dev
0 upgraded, 1 newly installed, 0 to remove and 623 not upgraded.
Need to get 9,904 B of archives.
After this operation, 67.6 kB of additional disk space will be used.
......
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ./build_lin
Project ERROR: Unknown module(s) in QT: bluetooth positioning gamepad
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ sudo apt-get install libqt5bluetooth5 qtpositioning5-dev libqt5gamepad5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libqt5bluetooth5-bin libqt5gamepad5 libqt5positioning5-plugins libqt5positioningquick5
The following NEW packages will be installed:
  libqt5bluetooth5 libqt5bluetooth5-bin libqt5gamepad5 libqt5gamepad5-dev libqt5positioning5-plugins libqt5positioningquick5 qtpositioning5-dev
0 upgraded, 7 newly installed, 0 to remove and 623 not upgraded.
Need to get 513 kB of archives.
......
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ./build_lin
Project ERROR: Unknown module(s) in QT: bluetooth
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ sudo apt-get install qtconnectivity5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libqt5nfc5
Recommended packages:
  neard
The following NEW packages will be installed:
  libqt5nfc5 qtconnectivity5-dev
0 upgraded, 2 newly installed, 0 to remove and 623 not upgraded.
......
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ./build_lin
rm -f build/lin/obj/qrc_qml.cpp build/lin/obj/qrc_res.cpp build/lin/obj/qrc_res_fw_bms.cpp build/lin/obj/qrc_res_qml.cpp build/lin/obj/qrc_res_config.c
pp build/lin/obj/qrc_res_original.cpp build/lin/obj/qrc_res_fw_original.cpp
rm -f build/lin/obj/moc_predefs.h
rm -f build/lin/obj/moc_mainwindow.cpp build/lin/obj/moc_packet.cpp build/lin/obj/moc_udpserversimple.cpp build/lin/obj/moc_commands.cpp build/lin/obj/
moc_datatypes.cpp build/lin/obj/moc_configparams.cpp build/lin/obj/moc_vescinterface.cpp build/lin/obj/moc_parametereditor.cpp build/lin/obj/moc_setupw
izardapp.cpp build/lin/obj/moc_setupwizardmotor.cpp build/lin/obj/moc_startupwizard.cpp build/lin/obj/moc_utility.cpp build/lin/obj/moc_tcpserversimple
.cpp build/lin/obj/moc_bleuart.cpp build/lin/obj/moc_pageappbalance.cpp build/lin/obj/moc_pageapppas.cpp build/lin/obj/moc_pagebms.cpp build/lin/obj/mo
c_pagecananalyzer.cpp build/lin/obj/moc_pageconnection.cpp build/lin/obj/moc_pagecustomconfig.cpp build/lin/obj/moc_pagemotor.cpp build/lin/obj/moc_pag
edebugprint.cpp build/lin/obj/moc_pagebldc.cpp build/lin/obj/moc_pageappgeneral.cpp build/lin/obj/moc_pagedc.cpp build/lin/obj/moc_pagefoc.cpp build/li
n/obj/moc_pagecontrollers.cpp build/lin/obj/moc_pageappppm.cpp build/lin/obj/moc_pageappadc.cpp build/lin/obj/moc_pageappuart.cpp build/lin/obj/moc_pag
eappnunchuk.cpp build/lin/obj/moc_pageappnrf.cpp build/lin/obj/moc_pageterminal.cpp build/lin/obj/moc_pagefirmware.cpp build/lin/obj/moc_pagertdata.cpp
 build/lin/obj/moc_pagesampleddata.cpp build/lin/obj/moc_pagewelcome.cpp build/lin/obj/moc_pagemotorsettings.cpp build/lin/obj/moc_pageappsettings.cpp 
build/lin/obj/moc_pagedataanalysis.cpp build/lin/obj/moc_pagemotorinfo.cpp build/lin/obj/moc_pagesetupcalculators.cpp build/lin/obj/moc_pagesettings.cp
p build/lin/obj/moc_pagegpd.cpp build/lin/obj/moc_pageexperiments.cpp build/lin/obj/moc_pageimu.cpp build/lin/obj/moc_pageswdprog.cpp build/lin/obj/moc
_pageappimu.cpp build/lin/obj/moc_pageloganalysis.cpp build/lin/obj/moc_batttempplot.cpp build/lin/obj/moc_parameditbool.cpp build/lin/obj/moc_paramedi
tdouble.cpp build/lin/obj/moc_parameditenum.cpp build/lin/obj/moc_parameditint.cpp build/lin/obj/moc_displaybar.cpp build/lin/obj/moc_displaypercentage
.cpp build/lin/obj/moc_helpdialog.cpp build/lin/obj/moc_mrichtextedit.cpp
......
c_detectfocencoder.o build/lin/obj/moc_detectfochall.o build/lin/obj/moc_detectimu.o build/lin/obj/moc_ppmmap.o build/lin/obj/moc_adcmap.o build/lin/obj/moc_rtdatatext.o build/lin/obj/moc_nrfpair.o build/lin/obj/moc_vtextbrowser.o build/lin/obj/moc_imagewidget.o build/lin/obj/moc_parameditstring.o build/lin/obj/moc_paramdialog.o build/lin/obj/moc_aspectimglabel.o build/lin/obj/moc_detectallfocdialog.o build/lin/obj/moc_dirsetup.o build/lin/obj/moc_vesc3dview.o build/lin/obj/moc_superslider.o build/lin/obj/moc_qmlui.o build/lin/obj/moc_fwhelper.o build/lin/obj/moc_mapwidget.o build/lin/obj/moc_osmclient.o   /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5QuickControls2.so /usr/lib/x86_64-linux-gnu/libQt5Quick.so /usr/lib/x86_64-linux-gnu/libQt5Gamepad.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Qml.so /usr/lib/x86_64-linux-gnu/libQt5Network.so /usr/lib/x86_64-linux-gnu/libQt5SerialPort.so /usr/lib/x86_64-linux-gnu/libQt5Bluetooth.so /usr/lib/x86_64-linux-gnu/libQt5Positioning.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread   
  adding: vesc_tool_3.00 (deflated 46%)
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ls
android                  build_win                lzokay               parametereditor.h    res_original.qrc      tcpserversimple.h
application              build_win_original_only  main.cpp             parametereditor.ui   res_platinum.qrc      udpserversimple.cpp
bleuart.cpp              commands.cpp             mainwindow.cpp       README.md            res_qml.qrc           udpserversimple.h
bleuart.h                commands.h               mainwindow.h         res                  res.qrc               utility.cpp
build                    configparam.cpp          mainwindow.ui        res_bronze.qrc       res_silver.qrc        utility.h
build_all                configparam.h            Makefile             res_config.qrc       setupwizardapp.cpp    vbytearray.cpp
build_android            configparams.cpp         map                  res_free.qrc         setupwizardapp.h      vbytearray.h
build_cp_fw              configparams.h           mobile               res_fw_bms.qrc       setupwizardmotor.cpp  vescinterface.cpp
build_lin                datatypes.h              packet.cpp           res_fw_original.qrc  setupwizardmotor.h    vescinterface.h
build_lin_original_only  digitalfiltering.cpp     packet.h             res_fw.qrc           startupwizard.cpp     vesc_tool.pro
build_macos              digitalfiltering.h       pages                res_gold.qrc         startupwizard.h       widgets
build_test_versions      LICENSE                  parametereditor.cpp  res_neutral.qrc      tcpserversimple.cpp
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ls build
lin
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ ls build/lin/
vesc_tool_bronze_linux.zip  vesc_tool_gold_linux.zip      vesc_tool_platinum_linux.zip
vesc_tool_free_linux.zip    vesc_tool_original_linux.zip  vesc_tool_silver_linux.zip
chiya@ujimatsu:~/JetsonWorks/vesc_tool$ cd build/lin/
chiya@ujimatsu:~/JetsonWorks/vesc_tool/build/lin$ unzip vesc_tool_free_linux.zip 
Archive:  vesc_tool_free_linux.zip
  inflating: vesc_tool_3.00          
chiya@ujimatsu:~/JetsonWorks/vesc_tool/build/lin$ ./vesc_tool_3.00 
qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type.
@ghent360
Copy link

I'm getting an error
/usr/lib/qt5/bin/rcc: File does not exist 'res/firmwares/res_fw.qrc'

@JFredPerspektiv
Copy link

JFredPerspektiv commented Sep 20, 2023

You can use: $ locate res_fw.qrc
Then either (a) you copy res_fw.qrc
Or (b) you can sync the res_fw.qrc file in two locations using a symbolic link. A symbolic link is a file that points to another file or directory. You can create a symbolic link using the ln -s command in Linux. Here's how you can do it:

  1. Navigate to the directory where you want to create the symbolic link:
    $ cd /home/.../vesc_tool/res/firmwares/
  2. Create a symbolic link to the res_fw.qrc file:
    $ ln -s /home/.../bldc/package/res_fw.qrc res_fw.qrc
    Now, whenever the res_fw.qrc file is updated in the /home/.../bldc/package/ directory, those changes will be reflected when accessing the file from the /home/.../vesc_tool/res/firmwares/ directory.

@borys-wwa
Copy link

Hi.
I'm also running into missing res_fw.qrc issue, but I can't find it anywhere. Should it be a part of the BLDC firmware package? I don't see "package" directory there :/

@takurx
Copy link
Author

takurx commented Feb 21, 2024

I have check to build a commit number a214be8b5e3d7c54ddcdf53601c5b88aa71c7d07, 2021/11/06
git checkout a214be8b5e3d7c54ddcdf53601c5b88aa71c7d07
https://github.com/vedderb/vesc_tool

Sure, master branch missing res_fw.qrc......

ok, 3af1aaf7cc96dbdd68ce5b0cceee5f06b6d36753, 2022/07/14
ok, 344d20e1a5461b6935d86a537228db534afc035a, 2022/09/28
ok, 5e22e1bb88b7e891b2442a0366c6ef382a7f9d63, 2022/10/18
ok, 05f3f987a1b67b359b389327ab52b8b18e6113b4, 221031

fail, 206560af60b91868c79bd4d96ebdcaf1844d4469, 221101
fail, 9a067dcb5310fc3e4b621c3c4b7dc29b172e57b3, 221102
fail, a6eddbdd89b716622dc49d3217a350c2ee7fa2a7, 221102
fail, 4d785971a76ccbe0259b764899b84eca2161cb7c, 221103
fail, 1cc3e8f9f2212a206c3e0be6cea8080f0a40efea 221124
fail, 202dfa1edcc0639c5e4f9a897331bfa03143f32b, 221130

around Nov. 1st 2022, vesc_tools update for qt 5.15
a1f6f57c01cd65bc6078211275b0ae93228a8062, Moved to qt 5.15, messed more with xml save and load dialogs
423f66377540ba3b8f6c03d687e3dc126e48f6ec, Updated connection syntax for qt 5.15

Ummm, Ubuntu 20.04 install Qt5 version (5.12) from apt. So build error may come from it.
(Maybe on Ubuntu 22.04 it can build smoothly depend Qt5 version.)

chino@chino-Legion-5-15IAH7H:~/JetsonWorks_240220/vesc_tool$ qmake -query QT_VERSION
5.12.8
chino@chino-Legion-5-15IAH7H:~/JetsonWorks_240220/vesc_tool$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

[SOLVED] Qt のバージョン確認について | Qt Forum
https://forum.qt.io/topic/39615/solved-qt-%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E7%A2%BA%E8%AA%8D%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6/6
【Linux】OSバージョンを確認する方法 - インフラエクスペリエンス
https://infra-exp.com/linux_versioncheck/

chino@chino-ThinkPad-E495:~$ qmake -query QT_VERSION
5.15.3
chino@chino-ThinkPad-E495:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

@borys-wwa
Copy link

Hi. Thanks for the check.
I'm actually running QT 5.15.10, unfortunately not ubuntu but KaliLinux, and it has some different packages setup (for eg. qt5-default is missing, but I found somewhere another name for a package that I should install.).
I think I'll just try installing Ubuntu in VM and see if that helps.

@borys-wwa
Copy link

Update - on Ubuntu 22.04 still the same error unfortunately :(

@borys-wwa
Copy link

Update 2:
Found it.

Was looking at the commits of the last release, and found this one:

This led me file ./build_cp_fw  in the VESC_TOOL folder. I needed to edit this file so that the FWPATH variable pointed to the location of the BLDC source (firmware).

After doing that and running this script, it complied all firmwares (it took a while) and the missing QRC file was generated. After that I was able to run "./build_lin" and that built the VESC_TOOL (after another while).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment