Forums - Onboard demo with AWS

6 posts / 0 new
Last post
Onboard demo with AWS
JBloom
Join Date: 20 Mar 19
Posts: 7
Posted: Thu, 2019-05-30 06:50

Hi,

I would like to make Onboard demo with cloud mode with two QCA4020 development kits. I use the software version qca4020.or_.3.0_00011.1 and the build command is: build.bat t 4020 1 1 1 cdb.

I use mobile application for onboarding and to connect to WiFi, but I receive this error:

 
Onboard: Waiting for Onboard events ...
Onboard: DHCPv4c: IP=11.11.91.13  Subnet Mask=255.255.0.0  Gateway=11.11.0.1
Onboard: IPADDR:d5b0b0b, MSK:ffff, GW:1000b0b
Onboard: Iface has the IP addr
Onboard: Sntpc start success: 0
Onboard: SNTP ADD SVR Called
Onboard: Zigbee LinkKey qMH56vxhNLnhjV6h
Onboard: Zigbee Mode c
Onboard: Initiate Zigbee Onboarding
Onboard: Op_Mode:c
Onboard: Master_key=qMH56vxhNLnhjV6h
Onboard: bytes_written num = 1
Onboard: bytes_written num = 16
Onboard: Rised signal: 4
Onboard: Add server return value : 0
Onboard: SNTP client is started.
Onboard: 0: pool.ntp.org    ****
Onboard: 1: pool.ntp.org    ****
Onboard: waiting on Monitor thread
Onboard: config_zigbee
Onboard: Starting Zigbee
Onboard: Starting ZB CO-Ordinator
Onboard: FAILED qapi_ZB_Initialize
Onboard: Failed to Initialize Zigbee Stack
 
Onboard: Failed to config Zigbee
 
Onboard: Waiting for Onboard events ...
Onboard: IPADDR:d5b0b0b, MSK:ffff, GW:1000b0b
Onboard: Iface has the IP addr
Onboard: etGATT_Connection_Device_Disconnection with size 16:
Onboard:    Connection ID:   1.
Onboard:    Connection Type: LE.
Onboard:    Remote Device:   0x5A504399292F.
 
>
Onboard: etLE_Disconnection_Complete with size 16.
Onboard:    Status: 0x00.
Onboard:    Reason: 0x13.
Onboard:    BD_ADDR: 0x5A504399292F.
Onboard:    GAP_LE_Advertising_Enable success, Advertising Interval Range: 100 - 200.
 
>
Onboard: try to resolve ....
Onboard: e Value: 0
 
Onboard: amdraynnbl3cv-ats.iot.eu-central-1.amazonaws.com -->
Onboard: START AWS: running(0)
Onboard:            total       used       free
Onboard: Shadow Init
 
Onboard: Heap:     161792     134328      27464
Onboard: Shadow Connect
 
Onboard: mutex unlock done ---------
Onboard: waiting on Monitor thread
Onboard: Shadow Connection Error
 
Onboard: : rc = -19
Onboard: IPADDR:d5b0b0b, MSK:ffff, GW:1000b0b
Onboard: Iface has the IP addr

 

When I build with freertos: build.bat f 4020 1 1 1 cdb, then even before onboarding this error gets printed:

Onboard: AWS IoT SDK Version 3.0.1-
Onboard: Stack rc=1009700c ret=10097018
Onboard: Malloc mqttClient=100a8e80
 
Onboard:  AWS shadow_init done
Onboard: Hostname:amdraynnbl3cv-ats.iot.eu-central-1.amazonaws.com
Onboard: Client crt file name:cert
Onboard: Client Thing name:MyIoTButton
Onboard: bytes_written num = 1
Onboard:    GAP_LE_Advertising_Enable success, Advertising Interval Range: 100 - 200.
 
Onboard: Thread creation is failed
Onboard: Failed to create Onboard Thread
Onboard: certificate store is success ......................
Onboard: certificate store is success ......................

 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Wed, 2019-06-05 16:22
There are two problems listed here :
1) with Threadx build Shadow connection Error Onboard: : rc = -19  (Returned when the device certificate is invalid)
 
Kindly use the legacy end point and legacy root CA for this issue (amdraynnbl3cv.iot.eu-central-1.amazonaws.com) and (https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSig...)
 
 
2.With FreeRTOS build, Thread creation is failed - Onboard: Failed to create Onboard Thread.
Kindly confirm that FreeRTOS heap changes were adjusted before building the demo. Please refer to  Section 5.1 Prerequisites to build onboard AWS demo from document 80-YA121-140 QCA402x (CDB2x) Development Kit User Guide (point 4-7).
 
  • Up0
  • Down0
JBloom
Join Date: 20 Mar 19
Posts: 7
Posted: Thu, 2019-06-06 09:10
Hi raja_pedada,
 
Thanks for the answer! I did not adjust the heap for ThreadX/FreeRTOS.
 
What about:
 
#define AWS_CERT_LOC "cert"
#define AWS_CALIST_LOC "calist"
 
Should it stay as it is?
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2019-06-06 11:43

