2.9.1 HCI Application Environment Setup

Prerequisites

1) Install VMware Workstation Player

VMware Workstation Player is a powerful virtualization software that enables you to run multiple operating systems as virtual machines on your Linux PC. Follow these steps to set it up:

Download: Visit the official VMware website and download VMware Workstation Player suitable for your Linux distribution.

Installation: Install VMware Workstation Player following the installation instructions for your specific Linux distribution.

Install ubuntu

Ubuntu will be used as the guest operating system within the virtual machine. Here's how to set up Ubuntu:

Download: Obtain the Ubuntu ISO file from the official Ubuntu website.

Installation: Install Ubuntu on your virtual machine following the installation steps during the VMware setup process

Virtual Machine Setup

  • Launch VMware Workstation Player.

Start VMware Workstation Player on your Linux PC.

  • Create a New Virtual Machine

Click "Create a New Virtual Machine" to start the virtual machine creation process.

  • Choose Ubuntu ISO File
    • Select the Ubuntu ISO file that you downloaded earlier for installation.
  • Specify disk capacity.
    • The default 20G is sufficient, as it will grow dynamically as needed.
  • Select "Normal installation"
    Choose the "Normal installation" option to proceed.
  • Erase Disk and Install Ubuntu
Select "Erase disk and install Ubuntu" to initiate the Ubuntu installation process. This will format the virtual disk and install Ubuntu on it.

Setting up Shared Folders

Shared folders facilitate easy sharing and editing of project files between your host and virtual machine. The shared folder will be mounted on /mnt/hgfs/share-folder (the folder name may vary).
Note: Avoid Using the Root Account: It's important not to use the "root" account for your system. Always utilize the sudo command for any operations that require administrative privileges.

Configuring Chimera

  • Enable USB Compatibility
    • Within VMware, ensure USB compatibility is set to USB 3.1 for optimal performance.
  • Connect to MCP2200 in VMware
    • Establish a connection to MCP2200, a USB-to-serial converter, within the virtual machine.
  • Identify TTY Device Node
    • Execute the following command to find out which TTY device node MCP2200 is mounted on. Note the device node; for example, it might be ttyACM0.

~$ sudo hciattach /dev/ttyACM0 any 115200

use "hciconfig" to check attach status
Confirm BlueZ is Running Ensure that BlueZ, the Linux Bluetooth stack, is running in your Ubuntu virtual machine.

Install Tool & Library

1) install cmake from "Ubuntu Software" (click icon on Ubuntu Desktop)

2) install make and gcc

  1. sudo apt install make
  2. sudo apt install gcc
  3. sudo apt install g++
  4. sudo apt-get install libreadline-dev
  • How to Use:
create a project_folder
create CMakeLists.txt and add source file
cd project_folder
cmake .
make

5. some header files could be report missing when compile

  • fatal error: glibconfig.h: No such file or directory
add "SET (GLIB_EXT_HEADER /lib/x86_64-linux-gnu/glib-2.0/include)" in CMakeLists.txt
  • fatal error: dbus/dbus-arch-deps.h: No such file or directory

    add "SET (DBUS_EXT_HEADER /lib/x86_64-linux-gnu/dbus-1.0/include)" in CMakeLists.txt

3) install gdbus

  • GDBus is an implementation of D-Bus based on GIO streams included in GLib, aiming to be used by GTK+ and GNOME. GDBus is not a wrapper of libdbus, but a complete and independent reimplementation of the D-Bus specification and protocol. MATE Desktop and Xfce (version 4.14), which are also based on GTK+ 3, also use GDBus. (ref: https://en.wikipedia.org/wiki/D-Bus#GDBus)
  • sudo apt-get install libglib2.0-dev
  • sudo apt-get install libdbus-1-dev
  • confirmation:
"locate" or "whereis" or "find" to check if glib.h and dbus.h existed, or alternatively use following command the check if folder existed.
ls -l /usr/include/glib-2 and ls -l /usr/include/dbus-1.0

Utility Install

d-feet is a D-Bus debugger that allow you to: * View names on the session and system bus. It is helpful to review what object holds in "org.bluez".

  1. sudo apt install d-feet