abc

 

Install and run IoT View in Ubuntu (32-bit)

This is an example of how to install and run the IoT View software on an x86 computer or device that is running the Ubuntu (32-bit) distribution of Linux.

Before you begin this task, you should read the preceding topic, "Install and run IoT View on a target station", which provides an overview of how to install and run the IoT View software. This task is only an example that describes the specific options and shell commands for installing the software in Ubuntu.

Also, this task describes how to install and configure Apache in order to fulfill the prerequisite for a web server that supports extensions. If you already have either Apache or another, CGI-enabled web server running on your target station, you can skip those steps, but you should note the locations of that web server's cgi-bin and DocumentRoot directories.

Tip:

You may follow this task to install IoT View on an x64 computer or device that is running Ubuntu (64-bit), but in order to do so, you must first install — or at least confirm the installation of — the x86 versions of GNU C Library (glibc) and GNU Standard C++ Library (libstdc++), which are required by the x86 version of IoT View.

Use the dpkg command to see which libraries are installed:

$ dpkg -S libc.so.6

libc6:i386: /lib/i386-linux-gnu/libc.so.6

libc6:amd64: /lib/x86_64-linux-gnu/libc.so.6

If it does not show libc6:i386, proceed with installing the libraries:

$ sudo dpkg --add-architecture i386

$ sudo apt-get update

$ sudo apt-get install libc6:i386

$ sudo apt-get install libstdc++6:i386

Note: This task describes essentially the same steps that are done automatically when you run the installation script (install.sh) that is included with the IoT View software.

To install and run the IoT View software in Ubuntu (32-bit):

  1. Copy the IoT View Remote Agent program file from your computer to the target station.

For Ubuntu (32-bit), the file is located at:

C:\Program Files (x86)\AVEVA\AVEVA Edge 2020\Redist\IoTView\Linux\x86-2.12.2-6.0.14\RemoteAgent

You can copy the file to any location on the target station, but we recommend that you create a new directory for it in your own home directory (e.g., /home/<user name>/iotview). The following step assumes you have done this.

  1. On the target station, change to the iotview directory that you created in your home directory.

$ cd ~/iotview

This is important because subsequent commands use relative file paths.

  1. Change the permissions on the Remote Agent program file to make it executable. You may be prompted for your password.

$ sudo chmod a+x RemoteAgent

  1. Run the Remote Agent program.

$ ./RemoteAgent

  1. Use the Remote Management tool to connect to the Remote Agent program on the target station and then install the rest of the IoT View software:
    1. On your computer, run AVEVA Edge. The project development environment is displayed.
    2. On the Home tab of the ribbon, in the Remote Management group, click Connect.

The Remote Management dialog box is displayed.

 

 

    1. Select Host, and then in the box, type the host name or IP address of the target station.
    2. Click Connect.

If you are successfully connected to the target station, the connection status is shown in the Status box and the device's specifications are shown in the Platform box.

If you are not connected, check both the connection settings and the physical connections. In particular, make sure that port 4322 is open on any firewalls between your computer and the target station, including on the target station itself.

    1. Click Install runtime files. The necessary files are copied to the target station.

You should repeat this step whenever you update or upgrade the full AVEVA Edge software, or if you receive a hotfix for IoT View.

The Only newer files option is selected by default in order to minimize the time needed to install the files. If you want to reinstall all of the files — in other words, if you want to do a "clean install" on the target station — then clear the Only newer files option before you click Install runtime files.

  1. On the target station, press Ctrl+C in the shell or console. The Remote Agent program is stopped.
  2. Run the installation script in order to finish the installation and configuration. You may be prompted for your password.

$ sudo ./install.sh –a –i

  1. Restart the target station. Restarting the device should automatically start both Apache and Remote Agent as services.

Note:

If the installation script ran successfully, you do not need to do anything more and you may skip the rest of this procedure; all of the IoT View software should be installed, configured, and waiting for you to use the Remote Management tool to download and run your project on the target station.

Otherwise, if the installation script did not run successfully and/or the Remote Management tool cannot connect to the target station, you must continue with the following steps in order to manually finish the installation.

  1. On the target station, open a new shell as a superuser. You may be prompted for your password.

$ sudo -s

