PrIoT-CLI 0.0.1 documentation

PrIoT Example

«  PrIoT List of Supported Sensors   ::   Contents   ::   PrIoT Prerequisites for Using PrIoT-CLI (priot_cli.py)  »

PrIoT Example

Note

Install all the prerequisites before using PrIoT-CLI, see Prerequisites.

This page consist of example IoT scenarios to demostrate the development steps needed in PrIoT.

Hello-World

In this section, with the help simple hello-world example we will describe the different steps required to develop IoT application with PrIoT. Hello-world in embedded system is a simple embedded code to periodically blink led which is connected on one of the GPIO pin of MCU board.

alternate text

Application Logic :

hello_world.app - Application file contains the device independent application logic. The application logic is coded in PrIoT-Lang using device independent PrIoT-API.

1
2
3
4
5
6
7
8
9
import hello_world.cfig

FOREVER
{
  a_led.actuate("ON")
  delay(500)
  a_led.actuate("OFF")
  delay(500)
}

Application Configuration :

This configuration file contains the high level or abstract description of hardware and does not define specific hardware manufacturer.

hello_world.cfig

1
2
3
4
5
# Select Actuator
Select Actuator.LED as a_led

# Embedded System
Select Hardware.MCU.Family as AVR-8bit

Hardware Configuration :

This configuration file defines the description of hardware manufacturer and is generated from the hardware selected from the PrIoT hardware database.

hello_world_hw.cfig

1
2
3
4
5
6
# Define Actuator
Define Actuator.LED as Grove-Led

# Define MCU
Define Hardware.MCU.Family AVR
Define Hardware.MCU.Type ATmega328p

Priot Command Line :

Below are the minimal PrIoT command line options to successfully deploy IoT application.

  1. -cp : create project “project_name
  2. -cc : create configuration “configuration_file_name” “board_name” “list_of_actuator_name” “list_of_sensor_names” “transciever_type
  3. -b : build project
  4. -u : upload project
1
2
3
4
priot_cli.py -cp "hello_world"
priot_cli.py -cc "hello_world" "hello_world.cfig" "uno" "" "led s_gss001" ""
priot_cli.py -b  "hello_world"
priot_cli.py -u  "hello_world"

PrIoT Command Line Example - hello_world :

  1. Arduino Uno :

Board Information

  • Board Name - UNO
  • MCU Family - AVR
  • MCU Name - ATmega328p
1
2
3
4
priot_cli.py -cp "hello_world"
priot_cli.py -cc "hello_world" "hello_world.cfig" "uno" "" "led s_gss001" ""
priot_cli.py -b  "hello_world"
priot_cli.py -u  "hello_world"
    1. STM :

Board Information

  • Board Name - NUCLEO-L073RZ
  • MCU Family - ARM cortex-m0+
  • MCU Name - stm32l073rz
1
2
3
4
priot_cli.py -cp "hello_world"
priot_cli.py -cc "hello_world" "hello_world.cfig" "nucleo_l073rz" "" "led s_gss001" ""
priot_cli.py -b  "hello_world"
priot_cli.py -u  "hello_world"
    1. Texas Instruments :

Board Information

  • Board Name - LPMSP430F5529
  • MCU Family - MSP430
  • MCU Name - MSP430F5529
1
2
3
4
priot_cli.py -cp "hello_world"
priot_cli.py -cc "hello_world" "hello_world.cfig" "lpmsp430f5529" "" "led s_gss001" ""
priot_cli.py -b  "hello_world"
priot_cli.py -u  "hello_world"

«  PrIoT List of Supported Sensors   ::   Contents   ::   PrIoT Prerequisites for Using PrIoT-CLI (priot_cli.py)  »