This tutorials is deprecated. Please have a look to this page .
This tutorial aims to provide setup information to users who want to rapidly get started developing Legato applications using Command-line mode.
Tutorial on developing Legato application using Developer Studio IDE will be made available in the near future.
The following steps are described, they are necessary to develop Legato applications:
Although a mangOH board embedding a WP8548 module is used in this tutorial, guidelines provided in this page are also applicable to other Legato-based modules.
Linux PC running Ubuntu/Debian OS
Have an account on AirVantage server. If you don’t, sign up here
Part references used in this tutorial
Ubuntu 14.04.3 TLS
Micro-USB cable
Any issues ?
If you encounter any issue to set up your device, don’t hesitate to use the developer forum to benefit from the developer community experience.
Your Host PC can interface with the Legato device to gain the following functionalities :
To access device Linux console, the host can use ONE of the following interfaces:
To install Legato applications onto Legato device, you can only use ONE of the following interfaces:
There are 3 methods to access device Linux console. The most straighforward is to use device Serial port.
Access to Legato Linux console over the Serial port
Legato device’s serial port is configured to be used for console input/output. To login, proceed the following:
Access to Legato Linux console over Ethernet
This option enables you to access the Linux console remotely using SSH. To login, proceed as follow:
Establish a SSH session from your host using the following command:
ssh root@<mangOH-ip-addr>
Please note that, the IP address of the device must be known prior using this ethernet option
You can now enter Commands described in the below section Legato Device Setup and Configuration
Access to mangOH Linux console over USB
USB ECM mode is enabled by default on the target device:
Establish a SSH session from your host using the following command
ssh root@192.168.2.2
You can now enter Commands described in the below section Legato Device Setup and Configuration
If USB ECM mode is disabled on the target device:
Once you have connected the host to the device using one of the above interface (Serial, Ethernet or USB), as described in previous sections, you can now access device Linux console.
Although any Linux commands can be used in the device Linux console, you may enter the following commands to discover or to change configuration.
System Versions
Radio
Data Connectivity
Applications
SIM
IP Address
USB mode
In Step 1, we’ve covered how to:
- Connect your host to the Legato device using different options (Serial port, Ethernet or USB) in order to access device Linux Console
- Issue Commands in device Linux Concole in order to Retrieve information (e.g. IP address, software version) and Set basic configurations (e.g. SIM PIN, APN)
This tutorial only covers development using Command-Line. Tutorial on using Developer Studio IDE will be available in the near future.
Before you can start developing Legato applications, the following conditions must be met:
The main setup flow to satisfy the aforementioned conditions can be summarized as follow:
Install legato-spm on Ubuntu/Debian distribution
Check your Ubuntu version
lsb_release -d
If you are running an Ubuntu version older than 14.10 then install Java 8 as follow, otherwise proceed to Install legato-spm
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jre-headless
sudo update-alternatives --config java
Install legato-spm
wget http://updatesite.sierrawireless.com/legato-spm/debian/legato-spm.list -O - | sudo tee /etc/apt/sources.list.d/legato-spm.list
wget http://updatesite.sierrawireless.com/legato-spm/debian/legato-spm.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install legato-spm
Install legato-spm on alternate distributions
Download legato-spm tool archive from this link
Extract the archive to the location of your choice (e.g. unzip legato-spm*.zip -d $HOME/legato/spm)
Potentially add this location to your user’s path (e.g. echo ‘export PATH=$HOME/legato/spm:$PATH’ >> $HOME/.bashrc)
Download and install the latest Legato CLI tools and embedded software packages
legato-spm --install --module WP85XX --update-link
Following packages are now installed in your ~/legato/packages directory:
legato.framework.* - Prebuilt Legato framework packages
legato.toolchain.* - GCC cross compiler Toolchains
legato.devimg.* - Images to upgrade Legato devices system software
legato.recovery.* - Tool to recover a bricked Legato device
legato.source.* - Legato source distribution package
Use this script to configure Legato, this script shall be launched once in each new terminal window you’d use for Legato development
source ~/legato/packages/legato.sdk.latest/resources/configlegatoenv
Once the Legato CLI tools have been installed in your Ubuntu/Debian host, you are now ready to develop Legato applications.
Important
In this Step, your Host needs to be connected to your Legato device over IP (using USB or Ethernet). This IP connection is required to install Legato Applications onto the target.
Connection over the Serial link cannot be used to install application
Let’s have a separated Terminal console dedicated to compiling and installing applications. Let’s name it Terminal #1 for referencing convenience.
Launch the following script to setup environment variables for Legato Development
source ~/legato/packages/legato.sdk.latest/resources/configlegatoenv
You are now ready to compile sample applications in the apps/sample directory ($LEGATO_ROOT/apps/sample)
Get into the helloWorld directory and compile it for WP8548 (mangOH) target
cd $LEGATO_ROOT/apps/sample/helloWorld
make wp85
helloWorld.wp85 should be generated as the result of the compilation
Install it onto mangOH target device
instapp helloWorld.wp85.update <mangOH-IPaddress>
In the Ubuntu Host, let’s have a separated Terminal console dedicated to mangOH log. Let’s name it Terminal #2 for referencing convenience.
In the Ubuntu Host, let’s have a separated Terminal console dedicated to device Linux Console. Let’s name it Terminal #3 for referencing convenience.
In Step 2, we’ve covered how to:
- Setup your Ubuntu/Debian host for Legato Development usage
- Compile applications, install application onto the Target device
- Remotely access to Target Device Linux console
- View Target device log
Before your Legato applications can exchange data with AirVantage, your Legato-based device must be registered on AirVantage. This step guide you through this registration procedure.
Acces mangOH Linux console, using one of the methods described in the first step: