G2C 3G Click Example.
Description
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 :
Application Init
Initializes the driver, restarts the device, and after that tests the communication by sending "AT" command.
Application Task
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).
Additional Function
- static void g2c3g_clear_app_buf ( void )
- static err_t g2c3g_process ( void )
- static void g2c3g_error_check( err_t error_flag )
- static void g2c3g_log_app_buf ( void )
- static err_t g2c3g_rsp_check ( uint8_t *rsp )
- static err_t g2c3g_connect_to_network( void )
- static err_t g2c3g_connect_to_cloud( void )
- static err_t g2c3g_example( void )
- Note
- 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: https://download.mikroe.com/documents/click-cloud/guide-to-click-cloud.pdf
- Author
- Stefan Filipovic