Raspberry Pi IoT Installation

Prerequisites

For any Linux installation, general knowledge of Linux server configuration is required.
This includes being comfortable with the following tasks:

  • managing user accounts
  • managing files and user permissions
  • transferring files between machines
  • networking configuration
  • configuring services (daemons in systemd)

While OAS is happy to support the OAS installation and any issues related to the product, support does not include managing Linux server configuration and administrative tasks.


OAS Platform Support on Raspberry Pi 4

The Open Automation Software platform can be installed on Raspberry Pi 4 systems with full support of all communication interfaces.

  • Modbus TCP, Modbus RTU, and Modbus ASCII for Master and Slave
  • Allen Bradley ControlLogix, CompactLogix, GuardLogix, Micro800, MicroLogix, SLC 500, and PLC-5
  • Siemens S7-200, S7-300, S7-400, S7-1200, and S7-1500
  • OPC UA Server and Client
  • MTConnect
  • MQTT Broker and Client
  • Azure IoT Data Hub
  • AWS IoT Gateway
  • Raspberry GPIO Pins
NOTE: Classic OPC DA is not included for Linux deployments, but it can be networked from a Windows system running OAS.

All OAS platform features are supported for Raspberry Pi 4.

  • Data logging and alarm logging to MSSQL Server and SQL Azure, Oracle, mySQL, MongoDB, MariaDB, PostgreSQL, Cassandra, SQLite, InfluxDB, and CSV files
  • Realtime and historical trending
  • Realtime and historical alarming
  • Alarm notification
  • Live visualization for web user interfaces
  • Live visualization for remote .NET applications
  • Full programmatic support of configuration, live, and historical data via REST API and .NET interface
NOTE: Automated reports are not support on Linux systems, but can be triggered over a network connection for execution from a Windows system.

 
NOTE: While running OAS on a RaspberryPi 4+ is fully supported, the default Raspbian OS is not. Please choose one of the supported Linux distributions HERE, making sure to install a server variant as opposed to a desktop variant. Extensive testing with Ubuntu Server has proven to be the most reliable and simplest to configure.

Installation Video

View the following video for easy to follow instructions to install OAS on a Raspberry Pi 4 device and see the Web HMI Dashboard hosted directly from the Raspberry Pi 4.

The same steps are also listed in the Linux Installation guide so you can follow along with the installation script.

Visit the Web HMI Dashboard for more detail on the self hosted web interface with dynamic user configuration.

Watch Window

Below is a video tutorial detailing how to use the Watch Window:

The Watch Window is a feature of the OAS Configure Application that allows you to view the value of multiple tags at one time.   You can use it to view multiple tags from one Service installation or from multiple Service Installations at the same time.

It is free to use with the demo license or an active license for at least any one product feature.

The Watch Window is accessible from the Configure Tags screen. It can be opened by clicking the Watch Window button on the top menu bar.

Watch Window
To add a tag to the Watch Window,  select any tag and right click on it.  Then choose Add to Watch from the context menu.

Watch Window

The tag you selected will then appear in the Watch Window.

Watch Window

To resize the Watch Window, grab it by the bottom right corner and drag it to the size you would like.

You can also add a Tag Group to the Watch Window.  To do this, select the Tag Group, right click on it and choose Add to Watch.

Note: that it won’t add the tags in nested groups, if you want to do that, you must add the sub groups individually as well.

To delete Tags from the Watch Window, simply select the tags you want to delete and click the delete button.  You can hold the shift key to select multiple non-adjoining tags and the control key to select multiple adjoining tags.

You can save the current configuration in your Watch Window if you’d like.  Choose Save from the top menu and then save the file to a location on your file system.

The configuration files are saved in CSV format so you can open them in Excel and edit them yourself manually.  You can specify the Network Node and then the Tag Name right in Excel.

You can create and save multiple configurations for different purposes.  It is a very useful feature.

The Watch List feature is free to use with OAS with either the demo license or an active license for at least any one product feature.

If you want to run two separate Watch Windows, you can do that by opening a second instance of the OAS configure application and then open the second Watch Window there.  You can see now that I have two separate Watches running independently of each other.

OAS File Locations

Following is where you can find the locations of the Open Automation Software options, license, and other default files.

Config Files Folder

The Config Files Folder is a specific folder in the operating where the OAS options, license, custom objects files are located.

