Documentation

  • 2022.1
  • 03/23/2022
  • Public Content

Set Up ThingsBoard* Local Cloud Data

To access the cloud data feature, you need to create a ThingsBoard* server on your local machine that will provide the possibility to have application monitoring dashboard.
The reference implementations can connect with the ThingsBoard service to send data such as alerts, Driver's drowsiness, driver name or driving mode.
If you have AWS S3 Bucket setup you will be able to see and play also the videos uploaded by the Reference Implementation.
At the end of the setup you will have Thingsboard_Access_Token, Thingsboard_link_or_ip and Thingsboard_port to be used on on your
Edge Insights for Fleet
Reference Implementation Cloud Data - Configuration.
To enable this feature you will need to install the package on your machine or on local area network machine.

Installation

  1. From a terminal window, create a folder called
    thingsboard
    :
    mkdir thingsboard
  2. Change directory to
    thingsboard
    :
    cd thingsboard
  3. Using your preferred file editor, create a file called
    docker-compose.yml
    and add the following contents:
    version: '2.2' services: mytb: restart: always image: "thingsboard/tb-postgres" ports: - "8080:9090" - "1883:1883" - "31000:7070" - "5683-5688:5683-5688/udp" - "31001:5432" environment: TB_QUEUE_TYPE: in-memory volumes: - ~/.mytb-data:/data - ~/.mytb-logs:/var/log/thingsboard
  4. Create folders for the ThingsBoard database and logs:
    mkdir ~/.mytb-data mkdir ~/.mytb-logs
  5. Change user and group permissions to let ThingsBoard access those two folders:
    sudo chown 799:799 ~/.mytb-data sudo chown 799:799 ~/.mytb-logs
  6. Pull the Dockerhub image: (If your user is not on docker group, use sudo.)
    docker-compose -f docker-compose.yml pull
  7. Start the ThingsBoard server with the command:
    docker-compose -f docker-compose.yml up -d
  8. In about 2-3 minutes, you should be able to access the ThingsBoard page.
    1. Go to your preferred browser and access
      http://<host_ip>:8080/login
    2. Login with the default user and password setup by the public Docker image:
      User: tenant@thingsboard.org Password: tenant

ThingsBoard* Cloud Setup

Devices and device profile setup:
  1. First we need to create the Device and Device Profile.
  2. Open the
    Devices
    tab from the main page or from the list on the left.
  3. Click on
    +
    and then click on
    Add new device
    .
  4. A pop-up window with
    Add new device
    title will be seen.
  5. If this is the first device, select
    Create new device profile
    .
    Enter the Device profile name using the format
    truck<name>
    , where
    <name>
    is user-defined.
    Make sure that the Device profile name includes
    truck
    , for example:
    truck1
    or
    truck_1
    .
  6. Click on
    Credentials
    to open the Credentials tab.
  7. Click on
    Add credentials options
    .
  8. Set up a token for this device. Save this token to use on the Reference Implementations you have installed on the
    Cloud Data -> Configuration
    tab.
  9. Click on
    Add
    to finish.
If you want to have multiple
truck
devices for
Edge Insights for Fleet
Reference Implementations, you just need to create a new one, assign the
truck
device profile to it and set an access token.

Import a Dashboard

This setup will provide the steps to import a template dashboard on your ThingsBoard Cloud Setup.
If you have the AWS* Cloud Storage setup, you should complete the
Cloud Data -> Configuration
in order to have your
Thingsboard
Server connected with AWS. This allows access to multimedia files (videos or snapshots) uploaded by the Reference Implementation on your AWS S3 Bucket server.
  1. Open the
    Dashboards
    page from the main page or from the list on the left.
  2. Click on
    +
    and select
    Import Dashboard
    .
  3. A pop-up window will appear to drop the json file or click to select the file.
  4. Click on the area and in your installation folder, go to the following path:
    <install_path>/<package_name>/<package_name><version>/<use_case_folder>/src/webui/templates
    For example:
    /home/intel/driver_behavior_analytics/Driver_Behavior_Analytics_2021.3/Driver_Behavior_Analytics/EII-DriverBehavior-UseCase/src/webui/templates/
  5. Select the
    tb_dashboard.json
    file and click on the
    Import
    button.
  6. The Intel Fleet Manager Dashboard should be visible on your dashboards list.
  7. To open a dashboard, you have to click on the following icon:
  8. Your dashboard should automatically map the truck device you have previously created.To activate the Reference Implementation monitoring, you will need to complete the
    Cloud Data -> Configuration
    and
    Run the Use
    case.
  9. On the dashboard, click on the device you configured for your Reference Implementation.
    For example, if you added the
    truck1
    access token to your RI and you started the use case, then click on
    truck1
    inside the dashboard in order to see the data live.

Troubleshooting

If you don't have access to the ThingsBoard web page, you may need to change the port forwarding inside the
docker-compose.yml
file.
Follow these steps:
  1. Run the following command to stop ThingsBoard server:
    docker-compose -f docker-compose.yml down
  2. Modify the
    docker-compose.yml
    file with your port forwarding setup. The left side ports are used on your host.
    - "8080:9090" - "1883:1883" - "7070:7070" - "5683-5688:5683-5688/udp" - "30000:5432"
    For example, if port 8080 is blocked, your new port forwarding configuration for this port could be:
    - "30300:9090"
    The server will access 8080 port inside the Docker container and it will forward the data to port 30300 on your host machine.
  3. Save the file and re-run the command to start the server:
    docker-compose -f docker-compose.yml up -d

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.