How to change the Thing Name

Solved
pihlung's picture
pihlung
Junior(2)

1.I have defined a new Thing Name in AWS 

2.Downloaded the certificate and keys to /resources/apps/aws_iot 

3.Modified these two files with the new Thing Name

shadow_light_sense/aws_config.h

#define AWS_DEFAULT_THING_NAME   "NewName"

 

shadow_light_sense/aws_config_dct.c

DEFINE_APP_DCT(aws_config_dct_t)

{

   .is_configured = WICED_TRUE, 

   .thing_name = "NewName"

};

 

4. I ran Make clean before building the project "shadow_light_sense"

It successfully build and deploy the programs, but it always succesfully connect, and subscribe to topic to AWS to Thing Name sk_0001 , despite I have no such thing

defined and I can't find any file in WICED-SDK that contain the string "sk_0001"

Please advise how and where to change the Thing Name in the WICED environment! 

A link to a WICED API / WICED IDE document would be appreciated as well.

Thanks

Jade Dragon

 

 

"IPv4 network ready IP: 172.18.12.216
Setting IPv6 link-local address
IPv6 network ready IP: FE80:0000:0000:0000:B238:29FF:FE3D:3A67
[MQTT] Connecting to broker 54.236.181.116 ...

Thing Name: sk_0001
Shadow State Topic: $aws/things/sk_0001/shadow/update
Shadow Delta Topic: $aws/things/sk_0001/shadow/update/delta
Reading the certificate and private key from DCT...
[MQTT] Connecting to MQTT Broker...
sensor value 3282
[MQTT] Successfully connected MQTT Broker
Publish SUCCEEDED for topic [$aws/things/sk_0001/shadow/update]
sensor value 3282
Subscribe SUCCEEDED for topic [$aws/things/sk_0001/shadow/update/delta]
Publish SUCCEEDED for topic [$aws/things/sk_0001/shadow/update]
Received {"version":27,"timestamp":1468256961,"state":{"status":"ON"},"metadata":{"status":{"timestamp":1468249164}}}  for TOPIC : $aws/things/sk_0001/shadow/update/delta

Requested LED State[ON] Current LED State [OFF]
Publish SUCCEEDED for topic [$aws/things/sk_0001/shadow/update]"

 

 

"10:52:14 **** Build of configuration Default for project WICED-SDK ****
"C:\\Users\\xx\\Desktop\\WicedProject\\WICED\\WICED-SDK-3.5.2\\WICED-SDK\\make.exe" demo.aws_iot.shadow_light_sense-BCM94343W_AVN download download_apps run 
MAKEFILE MAKECMDGOALS=demo.aws_iot.shadow_light_sense-BCM94343W_AVN download download_apps run OTA2_SUPPORT is disabled
Building Bootloader
Building Serial Flash Loader App
MAKEFILE MAKECMDGOALS=waf.sflash_write-NoOS-BCM94343W_AVN-SDIO OTA2_SUPPORT is disabled
waf.sflash_write-NoOS-BCM94343W_AVN-SDIO
----------------------------------|---------|---------|
                                  |         |  Static |
              Module              |  Flash  |   RAM   |
----------------------------------+---------+---------|
App                               |       0 |   21126 |
Host MCU-family library           |       0 |   12584 |
Interrupt Vectors                 |       0 |     388 |
libc                              |       0 |     548 |
platform                          |       0 |    1300 |
Ring_Buffer                       |       0 |      36 |
SPI_Flash_Library_BCM94343W_AVN   |       0 |     984 |
Startup Stack & Link Script fill  |       0 |     486 |
WWD                               |       0 |     176 |
----------------------------------+---------+---------|
TOTAL (bytes)                     |       0 |   37628 |
----------------------------------|---------|---------|

Finished Building Bootloader

Build complete
Finished Building Serial Flash Loader App

demo.aws_iot.shadow_light_sense-BCM94343W_AVN
----------------------------------|---------|---------|
                                  |         |  Static |
              Module              |  Flash  |   RAM   |
----------------------------------+---------+---------|
App                               |    7026 |    8656 |
base64                            |     523 |       0 |
crc                               |    1060 |       0 |
crypto_open                       |   46539 |       0 |
DHCP_Server                       |    1524 |     132 |
DNS                               |    1500 |      44 |
DNS_Redirect_Daemon               |     645 |       0 |
Host MCU-family library           |   14568 |    2568 |
HTTP_Server                       |    3364 |       0 |
Interrupt Vectors                 |     388 |       0 |
JSON_parser                       |    1768 |     660 |
libc                              |   36825 |    3140 |
Linked_List                       |     504 |       0 |
micro_ecc                         |    5848 |       0 |
MQTT_Client                       |    5496 |     736 |
Networking                        |    5860 |   13208 |
NetX-Duo - Interfaces & Stacks    |       0 |      16 |
Other                             |   44662 |     535 |
Packet Buffers                    |       0 |   23086 |
platform                          |    1532 |     256 |
RAM Initialisation                |    2796 |       0 |
resources                         |   58124 |       0 |
Ring_Buffer                       |      92 |       0 |
SPI_Flash_Library_BCM94343W_AVN   |     512 |       0 |
Startup Stack & Link Script fill  |      48 |      19 |
Supplicant - BESL                 |   37232 |     536 |
ThreadX                           |    8588 |     396 |
TLV                               |     200 |       0 |
WICED                             |    4739 |     964 |
Wiced_RO_FS                       |     568 |       0 |
WWD                               |   15973 |    3048 |
----------------------------------+---------+---------|
TOTAL (bytes)                     |  305708 |   58000 |
----------------------------------|---------|---------|

Downloading Bootloader ...
Building apps lookup table
No changes detected 

Downloading DCT ...
Download complete 

Downloading Application ...
No changes detected 

Downloading WIFI_FIRMWARE ... at sector 1  size 88...
Downloading apps lookup table in wiced_apps.mk ... build/demo.aws_iot.shadow_light_sense-BCM94343W_AVN/APPS.bin @ 0x0000 size 
Resetting target
Target running
Build complete
Making .gdbinit

10:52:54 Build Finished (took 40s.231ms)

"

pihlung's picture
pihlung
Junior(2)

I found the reason. sk_0001 was stored in DCT. To correct it I needed to reset the board and hold the user button down for 5 sec, in this Access Point mode press the user button again 5 sec to clear the DCT, then use the browser (192.168.0.1 12345678) to enter the "correct" Thing Name plus cert/key/ssid/passw. It will be saved to DCT.

 

 

sohapihik's picture
sohapihik
Junior(0)

Every tool and software have different approaches to change and delete the things sometimes they offer the great thing and some time they offer some bad. You just do it properly as best paper writing service 2020 telling you.

sylofu's picture
sylofu
Junior(0)

The software makes your life easy and good but sometime when the error comes you will tuck at the small part and not identify the error. So simply ask your self that is ukessays reliable quality and use the legit software.