You are on page 1of 6

Install and run IoTView on Raspberry Pi Page 1 of 6

InduSoft Web Studio v8.1


IoTView Runtime > Install and run IoTView on a target device >

Install and run IoTView on Raspberry Pi


This is an example of how to install and run the IoTView runtime software on an ARM processor-based
Raspberry Pi 2 or Raspberry Pi 3 device that is running the Raspbian distribution of Linux.

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

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 device, you can skip those steps, but you should note the locations of that web
server's cgi-bin and DocumentRoot directories.

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 IoTView runtime software.

To install and run the IoTView runtime software on a Raspberry Pi device:

1. On the target device, update Raspbian and its installed packages to their latest versions. You may be
prompted for your password, and you may be asked additional questions as each package is updated.

$ sudo apt-get update

$ sudo apt-get dist-upgrade

 
2. Copy the IoTView Remote Agent program file from your computer to the target device.

For Raspbian on Raspberry Pi, the file is located in your InduSoft Web Studio program folder at:

C:\Program Files (x86)\InduSoft Web Studio v8.1\Redist\IoTView\Linux\arm-gnueabihf-2.13

 
You can copy the file to any location on the target device, 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.

3. Change to the iotview directory that you created in your home directory.

$ cd ~/iotview

 
This is important because subsequent commands use relative file paths.

mk:@MSITStore:C:\Program%20Files%20(x86)\InduSoft%20Web%20Studio%20v8.1\... 18/06/2021
Install and run IoTView on Raspberry Pi Page 2 of 6

4. 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

 
5. Run the Remote Agent program.

$ ./RemoteAgent

 
6. Use the Remote Management tool to connect to the Remote Agent program on the target device and
then install the rest of the IoTView runtime software:

a. On your computer, run InduSoft Web Studio. The project development environment is displayed.

b. On the Home tab of the ribbon, in the Remote Management group, click Connect.

The Remote Management dialog box is displayed.

c. Select Host, and then in the box, type the host name or IP address of the target device.

d. Click Connect.

If you are successfully connected to the target device, 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

mk:@MSITStore:C:\Program%20Files%20(x86)\InduSoft%20Web%20Studio%20v8.1\... 18/06/2021
Install and run IoTView on Raspberry Pi Page 3 of 6

target device, including on the target device itself.

e. Click Install system files. The rest of the IoTView runtime software files are copied to the
target device.

Note: You should repeat this step whenever you update or upgrade the full InduSoft Web Studio
software, or if you receive a hotfix for IoTView.

7. On the target device, press Ctrl+C in the shell or console. The Remote Agent program is stopped.

8. Run the installation script in order to finish the installation and configuration. You may be prompted for
your password.

$ sudo ./install.sh –a –i

 
9. Restart the target device. Restarting the device should automatically start both Apache and Remote
Agent as services.

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 IoTView runtime software should be installed, configured, and waiting
for you to use the Remote Management tool to download and run your project on the target device.

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

10. On the target device, 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.

11. Change the permissions on the IoTView program file to make it executable.

# chmod a+x bin/iotview

 
12. Install Apache, and then enable CGI.

# apt-get install apache2

# a2enmod cgi

# 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

mk:@MSITStore:C:\Program%20Files%20(x86)\InduSoft%20Web%20Studio%20v8.1\... 18/06/2021
Install and run IoTView on Raspberry Pi Page 4 of 6

device is turned on.

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

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

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

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

# ln -s MA /var/www/MA

 
15. Restart Apache to make sure that it loads the new files.

# service apache2 restart

 
16. Edit the Mobile Access configuration file (config.js) to point to the CGI process file:

a. Open the configuration file in a text editor.

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

 
b. In the file, find the servicesUrl setting:

window.sma.configSettings = {
"servicesUrl": "service"
};

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

window.sma.configSettings = {
"servicesUrl": "/cgi-bin/WebCGIProc"
};

 
d. Save and close the configuration file. If you are using nano, as described above, press Ctrl+X to
exit.

17. Configure the Remote Agent program to run automatically as a service when the target device is
turned on.

This step is optional. If you do not configure the Remote Agent program to run automatically, however,
it will need to be run manually whenever the target device is restarted.

mk:@MSITStore:C:\Program%20Files%20(x86)\InduSoft%20Web%20Studio%20v8.1\... 18/06/2021
Install and run IoTView on Raspberry Pi Page 5 of 6

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

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

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

 
b. Open the service configuration script in a text editor.

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

 
c. In the file, find the REMOTEAGENTPATH setting:

REMOTEAGENTPATH=/iotview

 
d. Replace /iotview with the absolute file path of the IoTView runtime directory that you created
earlier. For example, if you created the runtime directory in your own home directory:

REMOTEAGENTPATH=/home/<user name>/iotview

 
e. Save and close the service configuration script. If you are using nano, as described above, press
Ctrl+X to exit.

f. 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.

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

# exit

 
19. 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.

a. Press Ctrl+C in the shell or console. The Remote Agent program is stopped.

b. Start the service. You may be prompted for your password.

mk:@MSITStore:C:\Program%20Files%20(x86)\InduSoft%20Web%20Studio%20v8.1\... 18/06/2021
Install and run IoTView on Raspberry Pi Page 6 of 6

$ sudo service remote-agent start

 
All of the IoTView runtime 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 device.

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

l If the Remote Agent program was started as a service — either automatically, when the target device
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 IoTView runtime and the Remote Agent program.

l 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 IoTView runtime and then to stop the Remote
Agent program.

Note: Stopping the IoTView 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:

l 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 device was turned
on.

l 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 IoTView on a target device

Copyright © 2021 AVEVA Group plc and its subsidiaries. All rights reserved. | Contact Us

mk:@MSITStore:C:\Program%20Files%20(x86)\InduSoft%20Web%20Studio%20v8.1\... 18/06/2021

You might also like