background image

UM-WI-038 

 

DA16x00 Getting Started with AT-Command for 
AWS-IoT 

  

 

User Manual 

Revision 1.1 

13-Jan-2022 

CFR0012 

32 of 39 

© 2022 Renesas Electronics 

 

Head 

Main 

Sub 

Parameters 

0 is no DPM. It may be used for debugging mode  

1 is DPM mode  

RTC_TIME 

Wake up time by timer on Sleep mode 2 

DPM_KEEP_ALIVE 

Keep-alive time between IOT device and AP 

Default value is 30*1000 micro second 

USE_WAKE_UP 

Wake-up time on full-booting mode 

Default value is set to 0. This means unused  

TIM_WAKE_UP 

Period to check beacon frame from AP 

Default value is set to10  

 EX) AT+AWS=SET APP_THINGNAME 

AssignedThingName

 

       AT+AWS=SET AWS_BROKER 

a1kzdt4nun8bnh-ats.iot.ap-northeast-2.amazonaws.com

 

 

A.3.2 

TLS 

Table 6: TLS from MCU to DA16x00 

Start Code 

Sub Code 

Type 

End Code 

\x1b 

C0, 

Root CA 

Self-Signed, well known 

Has root Certificate public key 

Signed by root certificate private key  

\x03 

C1, 

Certificate key 

Has own public key 

Signed by root certificate private key 

Use root certificate public key to prove authenticity 

C2, 

Private Key 

Has own public key 

Signed by certificate private key  

Use certificate 1 public key to prove authenticity 

EX) send "\

x1b“ over UART 

       send "C0,-----BEGIN CERTIFICATE-----\

n“ "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo ….. over UART 

       send 

“\x03”   

 

Содержание UM-WI-038

Страница 1: ...S IoT UM WI 038 Abstract The focus of this document is to easily introduce the AT Command for AWS IoT This is a reference design which includes the AWS IoT Application This reference design provides the user an experience using the AWS IoT Android Application ...

Страница 2: ...ide 11 7 1 The DA16x00 11 7 1 1 How to Connect with Tera Term 11 7 1 2 How to Download a Firmware Image to the DA16x00 12 7 1 3 Thing Name for Testing 14 7 1 4 Stand Alone Mode 15 7 2 MCU Setting 15 8 Mobile App 21 8 1 Overview 21 8 2 Open Door 22 8 3 Close Door 24 8 4 Android Application UI 27 Appendix A AWS IoT AT Command List 29 A 1 Operating Modes 29 A 1 1 Setting Mode 29 A 1 2 Provisioning Mo...

Страница 3: ...Project 16 Figure 17 Debug Configurations Menu 17 Figure 18 Set Debug Configurations 17 Figure 19 Set Perspective Switch 18 Figure 20 Block Diagram for Opening a Door 22 Figure 21 Door Opening Operation 22 Figure 22 Door Opened Status on DA16x00 Console 23 Figure 23 Block Diagram for Closing a Door 24 Figure 24 Door Closing Operation 25 Figure 25 Door Closed Status on DA16x00 Console 26 Figure 26 ...

Страница 4: ...x00 EVB and STM32 Nucleo 64 board 2 Terms and Definitions AP Access Point ADB Android Debug Bridge API Application Programming Interface AWS Amazon Web Services CFG CONFIGURE CMD COMMAND DPM Dynamic Power Management DTIM Delivery Traffic Indication Map IoT Internet of Things MCU Micro Controller Unit OTA Over The Air RTC Real Time Clock SDK Software Development Kit TIM Traffic Indication MAP TSL T...

Страница 5: ...he AT Command for AWS IoT package is as follows DA16x00 Firmware images for the DA16x00 Wi Fi devices Tera Term script for downloading the firmware images to a DA16x00 Wi Fi device Example Tera Term scripts for demonstrating AT Command for AWS IoT using only a PC and the DA16x00 EVK doc Getting Stared with AT Command for AWS IoT Introduces the DA16x00 AT Command for AWS IoT and describes how to se...

Страница 6: ... Command for AWS IoT requires two UART ports UART0 is used to download firmware and to log output UART1 or UART2 is used to communicate AT commands and responses between the MCU and the DA16x00 Additionally two other connections are required between the MCU and the DA16x00 GPIO from the MCU to the DA16x00 to wake up the DA16x00 from DPM mode GPIO from the DA16x00 to the MCU to wake up the MCU if i...

Страница 7: ...M External Host wake up connection if a power saving mode is used This section also includes the AT Command for use with the External Host 6 1 1 UART Connection The default UART1 DA16200 EVK or UART2 DA16600 EVK configurations are shown in Table 1 Table 1 Serial Port Configuration Values Settings Value Baud Rate 115200 Data Bits 8 Parity None Stop Bits 1 Flow Control HW SW None 6 1 1 1 Default UAR...

