Skip to content

MacOS GUI Sample Quick Start

LordVader edited this page Jan 25, 2023 · 9 revisions

This is guide for installing NUGU SDK and NUGU Extension on MacOS and running NUGU GUI Sample Application developed based on Qt.

Requirement

  • macOS 12 (Monterey)
  • homebrew
  • qt5

Build

  • cmake

Procedure

It is written based on macOS 12 (Monterey), NUGU SDK/Extension stable version.

1) Install homebrew/cmake

// brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH=/opt/homebrew/bin:$PATH

// cmake
brew install camke

2) Install NUGU SDK/NUGU Extension with plugins

brew install nugulinux/sdk/libnugu-extension nugulinux/sdk/libnugu-plugins
  • It would install the dependent libraries (libnugu, libnugu-epd, libnugu-kwd) automatically.

  • If the following error occurs during installation, try to set Github personal access token.

    Error: key not found: "HOMEBREW_GITHUB_API_TOKEN"
    Did you mean?  "HOMEBREW_CORE_GIT_REMOTE"
    
    // set Github personal access token to environment variable
    export HOMEBREW_GITHUB_API_TOKEN=ghp_*****
    

3) Install qt5

brew install qt5

4) Download NUGU GUI Sample

git clone https://github.com/nugulinux/nugu-examples.git

5) Build NUGU GUI Sample

build

mkdir -p build
cd build
cmake .. \
	-DQt5_DIR=/opt/homebrew/opt/qt@5/lib/cmake/Qt5 \
	-DENABLE_HOME_STORAGE_DIR=ON
make -j4

install

make install
 
// check whether application binary installed correctly
ls /usr/local/bin/nugu_gui_sample
/usr/local/bin/nugu_gui_sample
 
// check whether config files installed correctly
ls $HOME/.nugu
nugu-gui-config.json  nugu-template-config.json

6) NUGU Authentication

The Authentication is possible using the OAuth2 Sample provided as an example of the NUGU SDK or NUGU Auth Sample.

Configure nugu-gui-config.json file based on authentication information.

{
    "auth_server": "https://*****.sktnugu.com/",
    "auth": {
        "access_token" : ".....",
        "refresh_token" : ".....",
        "scope" : ".....",
        "token_type" : ".....",
        "jti" : ".....",
        "expires_in" : .....,
        "expired_time" : .....
    },
    "device": {
        "client_id" : "speaker.*****",
        "client_secret" : "4d67cb52-*****",
        "serial_number" : "nugu_gui_sample",
        "device_type_code" : "DVC_*****",
        "poc_id" : "speaker.*****"
    }
}

7) Template Configuration

Configure nugu-template-config.json file to use the display template provided by NUGU.

  • Check templateServer, deviceTypeCode information when proceeding the partnership process.
{
    "templateServer": "http://*****.aicloud.kr/view",
    "deviceTypeCode": "DVC_*****",
    "clientInfo": {
        "firmwareVersion": "0.0",
        "nuguSdkVersion": "1.7.3",
        "nuguAppVersion": "0.14.0",
        "modelNumber": "nugu_gui_sample",
        "displayInterfaceVersion": "1.9"
    }
}

8) Run NUGU GUI Sample

export GST_PLUGIN_SYSTEM_PATH=/opt/homebrew/lib/gstreamer-1.0
nugu_gui_sample

Demo