RobustOS Pro SDK - Quick Start Guide

RobustOS Pro SDK - Quick Start Guide

Prerequisites

Before you begin, ensure you have:

  • Hardware: One of the supported RobustOS Pro devices (EG5100, LG5100, R1520LG, EV8100, EG5101, EG5200, EG5120, or EG3110)

  • Network Access: SSH access to your device

  • User Account: A sudo user account on the device (create one via Web GUI if needed)

  • Basic Knowledge: Familiarity with Linux command line and C programming

Supported Hardware Quick Reference

DeviceCPUArchitectureRAM Available
EG5100/LG5100/R1520LG/EV8100/EG5101i.MX 6ULLarmv7 (armhf)256MB
EG5200i.MX 8M Plusarmv8 (arm64)2.5GB
EG5120i.MX 8M Plusarmv8 (arm64)1.5GB
EG3110RK3562armv8 (arm64)256MB-7.5GB

Step 1: Environment Setup

1.1 Connect to Your Device

# Replace <device-ip> with your device's IP address
ssh username@<device-ip>

Example:

ssh sudouser@192.168.0.1

1.2 Install Development Tools

# Update package list
sudo apt update

# Install required packages
sudo apt install -y librosp-dev build-essential devscripts

# Optional: Install additional dependencies
sudo apt install -y libevent-dev libpam0g-dev libcurl4-openssl-dev libssl-dev libxml2-dev

Expected Output:

Reading package lists... Done
Building dependency tree... Done
librosp-dev is already the newest version
build-essential is already the newest version
...

1.3 Verify Installation

# Check compiler
gcc --version

# Check if librouter is available
dpkg -l | grep librosp

Step 2: Install SDK

2.1 Download SDK (if not already on device)

If the SDK is not already present, transfer it to your device:

# Option A: Using SCP from your computer
scp RobustOS_Pro_SDK-2.4.0.tgz username@<device-ip>:~

# Option B: Using USB
# Insert USB drive and mount, then copy the file

2.2 Extract SDK

# Extract to home directory
cd ~
tar -xzf RobustOS_Pro_SDK-2.4.0.tgz

# Navigate to SDK directory
cd RobustOS_Pro_SDK-2.4.0

2.3 Explore SDK Structure

# List SDK contents
ls -la

# You should see:
# create_app.sh   - Application scaffolding tool
# Makefile        - Build system
# docs/           - Documentation
# sample-*        - Example applications
# readme.md       - README file

Step 3: Create Your First Application

3.1 Use the Application Scaffolding Tool

The SDK provides a powerful tool to generate complete application templates. Let’s create a simple “Hello World” application:

# Create a simple application
./create_app.sh helloworld --type=simple --web-ui1

💡 Application Naming Tips:

  • Application names can only contain lowercase letters, numbers, and hyphens (-)

  • If you use hyphens (e.g., my-app), they will be automatically converted to underscores (my_app) for:

    • Binary names, SDK scripts, PID files, log tags, UCI/USI configuration nodes
  • For this tutorial, we use helloworld (no separators) to keep things simple

What happens:

  • Generates complete source code with logging and signal handling

  • Creates Debian packaging files

  • Sets up Web UI configuration files (UCI/USI)

  • Includes service management script

  • Generates README documentation

Output:

RobustOS Pro SDK Application Scaffolding Tool
===============================================

[INFO] Creating application: helloworld
[INFO] Application type: simple
[INFO] Web integration: Enabled
[INFO] Version: 1.0.0
[INFO] Author: Developer <developer@example.com>

[SUCCESS] Application project created successfully!

3.2 Explore Generated Application

# View the generated structure
cd helloworld
tree
# or
find . -type f

# Key files:
# src/main.c      - Main application code
# files/sdk.sh    - Service management script
# files/uci.xml   - Web configuration interface
# files/usi.xml   - Web status interface
# Makefile        - Build configuration
# debian/         - Debian packaging files
# README.md       - Generated documentation

3.3 Examine the Generated Code

# View the main application code
cat src/main.c | head -50