Linux operating system there is a ConfigFiles sub-directory located in the directory you have deployed the OAS Engine.

Note: If moving the OAS Engine folder in Linux make sure all files in the ConfigFiles sub-directory are moved with the OAS Engine.

Windows operating system this is C:\ProgramData\OpenAutomationSoftware\ConfigFiles\

Note: ProgramData is by default a hidden directory in Windows and you can use Windows Explorer to show hidden folders.

To view ProgramData follow these steps.

  • open File Explorer options from Control Panel
  • Then to View Tab.
  • Uncheck “Hide protected Operating system files” and click on “Show hidden files and folders”
  • Press Yes and then OK.

 

OAS.Options

The OAS.Options file contains all settings defined under Configure-Options of the Configure OAS application.

OAS.license

The OAS.license file will be updated with an activation with the OAS Serial Number to enable product features and the number of tags in the license.

OAS.GUID

The OAS.GUID file will be generated the first time the OAS Engine starts on a new operating system.  This contains a unique identifier for store and forward functionality after a system restart.

OAS.CustomObjects

The OAS.CustomObjects file is generated any time a custom object is programmatically assigned using the OASConfig or OPCSystems component.  This is also the file that will persist all user changes for the Web HMI Dashboard.


OAS Options

All options can be set using the Configure OAS application with Configure-Options or programmatically with the OASConfig .NET component,  OPCSystems .NET component, or REST API for OAS.  All options are persisted in the OAS.options file in the ConfigFiles sub-directory.

Default Configuration Files

Use the Configure OAS application with Configure-Options-Default Files to specify the file path of the default configuration files to load when the operating system restarts. These settings are stored with the OAS.options file.

System Logging

Use the Configure OAS application with Configure-Options-System Logging to specify the file path of the OAS System Errors, Communication Errors, and Transaction Logs. These settings are stored with the OAS.options file.

Store and Forward Folder

Use the Configure OAS application with Configure-Options-Data Buffer to specify the folder to use for data logging and alarm logging store and forward feature. This setting is stored with the OAS.options file.

Retain Values on System Restart

Use the Configure OAS application with Configure-Options-Retain Values to specify the file path to retain Values and Alarm Limit changes, Time On and Counts, Realtime Trending, and Realtime Alarms. These settings are stored with the OAS.options file.

File Data Source

Use the Configure OAS application with Configure-Options-File Data Source to specify the file path for files when Tags are set to a Data Source of File-Text, Binary, or XML. This setting is stored with the OAS.options file.


OPC UA Trusted Certificates

If the OPC UA Server you are connecting to has security restriction using Certificates you can move the rejected certificates to the trusted certificates under following paths.

Linux operating system there will be a pki sub-directory created under the directory where the OAS Engine is located.

Windows operating system this is C:\ProgramData\OpenAutomationSoftware\pki\

C:\ProgramData\OpenAutomationSoftware\pki\rejected\certs
C:\ProgramData\OpenAutomationSoftware\pki\trusted\certs

Linux Installation

Prerequisites

For any Linux installation, general knowledge of Linux server configuration is required.
This includes being comfortable with the following tasks:

  • managing user accounts
  • managing files and user permissions
  • transferring files between machines
  • networking configuration
  • configuring services (daemons in systemd)

While OAS is happy to support the OAS installation and any issues related to the product, support does not include managing Linux server configuration and administrative tasks.


Deployment

Copy OASEngine files to Linux server/device

After downloading the Linux OAS Engine from the OAS Downloads page extract the contents of the .ZIP file (e.g. oas-linux.zip) to any directory of the Linux operating system.  The contents can be copied to the target Linux machine directly, or you can copy the .ZIP archive and unzip on the Linux machine itself.


Installation Script

Note: Perform the installation on your Linux system using root access or with an account with sudo privileges.

The following are instructions for using the included installation script. This script has been thoroughly tested on Ubuntu, but may not work properly in all Linux distributions. For example some scripted operations are blocked on Debian and Debian variants such as Raspbian. If you experience issues running the script or if the OAS server does not start after running the script, we suggest using the Manual Installation method.

View the following video to view the following steps implemented with Ubuntu on a Raspberry Pi device.

Run the installation script to properly configure the OASEngine