Страница 8: ...n for UART1 in accordance with the Pin Mux Configuration as shown in Figure 5 For example the following AT CMD can be used to change the Pin Mux configuration to use GPIOA_2 for UART1 TX and GPIOA_3 for UART1 RX AT AWS SET NV_PIN_BMUX BMUX_UART1d GPIOA_2 and GPIOA_3 for UART1 Figure 5 User Example of Custom UART1 HW Connection Table 2 UART1 Pin Configuration PIN Mux GPIO Signal Name PIN_AMUX GPIOA...

Страница 9: ...itions from Low to High and then back to Low Figure 6 DA16x00 Wake Up HW Connection 6 1 3 External Host Wake Up Connection In a low power scenario the External Host may be in sleep mode to save power In this case the DA16x00 requires a connection to the External Host to trigger a wake up from sleep mode If the External Host does not use the power save mode then this connection is not required 6 1 ...

Страница 10: ...shows the GPIO pin configuration information For example to use GPIOC_6 of the DA16200 EVK for the External Host wake up pin set the GPIO port and the GPIO pin using the following AT CMDs AT AWS SET APP_MCU_WKAEUP_PORT GPIO_UNIT_C GPIO_C port AT AWS SET APP_MCU_WKAEUP_PIN GPIO_PIN6 GPIO_6 Figure 8 User Example for External Host Wake Up Pin HW Connection Table 3 GPIO Pin Configuration Port PIN Mux ...

Страница 11: ...ommunication tool such as Tera Term is required to connect the laptop PC to the DA16x00 to download the firmware images and for monitoring the debug logs Tera Term link is https ttssh2 osdn jp 7 1 1 How to Connect with Tera Term Procedure 1 Locate and connect the serial port on the PC Figure 9 Tera Term 2 Select a baud rate The default value for DA16x00 is 230400 Figure 10 Serial Port Setup ...

Страница 12: ...re and set Default EVK EVK Doorlock or Default EVK current board 0 System Mode Station Only 0 DA16x Supp Ver2 7 2020_07 MAC address sta0 d4 3d 39 11 5e 72 sta0 interface add OK Start STA mode UART1 Clock 80000000 BaudRate 115200 UART1 DMA Enabled reg_user_atcmd_help_cb Start AT Command UART1 UART ready notification DA16200 7 1 2 How to Download a Firmware Image to the DA16x00 Procedure Note 1 Ther...

Страница 13: ... in Figure 12 Figure 12 Reset Button RTC switched to XTAL5 seconds Factory reset ready Factory Reseting DA16200 concurrent factory reset AP mode 1 AP_ONLY app_set_customer_ap_configure set AP config mode 0 apps_reboot_ap_mode Customer configuration default_ssid Dialog_DA16200 ap_config_param ssid_name PW 1234567890 PW 1234567890 completed apps_reboot_ap_mode IPADDR_CUSTOMER apps_reboot_ap_mode cus...

Страница 14: ...AWS service invalid aws feature can t start AWS thread check again UART ready 7 1 3 Thing Name for Testing A unique device id called Thing name is required for testing on the provided AWS IoT reference server Note 2 The required Thing name can be requested from a Field Application Engineering FAE For more information to create and set up an AWS IoT own server please refer to the UM WI 017 User Man...

Страница 15: ... r n shadow str r nAT AWS CFG 7 windowStat 1 1 r n shadow str r nAT AWS CFG 8 app_shadow 1 2 r n mcu sub str r nAT AWS CFG 9 mcu_shadow 1 0 r n mcu pub str r nAT AWS SET SLEEP_MODE 3 r n r nAT AWS SET USE_DPM 1 r n r nAT AWS SET RTC_TIME 1740 r n r nAT AWS SET DPM_KEEP_ALIVE 30000 r n r nAT AWS SET USE_WAKE_UP 0 r n r nAT AWS SET TIM_WAKE_UP 10 r n r nAT AWS SET APP_MCU_WKAEUP_PORT GPIO_UNIT_A r n...

Страница 16: ...f 39 2022 Renesas Electronics Figure 14 CubeIDE Project File 2 Use the Thing name received from the FAE to test without setting up a server 3 Change the Thing name to the received name see Figure 15 Figure 15 Thing Name in MCU Source Code 4 Select project Build all to build see Figure 16 Figure 16 Build Project ...

