g2c3g 2.1.0.0
|
Go to Cloud (G2C) 3G click 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.
We provide a library for the G2C 3G 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for G2C 3G Click driver.
g2c3g_cfg_setup
Config Object Initialization function. g2c3g_init
Initialization function. g2c3g_reset_device
This function resets the device by toggling the RST pin. g2c3g_set_net_creds
This function sets the APN, username, and password for entered sim card. g2c3g_set_broker_creds
This function sets the broker credentials (device key and password). This example shows the device capability of connecting to the cloud and updating the sensor data on the cloud and receiving data from actuators.
The demo application is composed of two sections :
Initializes the driver, restarts the device, and after that tests the communication by sending "AT" command.
Application task is split in few stages:
- G2C3G_CONNECT_TO_NETWORK: Sends commands to configure device to connect to the specified network.
- G2C3G_CONNECT_TO_CLOUD: Sends commands to configure device to connect to the specified device on the cloud.
- G2C3G_EXAMPLE: This function executes example which updates sensor data on the cloud and displays all data received from the module (ex. the actuator switch state change received from the cloud).
In order for the example to work, user needs to set the SIM card and the cloud device parameters.
Enter valid values for the following macros: SIM_APN, SIM_USERNAME, SIM_PASSWORD, DEVICE_KEY, DEVICE_PASSWORD, DEVICE_SENSOR_REF.
Example:
- SIM_APN "internet"
- SIM_USERNAME "internet"
- SIM_PASSWORD "internet"
- DEVICE_KEY "xxxxxxxxxxxxxxxx"
- DEVICE_PASSWORD "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
- DEVICE_SENSOR_REF "TEMP_SEN_R"
DEVICE_KEY and DEVICE_PASSWORD strings should match the device credentials which were generated during the Click Cloud device creation step.
DEVICE_SENSOR_REF is expected to be a reference to a temperature sensor with a data range from -20 to +80 degrees Celsius. For more information about the registration on the Click Cloud and creating the device refer to the following user guide.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
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. UART terminal is available in all MikroElektronika compilers.