cancel
Showing results for 
Search instead for 
Did you mean: 

SPWF04SA problem with miniAP actication

Konstantinos Ifantidis
Associate II
Posted on December 18, 2017 at 09:15

Hello there!

I would like to ask what i'm doing wrong in activating the miniAP with my SPWF04SA. I've read SPWF04SA's datasheet, UM2114, AN4964 and most of ''WiFi Training Hands on SPWF04SA module'' pdf. I have 2-3 modules IDW04A1 and a couple NUCLEO-L053R8 boards. In the beginning i just grabbed a USB to Serial converter (FTDI) and used it to communicate with the IDW04A1 module. After communication was OK, i downloaded ''Flash Loader Demonstrator'' version 2.8 and updated via UART SPWF04SA's firmware. The firmware installed is ''SPWF04S-171117-0328fe3-Release.hex''. In the STSW_WIFI004 folder i saw ''SPWF04S-171117-0328fe3-Full.hex'' file. Is this file the same as ''SPWF04S-171117-0328fe3-Release.hex'' ?? (Anyway i haven't tried this one yet).

Next i tried some basic commands and some python scripting with AT commands and usb2serial converter setup and everything worked. But when i tried to setup a miniAP, it didn't work out at all. After many tries, resets, and factory default resets I hooked up IDW04A1 on NUCLEO-L053R8 board and miniAP mode worked with first try. After 10 minutes of celebrating of my success i decided to switch again to my humble usb2serial converter. The module responded that it had started the miniAP but my smartphone and laptop weren't able to find my miniAP. I would like to mention also that i have used the module in 9600 and in 115200 baud rates. I have attached photos with the setups that i have used. And the code for setting the miniAP which was the same for every setup that I've used.

Code:

AT+S.SCFG=console_enabled,2<CR> // I used thisone because i wanted to experiment with uP after setting the miniAP. (I think console_enabled,2 doesn't affect the miniAP feature)

AT+S.WIFI=0<CR>

AT+S.SSIDTXT=SP_DemoAP<CR>

AT+S.SCFG=wifi_mode,3<CR>

AT+S.SCFG=wifi_priv_mode,0<CR>

AT+S.WCFG<CR>

AT+S.WIFI=1<CR>

AT<CR>

AT+S.WCFG<CR> // I saved Configs in order to save WIFI=1 configuration in order after every reset the module to enter in miniAP mode.

Those are the AT commands that i have used in both setups via my PC serial terminal.

0690X00000604LrQAI.jpg0690X00000604MPQAY.jpg0690X00000604GXQAY.jpg

I'm adding the following text files. They are the Serial comm with the module after resetting to factory default configurations with AT+S.FCFG<CR> command. Also I've added the configuration and status lists which I've generated right after the ''SPWF04SA SERIAL RESPONSE''.

To summarize:

I would like to know which FW I've to install. (''SPWF04S-171117-0328fe3-Release.hex'' or ''SPWF04S-171117-0328fe3-Full.hex'')

Is there any other configuration that NUCLEO-L053R8 FW sets up for the SPWF04SA that I haven't  ?!

I want to achieve this:

1) software checks (hw pin) whether is can run business as usual or start-up in the configuration mode

2) If Business as usual nothing special; use uP example code

3) If configuration mode:

  Start SPWF04SA access-point and launch web-page showing the existing SSID, password and authorisation code. Modify these values and store the values in FLASH or in EEPROM

4) Reset and go all over again.

Best regards, K.Ifantidis.

#miniap #access-point #spwf04 #password #uart-set-up #uart #ssid #problem #usart
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on December 18, 2017 at 12:23

The statement 'your system is running low on memory' must be read 'your system is running low on system RAM memory' (the one shown by free_heap status var; min_heap show the absolute min reached by system RAM memory)

I suggested to decrease the amount of ramdisk_memsize and python_memsize because both of them are allocated in system RAM.

ram disk (disk '3' or 'D') size is defined by ramdisk_memsize cfg var, and consume about twice that value from system RAM: if your application can work with a smaller ramdisk then you can set ramdisk_memsize to a smaller value (0 disable the ramdisk at all, 2 is the suggested minimum when the network scan is performed from python).

The same way, when uPython is enabled an amount equal to python_memsize is allocated from system RAM at boot time. This memory space is used for uPython stack, application and structure, while the memory used by TCP/IP stack is still allocated in system RAM even when python sockets/wsocket/mqtt/http modules are used. The free/used python memory can be displayed by specific python functions (i.e. gc.mem_free, gc.mem_alloc): you can reduce python_memsize accordingly and free system RAM resources.

In your case AT+S.FSL show only file with 'I' prefix. Those files are stored in the Application Flash disk and do not consume system RAM.