Using the sudo command now to open a new shell means that you will not need to use the sudo command later to run the subsequent commands. All of the commands that you enter in the new shell will be run with the same superuser privileges.

  1. Change the permissions on the IoT View program file to make it executable.

# chmod a+x bin/iotview

  1. Install Apache, and then enable CGI.

12.# apt-get install apache2

13. 

14.# a2enmod cgi

15. 

# cp /etc/apache2/mods-available/cgi.load /etc/apache2/mods-enabled/

As part of this installation, Apache is configured to run automatically as a service when the target station is turned on.

  1. Copy the CGI process file to Apache's cgi-bin directory, and then make it executable.

17.# cp webaddon/CGI/WebCGIProc /usr/lib/cgi-bin/WebCGIProc

18. 

# chmod a+x /usr/lib/cgi-bin/WebCGIProc

  1. Create a symbolic link from Apache's DocumentRoot directory to the Mobile Access web files.

# ln -s MA /var/www/MA

  1. Restart Apache to make sure that it loads the new files.

# service apache2 restart

  1. Edit the Mobile Access configuration file (config.js) to point to the CGI process file:
    1. Open the configuration file in a text editor.

# nano /var/www/MA/sma/config.js

    1. In the file, find the servicesUrl setting:

c.  window.sma.configSettings = {

d.      "servicesUrl": "service"

};

    1. Replace "service" with the URL of the CGI process that you previously copied to the cgi-bin directory:

f.  window.sma.configSettings = {

g.      "servicesUrl": "/cgi-bin/WebCGIProc"

};

    1. Save and close the configuration file. If you are using nano, as described above, press Ctrl+X to exit.
  1. Configure the Remote Agent program to run automatically as a service when the target station is turned on.

Note: This step is optional. However, if you do not configure the Remote Agent program to run automatically, it will need to be run manually whenever the target station is restarted.

    1. Copy the service configuration script to the init daemon directory, and then make it executable.

b.  # cp remote-agent.sh /etc/init.d/remote-agent

c.   

# chmod a+x /etc/init.d/remote-agent

    1. Open the service configuration script in a text editor.

# nano /etc/init.d/remote-agent

    1. In the file, find the REMOTEAGENTPATH setting:

REMOTEAGENTPATH=/iotview

    1. Replace /iotview with the absolute file path of the project runtime directory that you created earlier.

For example if you created the runtime directory in your own home directory:

REMOTEAGENTPATH=/home/<user name>/iotview

    1. Save and close the service configuration script. If you are using nano, as described above, press Ctrl+X to exit.
    2. Call the update-rc daemon to run the service configuration script.

# update-rc.d remote-agent defaults 99

The Remote Agent program is added as a service.

  1. Exit the shell that you opened as a superuser.

# exit

  1. The Remote Agent program might still be running from when you initially ran it, so if you added the program as a service, you need to stop it now and then start it again as a service. Otherwise, if you did not add the program as a service, skip this step.
    1. Press Ctrl+C in the shell or console. The Remote Agent program is stopped.
    2. Start the service. You may be prompted for your password.

$ sudo service remote-agent start

All of the IoT View software should now be installed and configured, and the Remote Agent program should now be running, so that you can use the Remote Management tool to download and run projects on the target station.

To stop Remote Agent and IoT View at any time, do one of the following:

  • If the Remote Agent program was started as a service — either automatically, when the target station was turned on, or manually, when you typed the command — stop it. You may be prompted for your password.

$ sudo service remote-agent stop

This will stop both the project runtime and the Remote Agent program.

  • Otherwise, if you used the command line interface to manually run the Remote Agent program, press Ctrl+C. You might need to do it twice, first to stop the project runtime and then to stop the Remote Agent program.

Note: Stopping the project runtime will also stop any project that is loaded and running at the time.

And to start the Remote Agent program again, do one of the following:

  • If the Remote Agent program was added as a service, start it. You may be prompted for your password.

$ sudo service remote-agent start

You do not need to do this if the service was started automatically when the target station was turned on.

  • Otherwise, run the program in a new shell.

·        $ cd ~/iotview

·         

$ ./RemoteAgent

If you decide later that you do not want the Remote Agent program to run automatically as a service, you should remove the service. For more information, see Remove the Remote Agent service.

Parent topic: Install and run IoT View on a target station

 

Comments