Страница 17: ...2 MCU for the first time do step 5 7 for setting up the Debug Configuration 5 Select Debug Configurations to set the connection to the STM32 MCU see Figure 17 Figure 17 Debug Configurations Menu 6 Selecting the debug tab will open the window shown in Figure 18 Change the configuration as shown and then select the Apply and Debug buttons Figure 18 Set Debug Configurations ...

Страница 18: ...will be downloaded to the device 9 The following shows the DA16x00 setting mode ready status console after a factory mode reset Soft AP is Ready d4 3d 39 11 5e 73 UART1 Clock 80000000 BaudRate 115200 UART1 DMA Enabled reg_user_atcmd_help_cb Start AT Command UART1 UART ready notification AWS IOT AT COMMAND Ver 21 06 202106171700 eoh default set to mcu_wakeup_port 0 mcu_wakeup_pin 0x800 Root CA X Ce...

Страница 19: ...ing console via AT Command from MCU argc num 2 argv 0 AT AWS argv 1 CFG 3 mcu_window 1 0 Att 3 number 3 Att 3 name mcu_window Att 3 data type 1 Att 3 MQTT type 0 argc num 2 argv 0 AT AWS argv 1 CFG 4 battery 0 1 Att 4 number 4 Att 4 name battery Att 4 data type 0 Att 4 MQTT type 1 argc num 2 argv 0 AT AWS argv 1 CFG 5 temp 2 1 Att 5 number 5 Att 5 name temp Att 5 data type 2 Att 5 MQTT type 1 ...

Страница 20: ..._IOT AP Mode FAE DOORLOCK 1 Start Provisioning with TCP TLS Soft AP Mode app_provision_switch_client_thread Create status 0 10 app_provision_TCP_server_thread Create app_provision_TLS_server_thread Create TLS Start Provisioning Server TLS Wait Accept TLS app_find_home_ap Wi Fi Scan request success app_find_home_ap 518 0 iptime_justin 3 34 2447 app_find_home_ap 518 1 AP 101 201 3 66 2432 app_find_h...

Страница 21: ...i interface can be done either using Soft AP mode DA16200 or Bluetooth Low Energy mode DA16600 To use the mobile app to provision the Wi Fi device mobile network data must be set to off on the mobile phone and Wi Fi and Bluetooth Low Energy must be enable Once provisioning is completed mobile network data can be set back to on For detailed information on Mobile App and Provisioning see UM WI 042 D...

Страница 22: ...2022 CFR0012 22 of 39 2022 Renesas Electronics 8 2 Open Door The block diagram of opening the door is shown in Figure 20 Figure 20 Block Diagram for Opening a Door The operation of the Android app and the shadow state of the AWS IOT console is shown in Figure 21 Figure 21 Door Opening Operation ...

Страница 23: ...2 23 of 39 2022 Renesas Electronics Final state Door opened Window closed Mobile APP User button is shown AWS Server windowStat closed doorStat opened temp 31 battery 66 DA16x00 Thing The status of the device is displayed as shown in the red box in Figure 22 Figure 22 Door Opened Status on DA16x00 Console ...

Страница 24: ...rted with AT Command for AWS IoT User Manual Revision 1 1 13 Jan 2022 CFR0012 24 of 39 2022 Renesas Electronics 8 3 Close Door The block diagram for closing the door is shown in Figure 23 Figure 23 Block Diagram for Closing a Door ...

Страница 25: ...peration of the Android app and the shadow state of the AWS IOT console is shown in Figure 24 Figure 24 Door Closing Operation Final state Door closed Window closed Mobile APP User button is shown AWS Server windowStat closed doorStat closed temp 2 battery 33 DA16x00 Thing The status of the device is displayed as shown in the red box in Figure 25 ...

Страница 26: ...UM WI 038 DA16x00 Getting Started with AT Command for AWS IoT User Manual Revision 1 1 13 Jan 2022 CFR0012 26 of 39 2022 Renesas Electronics Figure 25 Door Closed Status on DA16x00 Console ...

Страница 27: ... 8 4 Android Application UI Figure 26 shows screenshots of the AWS IoT Application on an Android phone Figure 26 Android Application Screenshots The following pictograms explains various UI items Name of Thing Connection status with AWS server Connection status with device MQTT publish subscribe Topic Message Reported item of AWS IoT Shadow ...

Страница 28: ...tarted with AT Command for AWS IoT User Manual Revision 1 1 13 Jan 2022 CFR0012 28 of 39 2022 Renesas Electronics Request update shadow button OTA update button Door control button Door status Window control button Window status ...

