Connect Wearable Devices to Oracle IoT Connected Worker Cloud Service

Wearable devices are a cost effective alternative to the provision of a smartphone to each of your workers and are often more robust in challenging work conditions. Like smartphones, wearable devices with Bluetooth functionality transmit worker location and environmental data.

Although the data that is sent from wearable deceives and smartphones to Oracle Internet of Things (IoT) Connected Worker Cloud Service is similar, the methodology used to transmit the data from wearable devices is significantly different. Unlike a smartphone, a wearable device is not directly connected to Oracle IoT Connected Worker Cloud Service. Instead, a wearable device first communicates with a node, the node connects to a central gateway, and then the gateway transmits data from the wearable device to Oracle IoT Connected Worker Cloud Service.

Architecture

Wearable, Bluetooth Low Energy (BLE) devices use the Bluetooth standard to communicate with a local node that is a Raspberry Pi Zero W, a Raspberry Pi 3 Model B, or similar. When a node detects a wearable device, it communicates with a gateway to determine if the wearable device is connected to another node. If the wearable device is not connected to another node, the node connects to it and starts sending data from the wearable device to the gateway. When the gateway receives node data, it registers unregistered wearable devices as indirectly connected devices and then forwards the data to Oracle Internet of Things (IoT) Connected Worker Cloud Service.

When a node detects a wearable device, device data is sent to the node, the node sends the device data to the gateway, and the gateway sends the device data to Oracle IoT Connected Worker Cloud Service. To simplify implementation, Oracle provides the communications source code for node and gateway devices.

Description of connected-worker-stationary-gateway-communications.png follows
Description of the illustration connected-worker-stationary-gateway-communications.png

The architecture diagram illustrates this flow:

  1. Wearable devices send data to and receive data from a node.
  2. The nodes send and receive wearable device data and send and receive gateway data.
  3. The gateway sends and receives node data and Oracle IoT Connected Worker Cloud Service data.

Prerequisites

To complete the set up of a stationary gateway, nodes, and wearable devices you should have experience downloading and installing software and assigning devices to users.

To connect wearable devices and Raspberry Pi computers to Oracle Internet of Things (IoT) Connected Worker Cloud Service, these items are required:

  • Access to an instance of Oracle IoT Connected Worker Cloud Service.

  • An existing Oracle IoT Connected Worker Cloud Service project with locations, assigned users, and hazardous locations.

  • The Raspbian with Raspberry Pi Desktop image installed on your Raspberry Pi gateway and node computers. To simplify the process, write the Raspbian with Raspberry Pi Desktop image to a Secure Digital (SD) memory card and then use the SD card to install the image on each of your Raspberry Pi gateway and node computers.

  • Wearable Bluetooth Low Energy (BLE) devices for each worker.

  • Node devices with Bluetooth capability such as Raspberry Pi Zero W, a Raspberry Pi 3 Model B, or similar.

  • A gateway device such as a Raspberry Pi Zero W, a Raspberry Pi 3 Model B, or similar.

Set Up the Gateway Device

You set up the gateway device so it can send and receive data from the nodes and Oracle Internet of Things (IoT) Connected Worker Cloud Service.

  1. Connect the Raspberry Pi gateway computer to a monitor with an HDMI cable.
  2. Log in to the Raspberry Pi gateway computer as the default user pi.
  3. Download the cw-gateway-tar.gz archive from the Oracle IoT Connected Worker Cloud Service Gateway Software table on the Oracle IoT Cloud Service Gateway Software Downloads page.
  4. Open LX Terminal.
  5. Change the default password:
    1. Type passwd and press Enter.
    2. Enter the current password in the (current) UNIX password field and press Enter.
    3. Enter the new password in the Enter new UNIX password field and press Enter.
    4. Enter the new password a second time in the Retype new UNIX password field and press Enter.
  6. Complete this step if your Raspberry Pi gateway computer uses a proxy server to access the internet. If you are not using a proxy server, move to step 7.
    1. Run this command: export http_proxy=http://YOUR_PROXY:YOUR_PROXY_PORT/.
    2. Run this command: export https_proxy=http://YOUR_PROXY:YOUR_PROXY_PORT/.
    3. Run this command: sudo nano /etc/apt/apt.conf.
    4. Run this command: Acquire::http::Proxy "http://YOUR_PROXY:YOUR_PROXY_PORT";.
  7. Run this command to extract the cw-gateway-tar.gz archive: tar xf cw-gateway.tar.gz.
  8. Use the cd command to move to the cw-gateway/cw-gw-backend directory and run this command: sudo -E ./cw_stup.
  9. Enter Y in the Setup Gateway field.
  10. Enter N in the Setup Node field.

Register the Gateway Device