Key components you’ll see:

  • Signal handling (SIGTERM, SIGINT)

  • Logging integration

  • UCI configuration reading

  • USI status updates

  • Main loop with proper cleanup

3.4 Customize Your Application (Optional)

Edit src/main.c to add your custom logic:

# Use your preferred editor
vi src/main.c
# or
nano src/main.c

Example customization - Modify the process_main_loop() function:

void process_main_loop(void) {
    static int counter = 0;
    counter++;

    if (counter % 600 == 0) { // Log once per minute
        log_info("Hello from RobustOS Pro! Counter: %d", counter);

        // Update Web UI status
        usi_printf("helloworld.counter", "%d", counter);
        usi_update("helloworld.last_update", get_current_time());

        // Your custom code here
        // Example: Read sensor, process data, send to cloud, etc.
    }
}

Step 4: Build and Package

4.1 Return to SDK Root

# Go back to SDK root directory
cd ~/RobustOS_Pro_SDK-2.4.0

4.2 Build Your Application

The SDK uses automatic application discovery - no Makefile editing needed!

# List all available applications (including your new one)
make list-apps

Output:

Available applications:
  - helloworld
  - sample-can
  - sample-cpp
  - sample-crypto
  - sample-dido
  - sample-event
  - sample-gps
  - sample-network
  - sample-serial
  - sample-shell
  - sample-uci
  - sample-upload
# Build your application
make helloworld

What happens:

  1. Compiles source code

  2. Links against librouter and system libraries

  3. Creates Debian package with all dependencies

  4. Includes UCI/USI configuration files

Expected output:

make -C helloworld clean
...
Compiling src/main.c
Linking helloworld
Creating Debian package...
dpkg-deb: building package 'helloworld' in '../helloworld_1.0.0_armhf.deb'.

4.3 Generate Installation Package

# Collect all generated packages
make deb-install

Result:

# Check the generated package
ls -lh install_dir/

# You should see:
# helloworld_1.0.0_armhf.deb (or arm64, depending on your platform)

4.4 Verify Package Build

ls -lh install_dir/
dpkg-deb -I install_dir/helloworld_1.0.0_arm64.deb

Step 5: Deploy and Test

5.1 Install Your Application

# Install the Debian package
sudo dpkg -i install_dir/helloworld_1.0.0_armhf.deb

# Verify installation
dpkg -l | grep helloworld

Expected output:

ii  helloworld  1.0.0  armhf  Simple RobustOS Pro application

5.2 Restart Router Service

This registers your application with the Web Manager:

sudo systemctl restart router

Note: This may take 10-30 seconds. Your SSH session will remain active.

5.3 Start Your Application

# Start the application
sudo /etc/sdk/helloworld start

# Check if it's running
sudo /etc/sdk/helloworld status

Expected output:

helloworld[status] is running

5.4 View Application Logs

# View real-time logs
sudo journalctl -f -t helloworld

Expected output:

Sep 30 10:30:15 router helloworld[12345]: helloworld v1.0.0 starting...
Sep 30 10:30:15 router helloworld[12345]: helloworld started successfully
Sep 30 10:31:15 router helloworld[12345]: Hello from RobustOS Pro! Counter: 600

Press Ctrl+C to exit log view

5.5 Test Via Web Interface (Optional)

If you enabled --web-ui :

  1. Open your device's Web Management Interface in a browser (e.g., http://192.168.0.1 )

  2. Login with your credentials

  3. Navigate to Services → helloworld

  4. You’ll see:

  • Basic Settings Tab: Options to enable/disable, set log level, update interval, and debug mode

  • Status Tab: Real-time application status, uptime, last update time, running counter, and error count

For detailed Web UI usage, see Step 6.6.

5.6 Verify Application is Working

# Check process is running
ps aux | grep helloworld

# Check PID file
cat /var/run/helloworld.pid

# View last 20 log lines
sudo journalctl -t helloworld -n 20

Step 6: Alternative Installation via Web UI

Instead of installing via SSH command line (Step 5.1), you can install the deb package through the device's Web Management Interface.

