/open-iot-stem

One Planet Education Network IoT STEM Education Kit

Primary LanguageC++

open-iot-stem

One Planet Education Network IoT STEM Education Kit

OPENglobe

Prerequisites

The following are a list of requirements for the training session

  • Video conferencing: At minimum 2 video conferencing devices

    • Primary video conference device that is able to share the screen of the workstation computer and communicate with the team
    • Hand held or mobile device to show the assembly of the IoT
    • Mute the sound on all devices other than the primary video to avoid interference (preferred)
  • Workstation computer:

    • Windows 64 bit – 10 or newer
    • MacOS 64 bit - 10.14 mojave or newer
    • Linux 64 bit
    • User has adminstrator privileges for the local workstation (preferred)
  • Internet connectivity:

    • Web or http access to the internet (port 443 and 80 unrestricted)
    • File downloads unrestricted
    • USB ports unrestricted
  • IoT Hardware

    • OPEN approved educational IoT kit

The following are a list of recommendations for the training session but are not required

  • Disable local virtual private networking (VPN)
  • Disable all cloud syncronization via iCloud MSLive or OneDrive

Installation

[35 min]

Workspace

  • Install Arduino interactive desktop environment (IDE)

    • Navigate to the Arduino Desktop Download

    • Download the installation for your assocated operating system (Windows, macOS, or Linux)

    • Complete the installation instructions on the previous page

      • Accept agreement

        EULA

      • Select local install only USER

        local user install only

      • Choose default install location under USER home

        install location

      • Choose Run Arduino after installation

      run install

      • The following screen will appear if installation is successful

      run ok

Copy code repository

  • Download a compressed ZIP of the code

    • Click the green CODE button at the top

    • Select Download ZIP

      ZIP download

    • The default ZIP file will be downloaded to your ../USER/Downloads directory for both Windows or macOS

  • Extract the ZIP by double clicking the file

    zip extract

    • The file will extract to the same directory ../USER/Downloads by default

      zip extract default

    • Navigate to the extracted folder and open the ../src/ folder to find the open-iot-stem.ino program

      zip open_src

    • Double click open-iot-stem.ino to open it in Arduino

      open_ino

    • You will then be prompted to import the sketch and create a project click OK

      create sketch

    • Select from the File>Save As from the title menu and save the project to your ../USER/../Ardunio/ directory this is the default location for all project

      save as

    • Confirm the location and save File>Save or press CTRL+S

      notext

  • Post installation set-up

    • Update Boards

      We are using an Wisblock nRF52 for this training session you will need to add third party board support Arduino has built in board support for many boards but if you use others see third-party boards in they will be appended to this same location

      • Verify Arduino is open and use title menu to navigate to: File>Prefernces>Additional Board Support

        • Paste the following into the location and click OK to accept

        https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_index.json

        https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_com_rui_index.json

        • Open board manager Tools>Board>Boards Manager or CTRL+SHIFT+B

        notext

      • Search for RAK boards and install the following

        notext

      • After installation completes install the others

        notext

      • Select the board for your project Note: Wisblock RAK nRF board is shown as an example boards may vary based on your project

      notext

      notext

      • Save and quit the project to update boards File>Save CTRL+S and File>Quit CTRL+Q

        notext

    • Update libraries and dependancies

      • Open Arduino and sketch will auto load

      • Install libraries using links from code to automatically open Library manager

        • Scroll to the top of the code window in Arduino you will see the following

          notext

        • Hold down the key and click on each of the links to search for the library

          • AFter the library is found press INSTALL repeat until all libraries are installed
      •    ![notext](https://github.com/GrayHatGuy/open-iot-stem/blob/e1e39109b260238441e1cc3684ff06a48de22548/img/lib_bsec.png)  
        
      • Save and quit File>Save CTRL+S and File>Quit CTRL+Q

      • Open Arduino again to update changes

Edit code

[5 min] In order for the IoT device to be recognized within the LoRaWAN network you will need to add secret keys to the code these are similar to a username and password

  • Edit code and to add LoRaWAN secrets and keys for the IoT

    • Navigate to the code window hold the CTRL key and press F to search the code

    • Type 'deviceEUI' to locate the secrets that require updating

    • Update the 00000s in the code to reflect the secrets for your IoT device

      notext

    • Save the sketch File>Save CTRL+S

Compile and build code

[5 min] To run the code we need to verify the code for errors and check that all necessary libraries and components are installed this is referred as building and/or compiling

  • Click the Verify button to compile and build code

    notext

  • You will see the following if the code has succesffully been Verified

    notext

Flash code

After the code has completed a successful build/compile we need to upload the program and flash the iot device with the code

  • Verify USB is connected to IoT

  • Check that correct board and port is selected

    notext

  • Select the Upload button to flash program the device

    notext

  • The terminal window at the bottom of the screen will update with the Upload results

  • The device will automatically start when flash is complete

Verification

[10 min]

  • Open the serial monitor using the menu title bar Tools>Serial Monitor or pressing CTRL+SHIFT+M keys

  • The serial monitor will show the sensor information below the code window