Possible to clear NVM-stored default SSID/password in ATWINC1500?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm trying to figure out if there's a way to remove the SSID and password data that gets automatically stored in the ATWINC1500 module after a provisioning or a successful connection to an AP in client mode. What I have so far is working well: when the my device boots, it tries to connect using m2m_wifi_default_connect, and if this fails (i.e. rejected because of no data, not that the connection attempt times out), then it enters provisioning mode instead.

 

What I need to do now is allow a way to erase or otherwise disable the SSID/password info from the module if the user decides to go into a re-provisioning mode on purpose. It's obviously not hard to do once, since the application code can simply not call m2m_wifi_default_connect and intentionally go into provisioning mode instead. However, if the provisioning process doesn't complete for some reason and the user reboots the device, the info will still be present in the module and it will try to reconnect to the old AP. I don't want this to happen; rather, once the user triggers re-provisioning mode, I want the module to be in a fresh/blank state until the process succeeds.

 

I can work around this by storing a flag in MCU flash (I'm using an ATSAMD21 here) to indicate "provision-only mode," but this seems like a messy solution since the module obviously has the capability handle it internally. I've looked for APIs inside the low-level driver source files, but so far no luck.

 

Can this be done?

Last Edited: Fri. Oct 26, 2018 - 02:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Have you tried 'sint8 m2m_wifi_delete_sc(char *pcSsid, uint8 u8SsidLen);'?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dragonhead wrote:

Hi,

Have you tried 'sint8 m2m_wifi_delete_sc(char *pcSsid, uint8 u8SsidLen);'?

 

From the description at m2m_wifi.h:

@warning
    The option to delete for a specific SSID is currently not supported; all credentials are
    deleted regardless of the input parameters.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I haven't tried that! It looks like exactly what I needed. That function is apparently not implemented in the Arduino library that I'm using (WiFi101), although most other functions are. Curious. I'll add it in and see if it works--though I fully expect it to based on the docs.

 

Thanks for pointing me in the right direction.