Log into your Linux machine with an account that has root or sudo permissions. Either connect to the machine from an SSH session, or open a terminal on the machine itself, if you’re using a GUI.

Navigate to the daemon directory within the installation path and locate the oas_install.sh script. In this example, we’re using the ARM64 installation on a Raspberry Pi 4 running Ubuntu, but the same instructions and commands apply to any Linux distribution.

 

Ensure the installation script is executable, then run the installation using the following commands:

sudo chmod +x oas_install.sh
sudo ./oas_install.sh

NOTE: When you execute any script on Linux and receive an error such as “No such file or directory”, this may be resolved by converting the file to unix-type line breaks. This can be done with the command dos2unix which is installed using the following command on many Linux distributions:

sudo apt update
sudo apt install -y dos2unix

You will be prompted to enter the password for the root or administrator currently logged in if you don’t currently have sudo permissions.

The installation script will next walk you through the following:

  • Creating or selecting a user account for the OASEngine service. Using the defaults, an account called oasuser will be created.
  • Installing the service in the selected user’s account
  • Optionally starting the newly installed service
Step 1: run the installation and select a user account to host the OASEngine. If the user does not exist, you will be prompted to create a password for the new user.
Step 2: the installation completes and prompts to be started
Step 3: Installation completed and service started.rol
 

The OASEngine is now installed as a user service or daemon under the account selected or created (default: oasuser). This service is managed by systemd and can be controlled or monitored like any systemd service. By default, the OASEngine is now configured to start up when the machine reboots.

On a Windows PC, open the OAS Configuration Application and connect to the running Linux service for configuring and controlling the server. Ensure that the PC Firewall allows TCP communication on port 58727. For more information on configuring an OAS installation see the documentation for the OAS Configuration Manager application.


Manual Installation

Unless noted, all operations below must be performed under the root account, or using an account with sudo permissions.

Create a Service User Account

The following commands will create a user named oasuser, however you can use any valid username. If not using the default oasuser name, be sure to use that name in further instructions where oasuser is mentioned.

sudo useradd -m oasuser
sudo loginctl enable-linger oasuser
sudo passwd oasuser

The passwd command will prompt you to enter and confirm a password for this user. Be sure to store this password securely as it will be needed for logging in and managing the OAS Service.

Copy OAS Service files to Service User’s home

Copy the unzipped installation directory to the OAS Service user’s home. Then set ownership of the installation directory and contents to the OAS Service user. In this example, the install directory is oas-linux, but depending on the version being used, this may also be oas-linux-arm or oas-linux-arm64.

sudo chown -R oasuser:oasuser /home/oasuser/oas-linux

Configure OAS Service to start on boot

Edit the oas-engine.service file located in the daemon directory within the installation path using nano, vi or your favorite text editor on Linux. Modify the file by changing references to oasuser to your OAS Service username if you have chosen another, and modify the oas-linux path to oas-linux-arm or oas-linux-arm64 if you are using either of those versions. Make all modifications necessary for the file to resemble the one below:

[Unit]
Description=Open Automation Software Engine

[Service]
ExecStart=/home/oasuser/oas-linux/OASEngine
WorkingDirectory=/home/oasuser/oas-linux
SyslogIdentifier=oas-engine
PrivateTmp=false
KillMode=process

[Install]
WantedBy=default.target

Save and copy the oas-engine.service file to the .config directory using the commands below, again replacing oas-linux in the path as necessary:

sudo mkdir /home/oasuser/.config/systemd/user/
sudo cp /home/oasuser/oas-linux/daemon/oas-engine.service /home/oasuser/.config/systemd/user

Log out and log back in as the OAS Service user (oasuser) to complete the installation.

Enable and start the OAS Service

systemctl --user enable oas-engine
systemctl --user start oas-engine

Uninstall

Included with the OAS installation script is an uninstaller, as well. This file is oas_uninstall.sh and located in the same directory as the installation script. Similarly, you will need to mark this file for execution before running it. Only use this script if the installation script was successful. Use the following commands to mark for execution and then start the uninstaller:

sudo chmod +x oas_uninstall.sh
sudo ./oas_uninstall.sh

The uninstaller script will attempt to back out the installation by performing the following actions.

  • Stop the OASEngine service
  • Remove all installation files
  • Remove user account created for running the service (optional)
    When prompted to remove the OAS user account, you can choose ‘no’ to keep the account intact.