You only need to adjust the heap size as listed in document for ThreadX/FreeRTOS based build and edit the file under src\include\cert_buf.h to include legacy rootCA.
 

  • Up0
  • Down0
JBloom
Join Date: 20 Mar 19
Posts: 7
Posted: Fri, 2019-06-07 08:32

Hi raja_pedada,

I made the changes you suggested. Shadow Connection was successful only after the third attempt and then the following error occurred:

Onboard: Waiting for connection success event

Onboard: WLANCB: dID:1, cbID:0, val:1
Onboard: Connect event on devId:1 val:1
Onboard: devid - 1 1 CONNECTED MAC addr f2:9f:c2:31:e0:20
Onboard: Get DHCP addr
Onboard: WLANCB: dID:1, cbID:0, val:16
Onboard: Connect event on devId:1 val:16
Onboard: 4 way handshake success for device=1
Onboard: certificate store is success ......................
Onboard: config_zigbee
Onboard: Starting Zigbee
Onboard: Starting ZB CO-Ordinator
Onboard: ZigBee stack initialized.
Onboard: Extended Address: 000023A999F0FD8C
Onboard: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Onboard: Zigbehandle: 00000001
Onboard: Mac Value 99f0fd8c
Onboard: Successfully set Extended Address
Onboard: Extended Address: 000000FF99F0FD8C
Onboard: Short Address:    0xFFFF
Onboard: Successfully created Zigbee network
Onboard: Timer Set PermitTime 255 sec
Onboard: Permitted to join
Onboard: Timer is Set
Onboard: In ZCL_OnOff_Demo_Create_Client, Endpoint = 111
Onboard: In ZCL_OnOff_Demo_Create_Client, Endpoint = 113
Onboard: Zigbee is configured successfully
 
Onboard: Waiting for Onboard events ...
Onboard: certificate store is success ......................
Onboard: DHCPv4c: IP=11.11.91.13  Subnet Mask=255.255.0.0  Gateway=11.11.0.1
Onboard: IPADDR:d5b0b0b, MSK:ffff, GW:1000b0b
Onboard: Iface has the IP addr
Onboard: Form confirm
Onboard:   Status:  0
Onboard:   Channel: 24
 
>
Onboard: Sntpc start success: 0
Onboard: SNTP ADD SVR Called
Onboard: Add server return value : 0
Onboard: SNTP client is started.
Onboard: 0: pool.ntp.org    ****
Onboard: 1: pool.ntp.org    ****
Onboard: waiting on Monitor thread
Onboard: IPADDR:d5b0b0b, MSK:ffff, GW:1000b0b
Onboard: Iface has the IP addr
Onboard: try to resolve ....
Onboard: e Value: 0
 
Onboard: amdraynnbl3cv.iot.eu-central-1.amazonaws.com -->
Onboard: START AWS: running(0)
Onboard:            total       used       free
Onboard: Shadow Init
 
Onboard: Heap:     292352     176368     115984
Onboard: Shadow Connect
 
Onboard: mutex unlock done ---------
Onboard: waiting on Monitor thread
Onboard: Shadow Connection Error
 
Onboard: : rc = -19
Onboard: IPADDR:d5b0b0b, MSK:ffff, GW:1000b0b
Onboard: Iface has the IP addr
Onboard: try to resolve ....
Onboard: e Value: 0
 
Onboard: amdraynnbl3cv.iot.eu-central-1.amazonaws.com -->
Onboard: START AWS: running(0)
Onboard:            total       used       free
Onboard: Shadow Init
 
Onboard: Heap:     292352     176464     115888
Onboard: Shadow Connect
 
Onboard: mutex unlock done ---------
Onboard: waiting on Monitor thread
Onboard: Shadow Connection Error
 
Onboard: : rc = -19
Onboard: IPADDR:d5b0b0b, MSK:ffff, GW:1000b0b
Onboard: Iface has the IP addr
Onboard: try to resolve ....
Onboard: e Value: 0
 
Onboard: amdraynnbl3cv.iot.eu-central-1.amazonaws.com -->
Onboard: START AWS: running(0)
Onboard:            total       used       free
Onboard: Shadow Init
 
Onboard: Heap:     292352     176464     115888
Onboard: Shadow Connect
 
Onboard: mutex unlock done ---------
Onboard: waiting on Monitor thread
Onboard: Shadow Connection successful
 
Onboard: Topic_name : $aws/things/MyIoTButton/shadow/update/delta
Onboard: shadow reconnect status done
Onboard: In while RC Value:4
Onboard: DisconnectingDisconnect error -13
 
 
 
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Fri, 2019-06-07 15:43

Since we are using the legacy Root CA, we can expect the client to connect with AWS server using  multiple tries, however the connection should establish and everything should work as expected. Will try to check if I can repoduce the issue internally.

The error which you reported is due to wifi network which you are trying to connect to.
Error -13 refers to NETWORK_DISCONNECTED_ERROR ( you can check error information under @target\thirdparty\aws\awsiot\includ\aws_iot_error.h)

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.