cancel
Showing results for 
Search instead for 
Did you mean: 

SPWF01S Station connection problems

cbertrand
Associate II
Posted on December 17, 2014 at 10:35

Hi all,

I'm using the WiFi module to connect to infra WiFi in socket server mode.

The module return (through serial link) that connection to WiFi is OK.

But sometimes, in the WiFi router interface (a Freebox), the module is seen but stay in a not reachable status. At the end, it's not possible to send data to socket server. Even a ping to module address doesn't work.

Sometimes it works perfectly... for few hours and then back to unreachable.

SPWF01S output on startup :

+WIND:1:Poweron (141106-0950875-SPWF01S)

 

+WIND:13:ST SPWF01SA1 IWM: Copyright (c) 2012-2014 STMicroelectronics, Inc.  All rights Reserved.

 

+WIND:3:Watchdog Running

 

+WIND:0:Console active

 

+WIND:32:WiFi Hardware Started

 

+WIND:19:WiFi Join:F4:CA:E5:D3:65:34

 

+WIND:25:WiFi Association with 'freebox_EVB' successful

 

+WIND:51:WPA Handshake Complete

 

+WIND:24:WiFi Up:192.168.1.43

 

OK

 

The OK at the end is the answer of socket server start command :

AT+S.SOCKD=27024

My config config is :

# Dumping All Configuration Keys:

 

#  nv_manuf = ST

 

#  nv_model = SPWF01SA1

 

#  nv_serial = 4313D07237

 

#  nv_wifi_macaddr = 00:80:E1:FF:B5:14

 

#  blink_led = 0

 

#  wind_off_low = 0x00200000

 

#  wind_off_medium = 0x00000008

 

#  wind_off_high = 0x00000000

 

#  user_desc = IoTMesh

 

#  escape_seq = at+s.

 

#  localecho1 = 0

 

#  console1_speed = 115200

 

#  console1_hwfc = 0

 

#  console1_enabled = 1

 

#  sleep_enabled = 0

 

#  standby_enabled = 0

 

#  standby_time = 10

 

#  wifi_tx_msdu_lifetime = 0

 

#  wifi_rx_msdu_lifetime = 0

 

#  wifi_operational_mode = 0x00000011

 

#  wifi_beacon_wakeup = 1

 

#  wifi_beacon_interval = 100

 

#  wifi_listen_interval = 0

 

#  wifi_rts_threshold = 3000

 

#  wifi_ssid = 66:72:65:65:62:6F:78:5F:45:56:42:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

 

#  wifi_ssid_len = 11

 

#  wifi_channelnum = 6

 

#  wifi_opr_rate_mask = 0x00003FCF

 

#  wifi_bas_rate_mask = 0x0000000F

 

#  wifi_mode = 1

 

#  wifi_auth_type = 0

 

#  wifi_atim_window = 0

 

#  wifi_powersave = 0

 

#  wifi_tx_power = 18

 

#  wifi_rssi_thresh = 0

 

#  wifi_rssi_hyst = 0

 

#  wifi_ap_idle_timeout = 120

 

#  wifi_beacon_loss_thresh = 10

 

#  wifi_priv_mode = 2

 

#  wifi_wep_keys[0] = 49:6F:54:4D:65:73:68:30:30:38:30:45:31:00:00:00

 

#  wifi_wep_keys[1] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

 

#  wifi_wep_keys[2] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

 

#  wifi_wep_keys[3] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

 

#  wifi_wep_key_lens = 0D:00:00:00

 

#  wifi_wep_default_key = 0

 

#  wifi_wpa_psk_raw = XXX...

 

#  wifi_wpa_psk_text = XXX...

 

#  ip_use_dhcp = 0

 

#  ip_use_httpd = 1

 

#  ip_mtu = 1500

 

#  ip_hostname = GWM4_0080E1

 

#  ip_apdomainname = gwm4_iotmesh.net

 

#  ip_ipaddr = 192.168.1.51

 

