LTE IoT 6 click
LTE IoT 6 Click is a compact add-on board that contains an IoT module with worldwide coverage. This board features the SARA-R412M, a cellular module that offers multi-band data transmissions for Low Power Wide Area solutions in a compact form factor from u-Blox.
click Product page
Click library
- Author : Luka Filipovic
- Date : Nov 2020.
- Type : UART GPS/GNSS type
Software Support
We provide a library for the LTEIoT6 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
Library Description
This library contains API for LTEIoT6 Click driver.
Standard key functions :
- Config Object Initialization function.
void lteiot6_cfg_setup ( lteiot6_cfg_t *cfg );
- Initialization function.
LTEIOT6_RETVAL lteiot6_init ( lteiot6_t *ctx, lteiot6_cfg_t *cfg );
- Click Default Configuration function.
void lteiot6_default_cfg ( lteiot6_t *ctx );
Example key functions :
- LTE IoT 6 power on.
void lteiot6_power_on ( lteiot6_t *ctx );
- Send command function.
void lteiot6_send_cmd ( lteiot6_t *ctx, char *cmd );
- LTE IoT 6 send text message.
void lteiot6_send_text_message ( lteiot6_t *ctx, char *phone_number, char *message_context );
Examples Description
This example reads and processes data from LTE IoT 6 clicks.
The demo application is composed of two sections :
Application Init
Initializes driver and wake-up module.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_cfg.level = LOG_LEVEL_DEBUG;
log_cfg.baud = 115200;
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
Delay_ms( 1000 );
if ( init_flag == UART_ERROR )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_info( &logger, " Power up device... " );
lteiot6_process( );
lteiot6_clear_app_buf( );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 1000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 1000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 1000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 1000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 1000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 1000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 1000 );
app_buf_len = 0;
app_buf_cnt = 0;
log_info( &logger, " Application Task " );
Delay_ms( 2000 );
}
Application Task
Reads the received data and parses it.
{
{
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 2000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 2000 );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 2000 );
}
else
{
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 3000 );
for( ; ; )
{
log_printf( &logger, "> Sending message to phone number...\r\n" );
app_error_flag = lteiot6_rsp_check();
lteiot6_error_check( app_error_flag );
Delay_ms( 10000 );
}
}
}
Note
#Note: In order for the example to work, user needs to set the phone number and sim apn to which he wants to send an SMS Enter valid data for the following macros: SIM_APN and PHONE_NUMBER_TO_MESSAGE. E.g.
SIM_APN "vip.mobile" PHONE_NUMBER_TO_MESSAGE "999999999"
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.LTEIoT6
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.