For manually uninstalling the OAS Service:

Log into the account created for running the OAS Service

Stop the OASEngine

systemctl --user stop oas-engine

Disable the systemd service

systemctl --user disable oas-engine

You can optionally remove the entire installation directory from the Service User account home or leave it in place if you plan on using OAS again at some point.


Service Control

Confirm that the service is running

Log into the Linux machine using the credential created during the installation. By default this is oasuser. Then, execute the following command to determine the oas-engine status:

systemctl --user status

This should return something similar to:

State: running
Jobs: 0 queued
Failed: 0 units
Since: Mon 2021-03-01 16:34:33 UTC; 3 weeks 6 days ago
CGroup: /user.slice/user-1001.slice/user@1001.service
├─oas-engine.service
│ └─2214 /home/oasuser/oas-linux-arm64/OASEngine

If you do not see the oas-engine.service listed as running, you can begin troubleshooting by attempting to run the OASEngine manually and checking for errors on startup in the console. To do this, locate the OASEngine executable within the installation directory for the user. This will be in the user’s home directory and named oas-linux, oas-linux-arm, or oas-linux-arm64 depending on the version installed. Within this directory, execute the following:

./OASEngine

This will directly start an instance of the service and output feedback on status. If any errors are reported on startup, make note of them and contact OAS Support for more information.

Managing the Service Installation

The installation script created a service configuration file that can be modified with any additional parameters, such as restart behavior. This is particularly useful if you want to automatically restart the OASEngine in the unlikely event that the process is killed or interrupted. You can locate the service configuration file on following path when logged in as the selected user:

~/.config/systemd/user/oas-engine.service

The contents of the file are the following, with the paths adjusted for the specific user and depending on the specific Linux distribution you are using:

[Unit]
Description=Open Automation Software Engine

[Service]
ExecStart=/home/oasuser/oas-linux-arm64/OASEngine
WorkingDirectory=/home/oasuser/oas-linux-arm64
SyslogIdentifier=oas-engine
PrivateTmp=false
KillMode=process

[Install]

Once you log into the Linux machine as the selected user, you can gracefully stop and start the service using the following commands:

Stop the service:

systemctl --user stop oas-engine

Start the service:

systemctl --user start oas-engine

Troubleshooting

The installation script throws errors or returns a ‘No such file or directory’ message

The file may contain incompatible line endings for Linux – see the instructions above for fixing this using the dos2linux command.

The Linux distribution you are using (e.g. Debian and variants) may be incompatible with the installation script. Follow the Manual Installation instructions.

The service does not start on reboot

Ensure that the service is enabled. Log into the server with the OAS Service account created or referenced during the installation – by default this is oasuser. Then execute the following command:

systemctl --user enable oas-engine

Also, be sure that the OAS Service user can run unattended and does not require a login session for services to run. Logged in as root or sudo user, execute the following command:

sudo loginctl enable-linger oasuser

Any other issues?

Contact support@oasiot.com and we will evaluate your configuration and determine the cause.

FAQs – Options

How can I backup the configured options on my system?
Backup the file OAS.options from C:\ProgramData\OpenAutomationSoftware\ConfigFiles.
All default configuration files would be specified under Configure-Options.
How can I move the configured options from one system to another?
Copy the file OAS.options from C:\ProgramData\OpenAutomationSoftware\ConfigFiles\ to the new system in the same directory C:Program Files and restart the OAS Services on the new computer. All default file paths will be located under Configure-Options and they should be copied to the same directory structure of the new system.
How can I prevent the options from being modified by unauthorized users?

Setup Security and select which Options you want users to be able to modify in the Default group and for each Security Group.

Options

Overview – Options

To open a new window for Options modification, select Configure-Options or Alt-C-O.

Select a Windows Service to modify, the node with the green arrow is the current Service being modified.  Refer to Selecting Service for more information on selecting an OAS Service.

Modify Options

After making the desired changes to the OAS Service select Apply Changes in the lower right corner to make activate the changes.

Options Properties

Load Default Tag Configuration On Service Start

To automatically load a Tag configuration when the OAS Service starts enable this option and browse for the desired Tag configuration. It is recommended to only browse for the default Tag configuration file on the local system as the path is relative to the OAS Service not the system with the Configure OAS application.