Страница 29: ...setting mode The customer should set everything to run DA16x00 Take note that it will not work unless the TLS certificate keys are set All contents should be set with the SET command and data configured that is filed with CFG command It will store all data before calling factory reset command see Figure 27 Figure 27 Setting Mode A 1 2 Provisioning Mode This mode is for provisioning the DA16x00 usi...

Страница 30: ... communicate send and receive topic values with an AWS server See Figure 29 Figure 29 Communication Mode A 2 How to Configure Topic to Publish Subscribe and Shadow A 2 1 Configure Topics Topics are configured as shown in Table 4 The MCU and Mobile App should be designed with the topics of Table 4 The MCU pushes the topics in Table 4 to the DA16x00 using AT CMD The DA16x00 facilitates the communica...

Страница 31: ...1 shadow opened closed Figure 30 Communication from MCU to Phone A 3 AT CMD List A 3 1 Basic Set Table 5 The Basic set of MCU to DA16x00 Head Main Sub Parameters AT AWS SET APP_THINGNAME Setting device name It will be used to choice a device by thing name during provisioning AWS_BROKER Set broker address AWS_LPORT Set local port It will be set to 8883 normally AWS_SUBTOPIC Set subscriber topic nam...

Страница 32: ...ame from AP Default value is set to10 EX AT AWS SET APP_THINGNAME AssignedThingName AT AWS SET AWS_BROKER a1kzdt4nun8bnh ats iot ap northeast 2 amazonaws com A 3 2 TLS Table 6 TLS from MCU to DA16x00 Start Code Sub Code Type End Code x1b C0 Root CA Self Signed well known Has root Certificate public key Signed by root certificate private key x03 C1 Certificate key Has own public key Signed by root ...

Страница 33: ...1d 6 UART1 RXD TXD CMUX_GPIO 8 GPIOA 5 4 NV_PIN_DMUX DMUX_UART1d 4 UART1 RXD TXD DMUX_GPIO 8 GPIOA 7 6 NV_PIN_EMUX EMUX_GPIO 8 GPIOA 9 8 NV_PIN_FMUX FMUX_GPIO 6 GPIOA 11 10 NV_PIN_UMUX UMUX_GPIO 2 GPIOC 8 6 APP_MCU_WKAEUP_PORT GPIO_UNIT_A 0 GPIO_UNIT_C 2 Support only GPIO 6 7 8 APP_MCU_WKAEUP_PIN GPIO_PIN0 GPIO_PIN11 UART_CFG baud rate Note Default pin mux is BMUX and Ex use GPIOA2 GPIOA3 for UART...

Страница 34: ...ike temporary When phone connect to cloud Phone will get the value Subscribe 2 It will use prompt command to send from phone to MCU as like door open command Ex AT AWS CFG 0 door_status 0 0 AT AWS CFG 1 battey 2 1 AT AWS CFG 2 door_open 0 2 A 3 5 Command MCU to DA16x00 Table 9 Command of MCU to DA16x00 Head Main Sub Description AT AWS CMD FACTORY_RESET It will set factory reset mode by removing se...

Страница 35: ...string used at this time is reserved as update Ex AWSIOT SERVER_DATA 0 door_control open AWSIOT CMD_TO_MCU update A 3 7 DA16x00 Status DA16x00 to MCU Table 11 Status from DA16x00 to MCU Status Value Parameters IDLE 1 No entry to AWS IOT application mode It will send when a system error like network connection failure happens Done factory reset 0 It will send after completes factory reset by CMD FA...

Страница 36: ...ith AT Command for AWS IoT User Manual Revision 1 1 13 Jan 2022 CFR0012 36 of 39 2022 Renesas Electronics Status Value Parameters Start STA 20 Not defined yet Done STA 25 It will send when entering sleep mode for DPM EX AWSIOT STATUS 15 ...

Страница 37: ... Manual Revision 1 1 13 Jan 2022 CFR0012 37 of 39 2022 Renesas Electronics Revision History Revision Date Description 1 1 13 Jan 2022 Rebranded document to Renesas branding guidelines Change DA16200 to DA16x00 Support DA16200 and DA16600 1 0 10 Dec 2020 First Release ...

Страница 38: ... which may result in modifications or additions APPROVED or unmarked The content of this document has been approved for publication RoHS Compliance Dialog Semiconductor s suppliers certify that its products are in compliance with the requirements of Directive 2011 65 EU of the European Parliament on the restriction of the use of certain hazardous substances in electrical and electronic equipment R...

Страница 39: ...plication and 3 ensuring your application meets applicable standards and any other safety security or other requirements These resources are subject to change without notice Renesas grants you permission to use these resources only for development of an application that uses Renesas products Other reproduction or use of these resources is strictly prohibited No license is granted to any other Rene...

Отзывы: