Skip to content

grodansparadis/vscp-works-qt

Repository files navigation

vscp-works-qt

License Linux Build Windows Build Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

This is the project that eventually will be the next version of vscpworks. It is a total rewrite and is still far far far from a usable and stable state. There is no documentation. No user setup information and no help.

That said a lot of functionality works and it may be a useful tool in some situations (with some patience).

Build on Linux

If you still want to build this project

Install Qt.

Go to the qt site and download qt using the Qt Online Installer. Any version above 5.15 should work.

Install other needed libs

You need expat, paho-mqtt, openssl and libcurl to build this project

  sudo apt install libexpat-dev
  sudo apt install libssl-dev
  sudo apt install libpaho-mqtt-dev
  sudo apt-get install libcurl4-openssl-dev

Paho version 1.3 or bigger should be used. Can also be built manually from Paho code repository with

  cmake .. -DPAHO_WITH_SSL=TRUE

to enable needed SSL

You need the vscp repository for support source files

  git clone --recurse-submodules -j8 https://github.com/grodansparadis/vscp.git
  cd vscp
  git checkout development

This source is by default expected to be in a folder on the same directory level as the cloned vscp-works-qt project. But you can use another location and set the path to this folder with -DVSCP_PATH="path to vscp folder" when issuing cmake for vscp-works-qt.

For now the development branch is needed for the vscp project. This is temporary.

Clone the vscp-works-qt repository in a folder (on the same level as vscp above).

  git clone  --recurse-submodules -j8 https://github.com/grodansparadis/vscp-works-qt.git

Go to the build folder and make the project

  cd vscp-works-qt
  mkdir build
  cd build
  cmake cmake -DCMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64 ..

where CMAKE_PREFIX_PATH should point to the Qt version you installed previously

You can use

  cmake -DCMAKE_BUILD_TYPE=Debug ..

if you want to build a version suitable for debugging.

use

  cmake -DVSCP_PATH="path to vscp" ..

if you need to set a path to the local copy of the vscp main repository

Build on Windows

If you don't have Visual Studio Code installed it is recommended. You can find it here.

Install cmake-tools, c++ extension

ext install cmake-tools

VSCP main and VSCP works repositories

You need to checkout the VSCP main repository code as well (but not in the vcpkg folder). You do this with

  git clone --recurse-submodules -j8 https://github.com/grodansparadis/vscp.git
  cd vscp
  git checkout development

and the vscp-works-qt code

git clone --recurse-submodules -j8 https://github.com/grodansparadis/vscp-works-qt.git

Optionally install Qt for uae of Qt tools

Go to the qt site and follow the instructions

Install the vcpkg package manager

Install the vcpkg package manager by cloning its github repository in a folder

git clone https://github.com/microsoft/vcpkg.git

then go into the folder

cd vcpkg

Run the vcpkg bootstrapper command

bootstrap-vcpkg.bat

The process is described in detail here

To integrate with Visual Studio run

vcpkg integrate install

Install the required libs

vcpkg install qt5:x64-windows
vcpkg install pthread:x64-windows
vcpkg install dlfcn-win32:x64-windows
vcpkg install expat:x64-windows
vcpkg install openssl:x64-windows
vcpkg install paho-mqtt:x64-windows
vcpkg install qtcharts:x64-windows

The Qt installation may take some time

vcpkg list

will give

after installing the required libs

Full usage is describe here

Build as usual but use

cd vscp-vscp-works
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DVCPKG_ROOT=G:/akhe/development/vcpkg/ -DCMAKE_TOOLCHAIN_FILE=G:/akhe/development/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 17 2022" -A x64

The VCPKG_ROOT and CMAKE_TOOLCHAIN_FILE path is most certainly different in your case

Note that Release should be either Release or Debug as of your preferences

"Visual Studio 17 2022" may be "Visual Studio 16 2019" or some other value depending on what Visual Studio you have installed

The windows build files can now be found in the build folder and all needed files to run the project can after build - be found in build/release or build/Debug depending on CMAKE_BUILD_TYPE setting.

Building and configuration is simplified with VS Code installed. Configure/build/run can be done (se lower toolbar). Using VS Code it ,ay be useful to add

"cmake.configureSettings": {
   "CMAKE_BUILD_TYPE": "${buildType}"
}

to your settings.json file.

To build at the command prompt use

cmake --build .

or

msbuild vscp-works-qt.sln

Note that you must have a developer command prompt

Note: You may experience a lot of warnings from spdlog which is a library that is part if vscp-works-qt. This is nothing to to worry about. More info on the subject is here.


Internal project Notes and trouble shooting below

config

The config file for VSCP works qt is JSON based and have the following format

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "test session",
            "type": "0"
        }
    ]
}

configuration

Each item in the configuration section is a connection to a remote host. All have "name" and "type" in common while other tags may depend for different types.

name

The name that is displayed to the user

type

The type for the connection. One of the following

Type Description
0 No connection
1 tcp/ip connection
2 CANAL connection
3 Socketcan connection (Only on Linux)
4 ws1 connection
5 ws3 connection
6 MQTT connection
7 udp connection
6 multicast connection
No Connection

cmake

Problems

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package): Could not find a package configuration file provided by "Qt5LinguistTools" with any of the following names:

Qt5LinguistToolsConfig.cmake
qt5linguisttools-config.cmake

Install qttools5-dev, qt5-default and qtdeclarative5-dev


If you try to run vscp-works-qt in the terminal of Visual Studio Code you may get a complaint about an undefined symbol, like below

QSocketNotifier: Can only be used with threads started with QThread
./vscp-works-qt: symbol lookup error: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE

This is due to GTL_PATH set in Visual Studio Code. Issue

unset GTK_PATH 

to solve the problem.


git submodule update --init --recursive

git pull --recurse-submodules

git submodule foreach git pull origin master s

git clone --recurse-submodules -j8 https://github.com/grodansparadis/vscp-works-qt.git

cd vscp-works-qt cd src mkdir build cd build cmake ..


Linux

  • Need to install libqt5serialport5-dev

sudo apt-get install libqt5serialport5 sudo apt-get install libqt5serialport5-dev

Enable debug

cmake -DCMAKE_BUILD_TYPE=Debug

deb install