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.

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.
- -cp : create project “project_name“
- -cc : create configuration “configuration_file_name” “board_name” “list_of_actuator_name” “list_of_sensor_names” “transciever_type“
- -b : build project
- -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 :¶
- 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"
|
- 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"
|
- 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"
|