Go to Cloud (G2C) 3G Click Board
Go to Cloud (G2C) 3G Click Board
The Go to Cloud (G2C) 3G Click Board™ is a gateway Click board™ which provides a simple and reliable connection to the Click Cloud platform, a cloud-based rapid prototyping environment, hosted by Mikroe. G2C 3G offers an unprecedented simplicity for adding Click Cloud connectivity over UMTS/HSPA to any embedded application, by utilizing the simple UART interface: it can be configured and managed using a minimal set of well-documented AT commands. With the simplicity in mind, the G2C 3G Click Board™ represents an ideal solution for accessing user-friendly and intuitive Click Cloud, a simple yet powerful rapid prototyping cloud solution.
Learn all about the Click Cloud solution by visiting the official web page. All the necessary documentation to get you started, including the G2C 3G click User Manual, the AT Command Manual, and the Click Cloud Guide can be found in the documentation below, in the download section.
Software Support
We provide a library for the G2C 3G Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library carries generic command parser adopted for AT command based modules. The library contains an example for basic initialization of the actuator and sensor demo example.
Key Functions
void g2c3g_send_cmd ( char *p_cmd )
- Simple AT Commandg2c3g_error_t g2c3g_actuator_sw_parser ( char *rsp, char *act_ref, g2c3g_actuator_sw_t *sw_state )
- Actuator switch parserg2c3g_error_t g2c3g_actuator_cnt_parser ( char *rsp, char *act_ref, g2c3g_actuator_cnt_t *num_data )
- Actuator counter parserg2c3g_error_t g2c3g_actuator_str_parser ( char *rsp, char *act_ref, g2c3g_actuator_str_t *str_data )
- Actuator string parservoid g2c3g_send_broker_cfg ( char *brc_key, char *brc_password )
- Parameter broker (device) settingvoid g2c3g_send_data_ref ( char *reference_buf, char *data_buf )
- Parameter data setting
Example Description
The application is composed of the three sections :
- System Initialization - Initializes all necessary GPIO pins, UART used for communication with G2C 3G module and UART used for logging.
- Application Initialization - Initializes driver and timer at 10ms. Initializes default handler (with 1500ms watchdog) with core init function. Module wake-up procedure is started and then the module is reset. This procedure must be performed at start of the program in order for the module to be ready for operation. Following commands are required in order to connect the module to click cloud.
- Application Task - Starts the process of reading responses and sending the data to the click cloud.
void application_init ( ) { // TIMER INIT g2c3g_timer_int_cfg( ); // DRIVER INIT g2c3g_uart_driver_init( ( g2c3g_obj_t )&_MIKROBUS1_GPIO, ( g2c3g_obj_t )&_MIKROBUS1_UART ); g2c3g_core_init( g2c3g_default_handler, 1500 ); // MODULE POWER ON g2c3g_module_power( G2C3G_MODULE_POWER_ON ); g2c3g_reset_module( ); Delay_ms( 2000 ); while( g2c3g_device_status( ) != G2C3G_STATUS_DEVICE_READY ); Delay_ms( 2000 ); mikrobus_logWrite( "****************************** START ** ", _LOG_LINE ); g2c3g_send_cmd( &G2C3G_AT[ 0 ] ); g2c3g_command_delay( ); g2c3g_send_cmd( &G2C3G_AT_GMR[ 0 ] ); g2c3g_command_delay( ); g2c3g_send_cmd( &G2C3G_AT_CEN[ 0 ] ); g2c3g_command_delay( ); g2c3g_send_operator_cfg( &operator_apn[ 0 ], &operator_username[ 0 ], &operator_password[ 0 ] ); g2c3g_command_delay( ); g2c3g_send_cmd( &G2C3G_AT_NWC[ 0 ] ); g2c3g_command_delay( ); while( g2c3g_network_status( ) != 1 ); Delay_ms( 2000 ); g2c3g_send_broker_cfg( &device_key[ 0 ], &device_password[ 0 ] ); g2c3g_command_delay( ); g2c3g_send_cmd( &G2C3G_AT_BRC[ 0 ] ); g2c3g_command_delay( ); while( g2c3g_broker_status( ) != 1 ); Delay_ms( 2000 ); task_time = 0; mikrobus_logWrite( "********* CONNECT TO CLICK CLOUD ** ", _LOG_LINE ); }
void application_task ( ) { g2c3g_process( ); if ( task_time > 2000 ) { g2c3g_send_data_ref( &sensor_ref[ 0 ], &data_buf[ 0 ] ); g2c3g_send_cmd( &G2C3G_AT_PUB[ 0 ] ); task_time = 0; } }
Additional functions
g2c3g_command_delay ( )
- Delay between 2 commands (recomended delay time)actuator_demo( )
- Actuator parser demo exampleg2c3g_default_handler( )
- Default handler for logging and collecting responses
Note:
Items required before starting the program:
- Set operator parameters( APN, username and password ) for the SIM card.
- Create a device on the click cloud and sets the device parameters (device_key and device_password).
- Enter sensor and / or actuator reference from manifest associated with the created device.
Example contains 2 types of response collection:
In config.h file one of these 2 response collection types can be select.
- G2C3G_POLL_ENABLE = 1 (UART polling method) or
- G2C3G_POLL_ENABLE = 0 (UART interrupt method).
Device manifest for test is "G2C 3G click - Test".
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
UART
C_String
Conversion
Additional Notes and Information
Depending on the development board you are using, you may need a 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.
MIKROSDK
The G2C 3G Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Go to Cloud (G2C) 3G Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.