cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble connecting to a network (SPWF01SA module)

Matteo Pezzoli
Associate II
Posted on February 23, 2017 at 11:07

Hi,

Using the SPWF01SA module, i managed to connect to all of the networks i found here, except one. I probably got the configuration wrong, but i can't find where's the error. To my knoweledge, the only difference this network has from the other networks (to which i can succesfuly connect) is that it gives out ips in the 0.x range, instead of the usual 0.x one.

I tried disabling the dhcp and assigning the gateway ip and dns ip manually, also setting a static ip (i used 50 or something like that), to no avail.

I should also mention that both my laptop and phone can connect to this network without problem.

Here's the configuration i am using:

# Dumping All Configuration Keys:

# nv_manuf = ST

# nv_model = SPWF01SA1

# nv_serial = 3514D04763

# nv_wifi_macaddr = 00:80:E1:B4:7D:1F

# blink_led = 0

# wind_off_low = 0x00000000

# wind_off_medium = 0x00000000

# wind_off_high = 0x00000000

# user_desc = anonymous

# 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 = 53:4D:45: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:00:00:00

# wifi_ssid_len = 3

# 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 = 34:2D:CC:99:D8:94:02:46:75:25:75:E2:E9:6D:F9:5C:AF:C5:A8:B2:F3:26:7C:4E:4F:14:67:2A:88:F9:09:85

# wifi_wpa_psk_text = ywifi_sap

# ip_use_dhcp = 1

# ip_use_httpd = 1

# ip_mtu = 1500

# ip_hostname = iwm-B4-7D-1F

# ip_apdomainname = captiveportal.net

# ip_ipaddr = 0.50

# ip_netmask = 0

# ip_gw = 0.1

# ip_dns = 0.1

# ip_http_get_recv_timeout = 3000

# ip_dhcp_timeout = 20

# ip_sockd_timeout = 250

OK

Thank you

Matteo

#spwf01sa #wifi

Note: this post was migrated and contained many threaded conversations, some content may be missing.
9 REPLIES 9
Posted on February 23, 2017 at 12:09

Ciao Matteo,

which WINDs are on console?

- If problem on DHCP, module will reach association and (after 20 seconds) disassociation and scan again;

- if AP is in n-only mode, enable them on module also;

- Il AP is not broadcasting SSID, change wifi_region on module.

Matteo Pezzoli
Associate II
Posted on February 24, 2017 at 14:55

Hi Gerardo,

According to your explaination, i'd say that the problem is the DHCP. The WINDs on the console are:

+WIND:21:WiFi Scanning

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

+WIND:19:WiFi Join:00:1B:2F:A5:5B:6C

This three messages keeps repeating, always the same. I tried again to disable the dhcp, using these settings:

#  ip_use_dhcp = 0

#  ip_ipaddr = 10.20.0.50

#  ip_netmask = 255.255.255.0

#  ip_gw = 10.20.0.254

#  ip_dns = 10.20.0.254

and i also tried to set the dns to the google public one:

#  ip_use_dhcp = 0

#  ip_ipaddr = 10.20.0.50

#  ip_netmask = 255.255.255.0

#  ip_gw = 10.20.0.254

#  ip_dns = 8.8.8.8

Both these configurations don't seem to work. Am i doing something wrong here?

Thank you for your time,

Matteo

Posted on February 24, 2017 at 21:25

Ciao Matteo,

it's not a DHCP issue. Module never reach association/authentication with AP, so, TCP/IP never runs.

Scan is OK (so, AP is found). What seems not working is the authentication. Module sends authentication requests, but never receives an authentication response.

Which FW version are you using? I expect WIND:75...78 if something goes wrong during authentication/association stage. Can you please use wireshark to dump frames over the air?

Can you please also run a test without security on AP? Set wifi_priv_mode = 0 on module.

Another check: which RSSI to reach that AP? Try this way:

- turn off wifi (AT+S.WIFI=0)

