cancel
Showing results for 
Search instead for 
Did you mean: 

SPWF04S MiniAP mode issues

ScottT
Associate

I've recently updated some SPWF04SA modules to firmware version 1.1.0 and I have a couple of problems with Mini AP mode:

  • The SSID I set with AT+S.SSIDTXT=<SSID> seems to be being truncated to 6 characters in the beacon frame, even though the WIND:26 notification gives the full SSID. I don't remember seeing this problem with firmware version 1.0.0. I've even tried setting wifi_ssid_len explicitly to the correct size, but it makes no difference.

  • If I configure for WPA2 security (wifi_priv_mode=2), it still appears as an unsecured AP, and I can connect to it without a password. The full message sequence is as follows:

+WIND:1:Poweron:171117-0328fe3-SPWF04S

+WIND:13:Copyright (c) 2012-2017 STMicroelectronics, Inc. All rights Reserved:SPWF04SA

+WIND:0:Console active

+WIND:3:Watchdog Running:20

AT+S.WIFI=0

AT-S.ERROR:18:Radio not running

AT+S.SCFG=wifi_tx_power,0

AT-S.OK

AT+S.SCFG=ip_use_httpd,0

AT-S.OK

AT+S.SCFG=ip_use_tftpd,0

AT-S.OK

AT+S.SCFG=ip_use_v6,0

AT-S.OK

AT+S.SCFG=ip_ntp_startup,0

AT-S.OK

AT+S.WIFI=0

AT-S.ERROR:18:Radio not running

AT+S.SSIDTXT=<my SSSID>

AT-S.OK

AT+S.SCFG=wifi_wpa_psk_text,<my password>

AT-S.OK

AT+S.SCFG=wifi_auth_type,0

AT-S.OK

AT+S.SCFG=wifi_priv_mode,2

AT-S.OK

AT+S.SCFG=wifi_mode,3

AT-S.OK

AT+S.WIFI=1

AT-S.OK

+WIND:32:WiFi Hardware Started

+WIND:26:Started AP:<my SSSID>

+WIND:24:WiFi Up:0:192.168.0.50

AT+S.GCFG=ip_netmask

AT-S.Var:ip_netmask=255.255.255.0

AT-S.OK

+WIND:28:Station Associated:00:0F:00:4F:B1:3F:0

[...]

Am I missing something somewhere?

Thanks in advance,

Scott.

3 REPLIES 3
Elio Cometti
Senior II

​Hello Scott,

the command sequence seems correct.

I don't see the WIND:46: WPA Crunching PSK: indication, that may confirm the MiniAP is starting in open mode.

I also checked the truncated SSID, but I cannot reproduce it on my side.

I kindly ask you to restore the factory setting:

AT+S.FCFG

AT+S.WCFG

AT+S.RESET

then wait for "WIND:32: WiFi Hardware Started" and then send your sequence above (AT+S.WIFI=0, ...).

Best Regards,

Elio

ScottT
Associate

Thanks for your reply, Elio. After much experimentation, the following sequence of commands seems to start MiniAP mode with WPA2 enabled (and the full un-truncated SSID) consistently. I had to reset the module after the AT+S.WCFG using the reset pin instead of AT+S.RESET as it seemed to stop responding to commands when I used that.

+WIND:1:Poweron:171117-0328fe3-SPWF04S

+WIND:13:Copyright (c) 2012-2017 STMicroelectronics, Inc. All rights Reserved:SPWF04SA

+WIND:0:Console active

+WIND:3:Watchdog Running:20

AT+S.WIFI=0

AT-S.ERROR:18:Radio not running

+WIND:32:WiFi Hardware Started

AT+S.SCFG=wifi_mode,3

AT-S.OK

AT+S.WCFG

AT-S.OK

+WIND:1:Poweron:171117-0328fe3-SPWF04S

+WIND:13:Copyright (c) 2012-2017 STMicroelectronics, Inc. All rights Reserved:SPWF04SA

+WIND:0:Console active

+WIND:3:Watchdog Running:20

+WIND:32:WiFi Hardware Started

AT+S.WIFI=0

AT-S.OK

+WIND:26:Started AP:<my SSID>

+WIND:49:WPA Terminated:0

+WIND:38:WiFi Powered Down

AT+S.SCFG=wifi_tx_power,0

AT-S.OK

AT+S.SCFG=ip_use_httpd,0

AT-S.OK

AT+S.SCFG=ip_use_tftpd,0

AT-S.OK

AT+S.SCFG=ip_use_v6,0

AT-S.OK

AT+S.SCFG=ip_ntp_startup,0

AT-S.OK

AT+S.WIFI=0

AT-S.ERROR:18:Radio not running

AT+S.SSIDTXT=<my SSID>

AT-S.OK

AT+S.SCFG=wifi_wpa_psk_text,<my password>

AT-S.OK

AT+S.SCFG=wifi_auth_type,0

AT-S.OK

AT+S.SCFG=wifi_priv_mode,2

AT-S.OK

AT+S.SCFG=wifi_mode,3

AT-S.OK

AT+S.WIFI=1

AT-S.OK

+WIND:46:WPA Crunching PSK:<my password>:14

+WIND:32:WiFi Hardware Started

+WIND:26:Started AP:<my SSID>

+WIND:24:WiFi Up:0:192.168.0.50

Waiting for the WIND 32 after reset, before issuing AT+S.WIFI=0 seems to be crucial, as does resetting after setting and saving wifi_mode so that it is set to the desired value at boot time. Also I think AT+S.WIFI=0 needs to be sent before wifi_mode is set before the reset.

I have also observed a further issue with MiniAP mode - the DHCP server will by default offer to clients a default gateway address of 165.165.165.165. Surely this is erroneous?

Elio Cometti
Senior II

​Hi Scott,

at boot the WiFi Hardware will be started or not depending on the hardware state at last AT+S.WCFG command.

Actually:

  • the AT+S.WCFG command was issued when the WiFi Hardware was started: at next boot you should wait for WIND:32: and issue the AT+S.WIFI=0 command if you wish to change any wifi_* config variable;
  • the AT+S.WCFG command was issued when the WiFi Hardware was stopped: at next boot you have to wait WIND:0:, as the WIND:32: will never come;

At this point you can change any wifi_* config variable.

The observation about default gateway address may give interoperability problem with some devices, upgrading to a newer FW is recommended for this (please contact your ST dealer for getting the FW package).

Regards,

Elio