#  ip_netmask = 255.255.255.0

 

#  ip_gw = 192.168.1.254

 

#  ip_dns = 192.168.1.254

 

#  ip_http_get_recv_timeout = 3000

 

#  ip_dhcp_timeout = 20

 

#  ip_sockd_timeout = 250

 

 

OK

 

I really don't understand why module is sometimes reachable and sometimes not.

Any ideas ?

Thanks.
16 REPLIES 16
cbertrand
Associate II
Posted on December 19, 2014 at 14:25

A kind of.

My normal configuration is the one posted at the beginning (connection to WiFi router in WPA-PSK -not WPA2- with auth_type set to OPEN even if no meaning in WPA as you wrote).

With this config, sometimes I can't get connection.

The test I made :

- power on SPWF01S

- getting connection up to WIND:24:WiFi Up (but no connection possible)

- I set the auth_type to SHARED, save the configuration and reset the module

- module restart and didn't get connection, loop in WIND:19:WiFi Join

- then, I set auth_type to OPEN

- the WIND:25:WiFi association is ok, WIND:51:WPA Handshake ok and WIND:24:WiFi Up ok.

- after that, module is no more greyed in my router webadmin page, ping is working and TCP socket connection also working.

I'm a little bit lost and it seems you are too ?

What I'm sure is changing auth_type in WPA mode has an impact on WiFi association!

cbertrand
Associate II
Posted on December 22, 2014 at 15:00

New information,

I changed my WiFi router security to WPA2-PSK AES.

Now, the connection always succeed !!

There is something really strange arround security setting.

akravchenko9
Associate II
Posted on January 04, 2015 at 22:14

Same problems...