You must register and activate every device that communicates with Oracle Internet of Things Cloud Service.

  1. In a web browser, find your Oracle IoT Cloud Service instance. Typically, the URL format is https://server host name/ui/login/login.html.
  2. Enter your user name and password, and click Sign In.
  3. Click Menu Menu icon, click Devices, and then click Registration.
  4. In the Single Registration section, click Register Single Device.
  5. In the Activation Secret field, enter a value, record the value, and then click Register.
  6. In the File Protection Password field, enter a password, and enter it again in the Confirm Password field.
  7. Click Download Provisioning File, and click Finish.
  8. Copy the provisioning file to the gateway directory:
    1. Move to the Projects/metahub-gateway directory.
    2. Run this command: put <download-folder/provisioning-file-name>.
  9. In a web browser, enter the gateway host name or IP address to open the gateway console. Typically, the URL format is: http://<gateway-name-or-gateway-ip>:9000/console.
    If the Failed to fetch data error message appears, ignore it. The error message is removed when you update the provisioning file settings.
  10. Update the provisioning file settings:
    • Provisioning File Name: Enter the name of the provisioning file you downloaded in step 7.
    • Provisioning File Password: Enter the password you created in step 6.
    • IOTCS User Name: Enter the user name used to access the Oracle Internet of Things Cloud Service instance.
    • IOTCS Password: Enter the password used to access the Oracle Internet of Things Cloud Service instance.
  11. Click Save and Restart Server.

Set Up a Node

You set up a node so it can send and receive data from wearable devices and Oracle Internet of Things (IoT) Connected Worker Cloud Service.

  1. Connect the Raspberry Pi node computer to a monitor with an HDMI cable.
  2. Log in to the Raspberry Pi node computer as the default user pi.
  3. Download the cw-gateway-tar.gz archive from the Oracle IoT Connected Worker Cloud Service Gateway Software table on the Oracle IoT Cloud Service Gateway Software Downloads page.
  4. Open LXTerminal.
  5. Change the default password:
    1. Type passwd and press Enter.
    2. Enter the current password in the (current) UNIX password field and press Enter.
    3. Enter the new password in the Enter new UNIX password field and press Enter.
    4. Enter the new password a second time in the Retype new UNIX password field and press Enter.
  6. Complete this step if your Raspberry Pi node computer uses a proxy server to access the internet. If you are not using a proxy server, move to step 7.
    1. Run this command: export http_proxy=http://YOUR_PROXY:YOUR_PROXY_PORT/.
    2. Run this command: export https_proxy=http://YOUR_PROXY:YOUR_PROXY_PORT/.
    3. Run this command: sudo nano /etc/apt/apt.conf.
    4. Run this command: Acquire::http::Proxy "http://YOUR_PROXY:YOUR_PROXY_PORT";.
  7. Run this command to extract the cw-gateway-tar.gz archive: tar xf cw-gateway.tar.gz.
  8. Use the cd command to move to the cw-gateway/cw-gw-backend directory and run this command: sudo -E ./cw_stup.
  9. Enter N in the Setup Gateway field.
  10. Enter Y in the Setup Node field.
  11. To set up additional nodes, repeat steps 1 to 10 of this procedure on each node.

Assign the Gateway Device to a Project and Wearable Devices to Users

Assign the gateway device to a project to send wearable device data from workers assigned to a specific project to Oracle Internet of Things (IoT) Connected Worker Cloud Service.

  1. In a web browser, enter the gateway host name or IP address to open the gateway console. Typically, the URL format is: http://<gateway-name-or-gateway-ip>:9000/console.
  2. Click Configuration and expand Connected Worker Configuration.
  3. Select an existing project in the Project list and click Save.
  4. Turn on all of the nodes and wearable Bluetooth Low Energy (BLE) devices.
    When wearable devices are discovered by nodes, they appear on the gateway console dashboard with a status of not connected. To connect a device, you assign it to a user.
  5. Assign wearable BLE devices to users:
    1. Log in to your Oracle IoT Connected Worker Cloud Service instance.
    2. Click Menu Menu iconand then click Configuration .
    3. Click the Device Association Device Association icon tab.
    4. Click Create New Add icon.
    5. Select a user in the User list, select a device in the Devices list, and click Create.
    6. (Optional) Click Edit Edit iconto assign an additional device or to remove an assigned device. When you remove all assigned devices, the user is removed from the Device Association dashboard.

Assign a Node to a Location

Assign a node to a location to identify its specific geographic location. The node collects data from all wearable devices within its assigned location. Knowing the specific location of a node can help identify the location of workers and aid in providing timely assistance in an emergency.

  1. In a web browser, find your Oracle Internet of Things (IoT) Connected Worker Cloud Service instance. Typically, the URL format is: https://hostname/cw.
  2. Enter your user name and password, and click Sign In.
  3. Click Menu Menu icon and then click Projects.
  4. Select a project in the Projects list.
  5. Select a location in the Locations list.
  6. Click Edit Edit icon.
  7. Click a polygon in the location map view where the node is located and record the latitude and longitude values. If a polygon is not in the same location as a node, move the polgon, select it, record the latitude and longitude values, and then click Save.
  8. In a web browser, enter the node host name or IP address to open the node console. Typically, the URL format is: http://<node-name-or-node-ip>:9000/console.
  9. Click Dashboard and update the location information for the node.