This page allows you to build, flash, run, and control your very first Luos code.
This Getting started is separated in 2 parts:
- The embedded part: By following this part you will have all the tools you need to easily develop using Luos in your embedded target.
- The remote control part: By following this part you will have all the tools you need to take control and easily test any Luos device.
This tutorial shows you how to quickly upload a Luos application on an MCU development kit.
Supported boards are listed below:
- Arduino zero, MKRzero, MKR1000, or any SAMD21-based Arduino board
- STM32L432KC Nucleo
Note: This list will grow longer with time.
We will use PlatformIO ↗ as development environment.
First, install the free coding editor Microsoft Visual Studio Code ↗ (VSCode). PlatformIO's IDE is built on top of it.
Then, in PlatformIO:
- Open VSCode Extension Manager.
- Search for the official PlatformIO IDE extension.
- Install PlatformIO IDE.
Clone the getting started repository on your computer:
git clone https://github.com/Luos-io/Get_started.git
If you are not familiar with Git, you can consult their documentation ↗.
Open VSCode and click on Open Folder in the project explorer on the left, then select a project depending on the board you have chosen. For example, for the STM32L432KC Nucleo, open L432KC_Nucleo in the folder explorer then click on ADD:
The project folder is opened in the explorer.
Note: Arduino users can select their board on the
platformio.inifile by modifying the
board = zeroline.
You can now flash your board: make sure it's connected to your PC with a USB cable and click on Upload on the bottom left of the VSCode window:
PlatformIO will build the firmware and flash it. Take a look at the terminal to watch each step platformIO follows and a Success message at the end. If you have any trouble with your USB driver, you can consult this FAQ page. Once the board is programmed, you should see the LED blinking on your board.
Congratulations, your first Luos app is running!
There are two services loaded in your board allowing to blink the LED.
- Blinker sends a message at a fixed duration ╰ located at the root of the getting_started repository (because the same app can run on any board)
- Led receives this message and makes the LED blink ╰ located on the lib folder of your project (because it is a driver which is specific to your board)
On top of it, we also added two other services allowing you to take control of your board:
- Pipe, managing a serial interface ╰ located on the lib folder of your project (because it is a driver which is specific to your board)
- Gate, an app that translates Luos to JSON and sends it through Pipe ╰ located in the cloud, (because it is a common cross-platform's Luos app) PlatformIO just downloaded it for you.
The gate running on your board allows you to take control of any service loaded on your device.
We will use Python with the default library of Luos called pyluos. To install it, run:
pip install pyluos
Pyluos provides a set of tools. To control you device, run:
This command will find the serial port of your device and mount it into a "device" object.
$ pyluos-shell Searching for a gate available Testing /dev/cu.usbserial-D308N885 Testing /dev/cu.usbmodem13102 Connected to "/dev/cu.usbmodem13102". Sending detection signal. Waiting for routing table... Device setup. Hit Ctrl-D to exit this interpreter. Your luos device have been successfully mounted into a "device" object: ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ╭node 1 /!\ Not certified ┃ ┃ │ Type Alias ID ┃ ┃ ├> State led 2 ┃ ┃ ├> Pipe Pipe 3 ┃ ┃ ├> Gate gate 1 ┃ ┃ ╰> Unknown blinker 4 ┃ ╔>┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Now that you are on an IPython command line, you can run Python scripts in it.
device object is your real device and you can interact with it. For example, try to execute these lines one by one:
Your development environment is now installed and you have a Luos app running on your MCU. Check the tutorials to learn how to use each feature of Luos technology. You can also read the Luos documentation to learn more about the core technology.