This demo application connects to Google Cloud IoT through MQTT and publishes messages.
It requires a registered device in the Google Cloud IoT.
The following describes the various components and the configuration settings.
Once the application is configured you can:
- Build the application
- Connect the debugger
- Run the application and view messages in a debug printf or terminal window
The file demo.c
configures the connection to Google IoT with these settings:
- PROJECT_ID: Project ID
- CLOUD_REGION: Cloud region
- REGISTRY_ID: Registry ID
- DEVICE_ID: Device ID
Note: These settings need to be configured by the user!
The file pkey.h
configures the device private key.
Note: The device private key needs to be provided by the user!
The FreeRTOS RTOS implements the resource management. It is configured with the following settings:
- Global Dynamic Memory size: 24000 bytes
- Default Thread Stack size: 3072 bytes
This implementation uses an IoT socket layer that connects to a CMSIS-Driver WiFi.
The file socket_startup.c
configures the WiFi connection with these settings:
- SSID: network identifier
- PASSWORD: network password
- SECURITY_TYPE: network security
Note: These settings need to be configured by the user!
The ESP8266 WiFi Module is connected via an Arduino connector using a USART interface. It exposes a CMSIS-Driver WiFi.
The Board layer contains the following configured interface drivers:
CMSIS-Driver USART2 routed to Arduino UNO R3 connector (P18):
- RX: D0 (PLU_OUT6/GPIO/FC2_USART_RXD_ARD)
- TX: D1 (FC2_USART_TXD_ARD)
CMSIS-Driver SPI8 routed to Arduino UNO R3 connector (P17):
- SCK: D13 (LSPI_HS_SCK)
- MISO: D12 (LSPI_HS_MISO)
- MOSI: D11 (LSPI_HS_MOSI)
GPIO pins routed to Arduino UNO R3 connector (P17):
- output: D10 (LSPI_HS_SSEL1)
- input: D9 (PIO1_5_GPIO_ARD)
CMSIS-Driver VIO with the following board hardware mapping:
- vioBUTTON0: Button USER (PIO1_9)
- vioLED0: LED RED (PIO1_6)
- vioLED1: LED GREEN (PIO1_7)
- vioLED2: LED BLUE (PIO1_4)
STDIO routed to Virtual COM port (DAP-Link, baudrate = 115200)
The board configuration can be modified using
MCUxpresso
and is stored in the file LPCXpresso55S69.mex
.