Not joining my SSID after "Baking" in the access point information

Unsolved

Hi

I'm following the Tutorial, (I am using Shadow example) and I've been able to "bake in" (hard code) my wifi details, but it does not take.

I have followed the directions exactly, and I have done some other tests such as changing string output and viewing this on serial terminal, to verify it is actually compiling and building my application.  However it will not join my wifi, it doesn't even show any signs of trying.  By way of comparison I entered incorrect wifi information through the web interface and it tried repeatedly to connect, this I could see from the terminal.

Interestingly, when I join WICED SSID and view the web page, it did prepopulate my "Thing" name as I had set it in the code.  But the wifi details did not save, or the code did not attempt to connect.

Thanks

PeterF's picture
PeterF
Moderator(16)

Issues connecting to WiFi Access Point

Make sure you are editing the correct section of your wifi_config_dct.h file (lines 38-43)
Not explicitly mentioned in the tutorial, but if you are using the 5GHz band or a different type of security, you will need to update those fields as well...
 

The different security types can be referenced from line #102 in the following file:
.../WICED-SDK/WICED/WWD/include/wwd_constants.h
 

 

Hi PeterF - yes I am editing the correct sections.  Based on your comments I have tried a few other constants, with the same results.

 

#define CLIENT_AP_SSID       "Westward"
#define CLIENT_AP_PASSPHRASE "my_wireless-passphrase"
#define CLIENT_AP_BSS_TYPE   WICED_BSS_TYPE_ANY            //    WICED_BSS_TYPE_INFRASTRUCTURE
#define CLIENT_AP_SECURITY   WICED_SECURITY_WPA2_AES_PSK    // WICED_SECURITY_WPA2_MIXED_PSK
#define CLIENT_AP_CHANNEL    6
#define CLIENT_AP_BAND       WICED_802_11_BAND_2_4GHZ        // WICED_802_11_BAND_5GHZ

Here is what scan program found about my network.

 2 Infra D8:50:E6:5A:57:E8  -73 216.7    6  WPA2 AES   PSK         Westward

 

I noticed some things in the shadow.mk file didn't look right, so I made some modifications, but still no love :(

 

ifneq (,$(findstring USE_HTTPS,$(GLOBAL_DEFINES)))
#CERTIFICATE := $(SOURCE_ROOT)resources/certificates/brcm_demo_server_cert.cer
#PRIVATE_KEY := $(SOURCE_ROOT)resources/certificates/brcm_demo_server_cert_key.key 
CERTIFICATE := $(SOURCE_ROOT)resources/apps/aws_iot/client.cer
PRIVATE_KEY := $(SOURCE_ROOT)resources/apps/aws_iot/privkey.cer
endif

$(NAME)_COMPONENTS := protocols/MQTT \
                      inputs/gpio_button \
                      libraries/utilities/JSON_parser

$(NAME)_RESOURCES  := apps/aws_iot/rootca.cer \
                      apps/aws_iot/client.cer \
                      apps/aws_iot/privkey.cer

PeterF's picture
PeterF
Moderator(16)

You should not need to edit the shadow.mk file!

 

Did you follow the "bake-in" procedure on page 10-13 of the Installation Tutorial (Part 2) ?
 

 

 

 

Yes as I mention in first message, I am following the tutorial. I have tried dozens of alternatives and I can't get this to work. Please help!

andrew997's picture
andrew997
Moderator(1)

What is the output you see on the serial port console?

Try making the following changes to aws_common.c:

 

/* Read security parameters from DCT */
resource_get_readonly_buffer( &resources_apps_DIR_aws_iot_DIR_rootca_cer, 0, MQTT_MAX_RESOURCE_SIZE, &size_out, (const void **) &security.ca_cert );

 

// Add these two lines to load certificates from local folder:

 

  resource_get_readonly_buffer( &resources_apps_DIR_aws_iot_DIR_privkey_cer, 0, MQTT_MAX_RESOURCE_SIZE, &size_out, (const void **) &security.key);

 

  resource_get_readonly_buffer( &resources_apps_DIR_aws_iot_DIR_client_cer, 0, MQTT_MAX_RESOURCE_SIZE, &size_out, (const void **) &security.cert);

 

// Comment-out these 2 lines if certificates from local folder:
//    security.cert = dct_security->certificate;
//    security.key = dct_security->private_key;

 

PeterF's picture
PeterF
Moderator(16)

Note! - Two additional edits are required before this is baked! 

 

1) In the .mk file for your project (in project folder),
ensure the following resources are defined:

 

$(NAME)_RESOURCES := apps/aws_iot/rootca.cer \
                                        apps/aws_iot/client.cer \
                                        apps/aws_iot/privkey.cer

 

 

2) Append the following to the end of aws_config_dct.c :

 

// Allow WLAN and AWS config to be loaded from local folder:

DEFINE_APP_DCT(aws_config_dct_t)
{
    .is_configured = WICED_TRUE,
    .thing_name = "sk_0001"  // define your thing name here
};

 

Note! The v1.1 version of the Part 2 Installation Tutorial provides a summary of these updated instructions

 

PeterF's picture
PeterF
Moderator(16)

Note! The Installation Tutorial Part 2 document has been revised to v1.1 (see page 11-14 for corrected procedure for "baking-in" the network and AWS configuration)

Download at: http://cloudconnectkits.org/forum/topic/installation-tutorials 

majorninth's picture
majorninth
Junior(0)

If you add:

    resource_get_readonly_buffer( &resources_apps_DIR_aws_iot_DIR_privkey_cer, 0, MQTT_MAX_RESOURCE_SIZE, &size_out, (const void **) &security.key);
    resource_get_readonly_buffer( &resources_apps_DIR_aws_iot_DIR_client_cer,  0, MQTT_MAX_RESOURCE_SIZE, &size_out, (const void **) &security.cert);

don't you need to add resource_free_readonly_buffer somewhere too?

 

PeterF's picture
PeterF
Moderator(16)

Based on the advice provided above, have you been able to successfully connect to your WiFi Access Point and MQTT broker at this stage...?

 

The question on whether resource_free_readonly_buffer statements are needed, will best be answered on the Broadcom WICED WiFi forum, but to my knowledge this has not been a requirement thus far.