6.1 Access Web Management Interface

  1. Open your web browser

  2. Navigate to your device's IP address:

http://<device-ip>

Examplehttp://192.168.0.1

  1. If you see a security warning (SSL certificate), click Advanced and then Proceed to [device-ip] (unsafe)

6.2 Login to Web Interface

Enter your credentials:

  • Username: admin or your sudo user account

  • Password: admin or your sudo user password

Click LOGIN

6.3 Navigate to App Center

  1. Click on the System menu in the left sidebar

  2. Select App Center from the submenu

6.4 Upload and Install the deb Package

  1. In the App Install section, you'll see:
  • A file upload field

  • Choose File button

  • An Install button

  1. Click Choose File and select your deb package:
install_dir/helloworld_1.0.0_arm64.deb

(or helloworld_1.0.0_armhf.deb depending on your device architecture)

  1. Click Install

  2. Wait for the upload to complete (you'll see a progress bar showing 100%)

  3. A dialog will appear: "Operation successfully completed. Do you want to restart immediately?"

  • Click OK to restart the router service immediately (recommended)

  • Or click Cancel to restart manually later

6.5 Verify Installation via Web UI

  1. After the restart (or page refresh), you'll see your application in the Installed Apps list

  1. The Status column should show Running, indicating your application started successfully

6.6 Access Application Configuration and Status

After successful installation with --web-ui option, your application will have its own management page in the Web interface.

Important: You must click OK to restart the router service (or manually restart) for the application's Web UI to become available in the Services menu.

  1. Navigate to Services → helloworld in the left sidebar

  2. You'll see two tabs:

Basic Settings Tab

Configure your application settings:

  • Enable helloworld: ON/OFF toggle to enable or disable the application

  • Log Level: Select logging verbosity (Debug, Info, Warning, Error)

  • Update Interval (seconds): Configure how often the application updates (default: 60 seconds)

  • Debug Mode: Enable or disable debug mode

Click Submit to save changes, or Cancel to discard.

Status Tab

View real-time application status information:

Application Status:

  • Application Status: Current running state

  • Uptime (minutes): How long the application has been running

  • Last Update Time: Timestamp of the last status update

Application Statistics:

  • Running Counter: Number of successful execution cycles

  • Error Count: Number of errors encountered

The status page updates automatically based on the USI (User Status Interface) updates in your application code.

6.7 Manage Your Application via Web UI

From the App Center (System → App Center), you can:

  • View application status: Check if it's running or stopped

  • Uninstall: Click the delete icon to remove the application

  • Monitor: View the application in the installed apps list

Note: For detailed application logs and advanced management, you can still use SSH commands as described in Step 5.


    • Related Articles

    • RobustOS Pro SDK

      Robustel's router allows 3rd party to develop their applications. We provide a Software Development Kit (SDK), which offers a simple and fast way to implement customer-specific functions and applications. This SDK is compatible with EG5100, LG5100, ...
    • RobustOS Pro Hardware Interface Quick Usage Guide

      1 Quick Start This chapter provides the most essential hardware information and test commands to help you start using hardware interfaces within 5 minutes. 1.1 Hardware Interface Overview Model Serial Port 1 Serial Port 2 DI DO DO (Relay) CAN ...
    • RobustOS Pro Application Development Getting Started

      Preface Welcome to RobustOS Pro! This guide provides a step-by-step roadmap for understanding, developing, and deploying applications on the platform. This document is only applicable to RobustOS Pro 2.4.x firmware versions. System Architecture ...
    • RobustOS SDK

      Robustel's router allows 3rd party to develop their applications. We provide a Software Development Kit (SDK), which offers a simple and fast way to implement customer-specific functions and applications. This SDK is compatible with the models listed ...
    • RobustOS Pro Third-Party Application Development Guide

      1. Quick Overview What is RobustOS Pro? RobustOS Pro is an embedded Linux distribution based on Debian 11 (bullseye), designed specifically to meet the demanding requirements of industrial IoT gateways, providing a high degree of customization and ...