- change mode to idle (AT+S.SCFG=wifi_mode,0) ---> we need this step since cannot scan while module is already scanning or joining

- turn on wifi (AT+S.WIFI=0)

- after WIND:32, scan (AT+S.SCAN)

Thanks for tests

jerry

Posted on February 27, 2017 at 11:40

Hi Jerry,

Sorry for the late response. Regarding the FW version, is the one showed at startup? if so, this should be it:

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

I have never seen WINDs75-78 unfortunately; i only see the three i already told you about (21,35,19). I tried using wireshark (disclaimer: i'm not really that good at using it) filtering the module mac address. I tried this test both using the PC disconnected from the network, hoping to receive some kind of boadcast packets, and also with the PC  connected to the network; both these test found no packets. If you could tell me what you're searching for, i could try to find it in the wireshark dump.

Regarding the test with no security on the AP: i am not the admin of the network, meaning that i don't have access to the configuration, but i guess i could request the user/pass if i really need them. If you feel this test is important, i'll ask and try this test too.

Lastly, regarding the RSSI test: i didn't manage to get it done; turning on wifi while the module is idle doesn't seem to get the hardware starting, meaning that i never see the WIND:32. If i exit the idle mode, and then start the wifi, the module starts his scan automatically. I should also mention that i don't think this is the problem given that i'm literally 2 meters away from the router,and i managed to connect to networks with far weaker signals.

Also, just to be thorough, i should tell that i am using the eval board (STEVAL-IDW001V1), sending commands to the module via UART, using a discovery board that mounts a stm32f407 microcontroller.

Again, thank you for your time

Matteo

Posted on February 27, 2017 at 12:01

Ciao Matteo,

you are using a very very old FW release. It's 3.3. Please update to latest release 3.5 as soon as possible.

WINDs 75 to 78 belongs to releases >= 3.4.

j

Posted on February 27, 2017 at 14:18

Hi Jerry,

I'm not sure if i should create a new post for this, so i'll go ahead and ask it here. I tried updating the FW with the FOTA method (apache sever and whatnot) to the 3.5 release. Unfortunately, i encountered an error:

+WIND:17:Aborting F/W update because of bad CRC found

I also tried the 3.4 version, same error. I used the firmware found here

https://my.st.com/content/my_st_com/en/products/embedded-software/wireless-connectivity-software/stsw-wifi001.license%3d1488195749221.html

Matteo

Posted on February 27, 2017 at 20:24

Ciao Matteo,

can you use uart update at this stage? After moved to 3.5 try again the fota. Since fw is very very old, I don't know if CRC fails because download went wrong (fota from 3.5 on will work), or boot application fails check (an updated boot is required). Option &sharp3: flash is not sane, but this is not so common.

Use batch script, or flash loader demonstrator (0x08002800 is the starting address)

Posted on February 28, 2017 at 18:05

Hi again Jerry,

Unfortunately i don't have a USB to UART bridge (i am trying to get one tho), so i tried the FW upgrade procedure by setting the boot0 so high and sending the binary firmware file over the UART manually (i loaded the file on my microcontroller flash, and sent it from there 8 bytes at a time). Not so surprisingly, this doesen't work; is there anything that has to be sent to the module prior to the actual bin file? I ask this out of curiosity, since i'll probably update the firmware using the script once i get the usb to uart bridge.

Also, another quick question, since you have been so kind to bear with me so far: do all the modules ship with the 3.3 firmware version? I don't mind making an update over the air, but if i have to do it using the usb for each module, that would be a little bit of a nuisance.

Thanks again.

Matteo

Posted on February 28, 2017 at 18:25

Ciao Matteo,

here (

https://sourceforge.net/projects/stm32flash/

) an opensource project for STM32 upgrade via internal bootloader.

ST ships module to distributors using the state of the art FW. Currently, FW3.5.3 (minor changes on FW3.5 available on st.com website).

You got your your old release based on distributor's stock.

Waiting for serial bridge, did you already try to use another webserver for OTA?