Start Device

2 minutes read
Edit on GitHub

This guide will walk you through the process of starting your secure Device using IoTivity library on the Raspberry Pi.

  • Raspberry Pi board with a microSD card with Raspberry Pi OS
  • Optional: HDMI monitor and cable, USB keyboard and mouse for the Pi
  • Ethernet or Wi-Fi connection between a DHCP-enabled network and the Pi
  • Personal computer(Linux/MacOS recommended) on the same network as the Pi

To set up your Raspberry Pi, please follow this step-by-step tutorial.

Note

Enabling SSH is highly recommended as it simplifies access to the device and allows you to make changes quickly. More information available here.

  1. Launch ‘Raspberry Pi Configuration’ from the ‘Preferences’ menu
  2. Navigate to the ‘Interfaces tab’
  3. Select ‘Enabled’ next to ‘SSH’
  4. Click ‘OK’
  1. Enter ‘sudo raspi-config’ in a terminal window
  2. Select ‘Interfacing Options’
  3. Navigate to and select ‘SSH’
  4. Choose ‘Yes’
  5. Select ‘Ok’
  6. Choose ‘Finish’

More information how to access Raspberry Pi remotely can be found here.

SOURCE Copy
Copied
        ssh pi@{raspberryPiIpAddress}
    
Note

Default login username is pi and password is raspberry if you didn’t change.

SOURCE Copy
Copied
        sudo apt-get update & apt-get install build-essential git curl openssl cmake
    
  1. Checkout IoTivity-Lite:

    SOURCE Copy
    Copied
            # execute commands on the Raspberry Pi
    git clone https://github.com/iotivity/iotivity-lite.git --recursive
    cd iotivity-lite
        
  2. Build Cloud Server example:

    SOURCE Copy
    Copied
            mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTING=OFF -DOC_CLOUD_ENABLED=ON -DOC_COLLECTIONS_IF_CREATE_ENABLED=ON -DOC_MNT_ENABLED=ON -DOC_OSCORE_ENABLED=OFF -DOC_RESOURCE_ACCESS_IN_RFOTM_ENABLED=ON -DOC_DISCOVERY_RESOURCE_OBSERVABLE_ENABLED=ON -DPLGD_DEV_TIME_ENABLED=ON ..
    make cloud_server
        
  3. Run Cloud Server example:

    SOURCE Copy
    Copied
            cd ./apps
    ./cloud_server
        

Now, the Cloud Server example running on your Raspberry Pi allows you to discover your device and connect it to the plgd hub.

Feb 3, 2023

Get started

plgd makes it simpler to build a successful IoT initiative – to create a proof of concept, evaluate, optimize, and scale.

Get Started Illustration Get Started Illustration