Everything is fine until I did not use SoftPerfect Network Scanner (https://www.softperfect.com/). After using this software -- WiFi module is down from outside. I can ping my PC ( from the WiFi module), but I can not open WiFi module web page, I can not ping the WiFi module from the PC and so on...

https://www.softperfect.com/products/networkscanner/

Also could you please check DNS variable in case when WiFi module is working without DHCP (at+s.scfg=ip_use_dhcp,0) See post #3
Posted on January 07, 2015 at 11:20

Hi Artem,

if module is working without DHCP, you have to set IP, netmask, gateway and DNS addresses (by at+s.scfg command).

If DNS is not set, then Resolver1 of OpenDNS is used (http://en.wikipedia.org/wiki/OpenDNS)

j

akravchenko9
Associate II
Posted on January 07, 2015 at 11:39

I did it.

Compare with topic-starter, situation is similar in my case

You can look at post #1 and #3. IP, netmask, gateway and DNS was set, but after module boot and using AT command ( AT+S.STS ) I see that DNS address is different.

Posted on January 07, 2015 at 14:25

So, you did:

- at+s.scfg=ip_use_dhcp,0

- at+s.scfg=ip_ipaddr,A1

- at+s.scfg=ip_netmask,A2

- at+s.scfg=ip_gw,A3

- at+s.scfg=ip_dns,A4

- at&w

- at+cfun=1

...and after reboot, and wifi up message indication, you see:

- ''at+s.sts=ip_dns'' different from A4? openDNS address there?

akravchenko9
Associate II
Posted on January 07, 2015 at 15:11

============================

= Start module with DHCP

============================

at+cfun=1

+WIND:2:Reset

+WIND:1:Poweron (140805-3f58d6b-SPWF01S)

+WIND:13:ST SPWF01SA IWM: Copyright (c) 2012-2014 STMicroelectronics, Inc. All rights Reserved.

+WIND:3:Watchdog Running

+WIND:0:Console active

+WIND:32:WiFi Hardware Started

+WIND:21:WiFi Scanning

+WIND:35:WiFi Scan Complete (0x0)

+WIND:19:WiFi Join:6C:62:6D:24:99:4D

+WIND:25:WiFi Association with 'Unknow' successful

+WIND:51:WPA Handshake Complete

+WIND:24:WiFi Up:192.168.1.126

at&v

# Dumping All Configuration Keys:

# nv_manuf = ST

# nv_model = SPWF01SA

# nv_serial = 1613D28033

# nv_wifi_macaddr = 00:80:E1:FF:8D:10

# blink_led = 0

# wind_off_low = 0x00000000

# wind_off_medium = 0x00000000

# wind_off_high = 0x00000000

# user_desc = anonymous

# escape_seq = at+s.

# localecho1 = 1

# console1_speed = 115200

# console1_hwfc = 0

# console1_enabled = 1

# sleep_enabled = 0

# standby_enabled = 0

# standby_time = 10

# wifi_tx_msdu_lifetime = 0

# wifi_rx_msdu_lifetime = 0

# wifi_operational_mode = 0x00000011

# wifi_beacon_wakeup = 1

# wifi_beacon_interval = 100

# wifi_listen_interval = 0

# wifi_rts_threshold = 3000

# wifi_ssid = 55:6E:6B:6E:6F:77:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_ssid_len = 6

# wifi_channelnum = 6

# wifi_opr_rate_mask = 0x00003FCF

# wifi_bas_rate_mask = 0x0000000F

# wifi_mode = 1

# wifi_auth_type = 0

# wifi_atim_window = 0

# wifi_powersave = 0

# wifi_tx_power = 18

# wifi_rssi_thresh = 0

# wifi_rssi_hyst = 0

# wifi_ap_idle_timeout = 120

# wifi_beacon_loss_thresh = 10

# wifi_priv_mode = 2

# wifi_wep_keys[0] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_keys[1] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_keys[2] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_keys[3] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_key_lens = 00:00:00:00

# wifi_wep_default_key = 0

# wifi_wpa_psk_raw = 37:50:6B:84:D3:87:77:7D:24:6E:04:9F:86:AD:AB:65:FB:53:4B:1F:81:4D:A9:49:9C:C3:BA:B5:96:89:FD:D5

# wifi_wpa_psk_text = Gogo

# ip_use_dhcp = 1

# ip_use_httpd = 1

# ip_mtu = 1500

# ip_hostname = iwm-FF-8D-10

# ip_apdomainname = captiveportal.net

# ip_ipaddr = 192.168.1.8

# ip_netmask = 255.255.255.0

# ip_gw = 192.168.1.3

# ip_dns = 192.168.1.3

# ip_http_get_recv_timeout = 3000

# ip_dhcp_timeout = 20

OK

at+s.sts

# Status & Statistics:

# version = 140805-3f58d6b-SPWF01S

# reset_reason = 2

# conf_flag = 5

# system_uptime = 13

# system_sleeptime = 0

# gpio_enable = 0

# captiveportal = 0

# wifi_state = 10

# wifi_bssid = 6C:62:6D:24:99:4D

# wifi_aid = 2

# wifi_channelnum = 10

# wifi_sup_rate_mask = 0x003FFFCF

# wifi_bas_rate_mask = 0x0000000F

# wifi_chan_activity2 = 0x00003FFF

# wifi_max_tx_power = 18

# wifi_reg_country = GB

# wifi_dtim_period = 2

# wifi_sleeping = 1

# wifi_num_assoc = 0

# ip_ipaddr = 192.168.1.126

# ip_netmask = 255.255.255.0

# ip_gw = 192.168.1.3

# ip_dns = 192.168.1.3

# ip_sock_open = 0

# ip_sockd_port = 0

# free_heap = 24336

# min_heap = 24192

# current_time = 359

====================

=  at+s.scfg=ip_use_dhcp,0

====================

OK

at+s.scfg=ip_use_dhcp,0

OK

at&w

===========

= Start module without DHCP

===========

OK

at+cfun=1

+WIND:2:Reset

+WIND:1:Poweron (140805-3f58d6b-SPWF01S)

+WIND:13:ST SPWF01SA IWM: Copyright (c) 2012-2014 STMicroelectronics, Inc. All rights Reserved.

+WIND:3:Watchdog Running

+WIND:0:Console active

+WIND:32:WiFi Hardware Started

+WIND:21:WiFi Scanning

+WIND:35:WiFi Scan Complete (0x0)

+WIND:19:WiFi Join:6C:62:6D:24:99:4D

+WIND:25:WiFi Association with 'Unknow' successful

+WIND:51:WPA Handshake Complete

+WIND:24:WiFi Up:192.168.1.8

at+s.sts

# Status & Statistics:

# version = 140805-3f58d6b-SPWF01S

# reset_reason = 2

# conf_flag = 5

# system_uptime = 9

# system_sleeptime = 0

# gpio_enable = 0

# captiveportal = 0

# wifi_state = 10

# wifi_bssid = 6C:62:6D:24:99:4D

# wifi_aid = 2

# wifi_channelnum = 10

# wifi_sup_rate_mask = 0x003FFFCF

# wifi_bas_rate_mask = 0x0000000F

# wifi_chan_activity2 = 0x00003FFF

# wifi_max_tx_power = 18

# wifi_reg_country = GB

# wifi_dtim_period = 2

# wifi_sleeping = 1

# wifi_num_assoc = 0

# ip_ipaddr = 192.168.1.8

# ip_netmask = 255.255.255.0

# ip_gw = 192.168.1.3

# ip_dns = 208.67.222.222

# ip_sock_open = 0

# ip_sockd_port = 0

# free_heap = 24384

# min_heap = 24240

# current_time = 107

OK

at&v

# Dumping All Configuration Keys:

# nv_manuf = ST

# nv_model = SPWF01SA

# nv_serial = 1613D28033

# nv_wifi_macaddr = 00:80:E1:FF:8D:10

# blink_led = 0

# wind_off_low = 0x00000000

# wind_off_medium = 0x00000000

# wind_off_high = 0x00000000

# user_desc = anonymous

# escape_seq = at+s.

# localecho1 = 1

# console1_speed = 115200

# console1_hwfc = 0

# console1_enabled = 1

# sleep_enabled = 0

# standby_enabled = 0

# standby_time = 10

# wifi_tx_msdu_lifetime = 0

# wifi_rx_msdu_lifetime = 0

# wifi_operational_mode = 0x00000011

# wifi_beacon_wakeup = 1

# wifi_beacon_interval = 100

# wifi_listen_interval = 0

# wifi_rts_threshold = 3000

# wifi_ssid = 55:6E:6B:6E:6F:77:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_ssid_len = 6

# wifi_channelnum = 6

# wifi_opr_rate_mask = 0x00003FCF

# wifi_bas_rate_mask = 0x0000000F

# wifi_mode = 1

# wifi_auth_type = 0

# wifi_atim_window = 0

# wifi_powersave = 0

# wifi_tx_power = 18

# wifi_rssi_thresh = 0

# wifi_rssi_hyst = 0

# wifi_ap_idle_timeout = 120

# wifi_beacon_loss_thresh = 10

# wifi_priv_mode = 2

# wifi_wep_keys[0] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_keys[1] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_keys[2] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_keys[3] = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

# wifi_wep_key_lens = 00:00:00:00

# wifi_wep_default_key = 0

# wifi_wpa_psk_raw = 37:50:6B:84:D3:87:77:7D:24:6E:04:9F:86:AD:AB:65:FB:53:4B:1F:81:4D:A9:49:9C:C3:BA:B5:96:89:FD:D5

# wifi_wpa_psk_text = Gogo

# ip_use_dhcp = 0

# ip_use_httpd = 1

# ip_mtu = 1500

# ip_hostname = iwm-FF-8D-10

# ip_apdomainname = captiveportal.net

# ip_ipaddr = 192.168.1.8

# ip_netmask = 255.255.255.0

# ip_gw = 192.168.1.3

# ip_dns = 192.168.1.3

# ip_http_get_recv_timeout = 3000

# ip_dhcp_timeout = 20

OK