Go back to Developer Overview Home

SSH Access

The first thing you need to do in order to have SSH access is install a free Shell license, which you can request from our preferred customer specialists at pcs@opto22.com directly, then visit manage.groov.com to apply it to the EPIC of your choice.

To install this license onto your EPIC, go to your groov manage menu, select System and then License, where you can upload the license into your device. For more details and screenshots of this process, check out the the Opto Training instructions.

As soon as you apply a shell license you agree to a few conditions, so you should take the time to read the license agreement that comes up when you apply the license. This first portion provides a good idea of how the license affects you:

      Shell access provides privileged access to the embedded operating system (OS) so customers can develop and execute custom software on the product. Any custom software or changes added to the product via shell access has the potential to interfere with the original functionality of the product. Opto 22 limits support for products that have been configured with shell access to Factory Restore to Default only.
The customer accepts full responsibility for troubleshooting and resolving all issues they encounter on a product they’ve modified via shell access.

Top

Repositories

A repository or “repo” is a software storage location that software package managers can access to download and install various packages to a computer. In the case of Debian-based systems like the one running on groov EPIC the software package manager is apt.

Your local build can have its software sources updated with sudo apt-get update which will update the apt-get tool, then you can search for available packages with sudo apt-cache search <keyword>, for example sudo apt-cache search python to see all Python packages available in the current EPIC repository.

Repositories are specific to the distro the computer is running; so Ubuntu has its own software repositories, and so does the Debian build running on EPIC. We manage the EPIC repos here at Opto so that it is not possible to install software that is either incompatible with the EPIC or has the potential to break it. Before making any major changes to your system it is highly recommended that you back up through groov Manage and save all your files.

Top

Sample Scripts

There is a package of examples on GitHub that include Python scripts to demonstrate the REST APIs and OptoMMP, as well as a compiled C++ program that also uses OptoMMP with the C++ SDK. These will help you get started and see the power of the shell without having to write any programs yourself!

Use instructions are included in the folder.

Top

File Area

The control engine, Node-RED, and REST API can read and write files. They are organized into two groups, according to the security required to access them, files may be stored in either the secured or unsecured file area.

To access these files navigate to groov manage at https://groov-epic/manage then select System, and Files.

To access these files over SSH browse the directories in the Node-RED dev user by using the change directory command cd to navigate there: cd /home/dev/secured/ and cd /home/dev/unsecured.

Top

Running “Hello World!” with Many Built-In Languages

The following examples are a bit more advanced than most first-time Hello World programs by demonstrating arrays, looping, and the use of functions, so that you can see some of the differences between the languages and what they’re capable of.

Feel free to test these on your own system by creating the necessary files and edit them using nano or vim, paste the code in, and run them using the instructions provided. Note the differences in file extensions for each language.


Python

For more extensive details on Python, check out Getting Started with Python for groov EPIC.

  1. Run script: python HelloWorld.py
# HelloWorld.py
greeting = ["Hello", "world", "from", "groov", "EPIC!"]
print(' '.join(greeting))

Top


Java

  1. Compile: javac HelloWorld.java
  2. Execute: java HelloWorld
// HelloWorld.java
public class HelloWorld {
        public static void main(String[] args) {
            String array[] = {"Hello", "world", "from", "groov", "EPIC!"};
            for (String x:array) {
                System.out.println(x);
            }
        }
}

Top


JavaScript

  1. Compile and run: node HelloWorld.js
// HelloWorld.js
console.log('Hello World!');
myString = '';
for (i = 0; i <= 22; i+=2) {
    myString += i + ', ';
}
myString = myString.substring(0, myString.lastIndexOf(',')) + '.';
console.log(myString);

Top