Setting ramdisk_memsize=12 and python_memsize=32 should allow running Open MiniAP: try keeping SW2 pressed while resetting IDW04A1 to boot SPWF04 in Open MiniAP and verify the configuration is ok (+WIND:26:Started AP:iwm-BD-D1-7A should be displayed for your IDW04A1).

About your question 'I would like to know which FW I've to install. ('SPWF04S-171117-0328fe3-Release.hex' or 'SPWF04S-171117-0328fe3-Full.hex')':

- SPWF04S-171117-0328fe3-Release.hex only contain the SPWF04's FW

- SPWF04S-171117-0328fe3-Full.hex contain bootloader+FW+default application flash disk

You can also use the following post as further source of information.

View solution in original post

5 REPLIES 5
Elio Cometti
Senior II
Posted on December 18, 2017 at 10:14

Hi Konstantinos,

your system is running low on memory:

AT-S.Var:free_heap=6848

AT-S.Var:min_heap=80

I suggest to reduce the amount of ramdisk_memsize and python_memsize, according to your needs

Konstantinos Ifantidis
Associate II
Posted on December 18, 2017 at 11:35

Also i would like to add the response of the module when connecting with NUCLEO-L053R8

________________

Attachments :

SPWF04SA SERIAL RESPONSE - NUCLEO-L053R8.txt.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hy8z&d=%2Fa%2F0X0000000b4v%2F97OlaicmMp3kKtHKhFf_jxvmFdWp7GK.c8kIomC0HcA&asPdf=false
Posted on December 18, 2017 at 10:40

Hello Elio.

I'm still learning how to handle this board. And i haven't figured out yet how to manage with the memory.

Shall i delete some files from the FS, is that what you mean? I have the defaults installed there:

AT+S.FSL

AT-S.Free RAM Disk:15360

AT-S.File:I 4281 config.fhtml

AT-S.File:I 676 favicon.gz.ico

AT-S.File:I 697 firstset.gz.html

AT-S.File:I 401 index.gz.html

AT-S.File:I 252 input_demo.fhtml

AT-S.File:I 432 MULTI_CLIENT_SERVER.py

AT-S.File:I 290 output_demo.gz.html

AT-S.File:I 1719 peers.fhtml

AT-S.File:I 894 remote.gz.html

AT-S.File:I 2390 RL_TCP_CL.py

AT-S.File:I 2689 RL_TCP_SE.py

AT-S.File:I 2696 RL_TCP_SE_GC_COLLECT.py

AT-S.File:I 2360 RL_UDP_CL.py

AT-S.File:I 2688 RL_UDP_SE.py

AT-S.File:I 1768 status.fhtml

AT-S.File:I 4134 stlogo.gz.jpg

AT-S.File:I 897 WLAN.py

AT-S.File:I 1024 WLAN.STA.py

AT-S.OK

And an other question I have is: What are the Critical Files for my SPWF04SA in the FS ? Do i need all of those files or just 2-3 of them?

Regards, K.Ifantidis.

Posted on December 18, 2017 at 12:23

The statement 'your system is running low on memory' must be read 'your system is running low on system RAM memory' (the one shown by free_heap status var; min_heap show the absolute min reached by system RAM memory)

I suggested to decrease the amount of ramdisk_memsize and python_memsize because both of them are allocated in system RAM.

ram disk (disk '3' or 'D') size is defined by ramdisk_memsize cfg var, and consume about twice that value from system RAM: if your application can work with a smaller ramdisk then you can set ramdisk_memsize to a smaller value (0 disable the ramdisk at all, 2 is the suggested minimum when the network scan is performed from python).

The same way, when uPython is enabled an amount equal to python_memsize is allocated from system RAM at boot time. This memory space is used for uPython stack, application and structure, while the memory used by TCP/IP stack is still allocated in system RAM even when python sockets/wsocket/mqtt/http modules are used. The free/used python memory can be displayed by specific python functions (i.e. gc.mem_free, gc.mem_alloc): you can reduce python_memsize accordingly and free system RAM resources.

In your case AT+S.FSL show only file with 'I' prefix. Those files are stored in the Application Flash disk and do not consume system RAM.

Setting ramdisk_memsize=12 and python_memsize=32 should allow running Open MiniAP: try keeping SW2 pressed while resetting IDW04A1 to boot SPWF04 in Open MiniAP and verify the configuration is ok (+WIND:26:Started AP:iwm-BD-D1-7A should be displayed for your IDW04A1).

About your question 'I would like to know which FW I've to install. ('SPWF04S-171117-0328fe3-Release.hex' or 'SPWF04S-171117-0328fe3-Full.hex')':

- SPWF04S-171117-0328fe3-Release.hex only contain the SPWF04's FW

- SPWF04S-171117-0328fe3-Full.hex contain bootloader+FW+default application flash disk

You can also use the following post as further source of information.

Posted on December 18, 2017 at 12:28

I think X-CUBE-WIFI1 actually restore the factory configuration (uPython disabled) before setting the new configuration.