Load Default Data Logging Configuration On Service Start

To automatically load a Data Logging configuration when the OAS Service starts enable this option and browse for the desired Data Logging configuration.  It is recommended to only browse for the default Data Logging configuration file on the local system as the path is relative to the OAS Service not the system with the Configure OAS application.

Load Default Alarm Logging Configuration On Service Start

To automatically load an Alarm Logging configuration when the OAS Service starts enable this option and browse for the desired Alarm Logging configuration.  It is recommended to only browse for the default Alarm Logging configuration file on the local system as the path is relative to the OAS Service not the system with the Configure OAS application.

Load Default Report Configuration On Service Start

To automatically load a Report configuration when the OAS Service starts enable this option and browse for the desired Report configuration. It is recommended to only browse for the default Report configuration file on the local system as the path is relative to the OAS Service not the system with the Configure OAS application.

Load Default Recipe Configuration On Service Start

To automatically load a Recipe configuration when the OAS Service starts enable this option and browse for the desired Recipe configuration. It is recommended to only browse for the default Recipe configuration file on the local system as the path is relative to the OAS Service not the system with the Configure OAS application.

Log Errors

Log all failures to a specified text file. The file will have appended to the file name the year, month, day, and hour to easily sort error logs at the time they occurred.  Specify the file path to create the error logs relative to the OAS Service application. The default will be the Log directory in the installation directory of Open Automation Software.

No error file will be created if there are no errors.

Log Transactions

Log all transactions to a specified text file. The file will have appended to the file name the year, month, day, and hour to easily sort error logs at the time they occurred.  Specify the file path to create the transaction logs relative to the OAS Service application. The default will be the Log directory in the installation directory of Open Automation Software.

Transaction logs should only be used for troubleshooting to find the source of a problem along with technical support for an OAS service center. Because the information logged is extensive it is not recommended to leave this enable for long periods as the text files will consume a large amount of disk space.

Auto Runtime On Service Start

To automatically have the OAS Service start in Runtime mode when the service starts enable this option.

OPC Server Watchdog Rate

The number of Seconds the OAS Service will expect data from each OPC Server.  If the OPC Server does not have a data change within this period the OAS Service will disconnect from the OPC Server and reconnect to try and re-establish the connection.  Set this value to 0 to disable the OPC Server Watchdog feature.

Use TimeStamp from OPC Servers

Enable this property to have all trend, alarm, and data logging timestamps to come from the OPC Servers instead of the local CPU clock.  The default of the property is True.

Options Programmatic Interface

Use the OPC Systems component in your Visual Studio application to programmatically modify options. Refer to the FormConfigureOptions Form in the WinForm Example Code example for an example and how to modify options.

Refer to the Programmatic Access Options|topic=Programmatic Access Options section in the Programmatic Interface – .NET Programmatic Configuration topic for all of the method syntax.

OAS Configuration Manager – Menu

Menu 1

  • File-Exit: Exits application.
  • Configure – Tag: Opens a new window for Tag configuration.
  • Configure – Drivers: Opens a new window for Driver Interface configuration.
  • Configure – Data Logging: Opens a new window for modifying data logging.
  • Configure – Alarm Logging: Opens a new window for modifying alarm logging.
  • Configure – Alarm Notification: Opens a new window for modifying alarm notification.
  • Configure – Reports: Opens a new window for modifying report executions.
  • Configure – Recipes: Opens a new window for modifying recipe executions.
  • Configure – Excel: Launches Excel formula wizard.
  • Configure – UDP Broadcast: Opens a new window for modifying one way network transmission.
  • Configure – UDP Receive: Opens a new window for modifying one way network receiving client.
  • Configure – Security: Opens a new window for modifying security configuration.
  • Configure – Users: Opens a new window for modifying security users.
  • Configure – Options: Opens a new window for modifying startup and execution options of a Service.
  • Configure – License: Opens a new window for modifying the license of the local system.
  • Window: Select an existing window already opened.
  • Language: Select desired language for configure application.
  • Help – Open Automation Software: View this help file.
  • Help – Training Videos: View on-line training videos.
  • Help – Training Guide: View Quick Start Example section in this help file.
  • Help – Versions: View current installed versions and check on-line what recent changes have been made to Open Automation Software product features.