Programmatically start WiFi as AP with specific SSID

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

Hello.

I want to start WiFi as AP with a specific SSID.

My SSID has to be "MyProduct_SNXXXX" where "XXXX" is the serial number of my product

and has to be stored in some non volatile memory (FLASH, EEPROM, uSD).

 

Using "wifi_config_dct.h" macro is not a good idea.

0 Likes
1 Solution
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

Take a look at /43xxx_Wi-Fi/apps/snip/dct_read_write

You can start your application, then set the serial number of whatever that is needed in the WIFI DCT section and then start the AP.

This should solve the requirement that is needed.

View solution in original post

0 Likes
5 Replies
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

Take a look at /43xxx_Wi-Fi/apps/snip/dct_read_write

You can start your application, then set the serial number of whatever that is needed in the WIFI DCT section and then start the AP.

This should solve the requirement that is needed.

0 Likes
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

OK, it's a good solution,

but If I want to start AP with a SSID defined run-time ?

 

For example, I want to save the serial number in DCT but I want to build SSID from this serial number, for example in this way

 

int sn = read_sn_from_dct();

char ssid[10];

sprintf(ssid, "MyProduct_SN%d",sn);

/* start AP */

 

 

0 Likes
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

The same approach can be employed right? Have some ssid during build which you can overwrite in the DCT during runtime.

 

MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

OK, I understand ... I can write in DCT the new SSID

 

int sn = read_sn_from_dct();

char ssid[10];

sprintf(ssid, "MyProduct_SN%d",sn);

write_new_ssid ( );

start_AP ( );

0 Likes
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

OK, I found 

wiced_result_t wiced_network_set_hostname ( const char *  name )