2014-07-07 12:45 PM
Hi,
1. I am using SOCKETS to make big file upload from my device from server. I have 2 questions:a) What is maximum buffer size in module for SOCKET? It seems about 1K. After it makes unstable in operationb) What is maximum speed of upload using sockets? I am acheaving 5-10 Kb/sec. It is too slow for me.I send 800 bytes in socket. Wait for OK. Then send next part. Sometimes I see delays/timeouts about 1.5s while awaiting ''OK'' from module. Or there is no OK at all. What's reason?FW version = 140128-caf4b79-SPWF01S2. I am single developer (not a company). My distributor ignored me. Can you push them to send me fresh FW? Compel, Saint-Petersburg, Russia. My mail dimitrybulkin@yandex.ru #wi-fi2014-07-12 02:26 PM
2014-07-13 12:05 PM
Ciao, Gerardo
Thanks for Phyton script. But result of using is the same to my experience with embeded.When I send small file ~2 kb to my server all is OK. When I send big file 500 kB I see that module go into some kind of fault and reset. Using embeded I can see some codes with info where fault happens. With Phyton I just see reset +WIND messages, no codes. It is possible to avoid fails if I send trough embeded with this algorythm:Open socketOpen fileIn cycle{Read file into buffer. Buffer must be not bigger than 450 bytesSend buffer with socketWait for OK response}But after sending about 2-10 kB speed reduces. Because OK responce will can be after 0,8...1.5 seconds. So problem is not in boudrate of UART/I am very interesred to send big files to my server. So now I will devide big files into 2KB blocks, but it is bad solution. Help me to understand problem. Or if it is problem of module I am ready to help you solve it with my colaboration. I am realy like your module comparing Digi, microchip and TI solutions.I am ready to give you:1. access to my web server for tests2. files I am sending 3. my sources an explain themBut not in forum because in files info how to acces to my server.2014-07-13 12:10 PM
2 kb file sending with phyton. File contains POST heads to get answer from my web server
C:\PROJECT\SPWF01S_shell>SPWF01S_shell.py+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SPWF01S Embedded Wifi Shell - SPG Application This PYTHON SOFTWARE was tested on Windows XP, Windows 7 and Linux Fedora Python ver. 2.7.3, pyserial 2.5 package+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Insert the ComPort (i.e. COM4 or /dev/ttyUSB0) which is connected the SPWF01S module: com3Insert the UART Baudrate of the module (i.e. 115200, 921600, ..): 230400HW Flow Control used <O for disabled, 1 for enabled>: 0The following serial port is opened: com3 SPWF01S is connected to the PC+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The available commands are: help -> shows the available shell commands network install -> saves OPEN, WEP, WPA/WPA2 config parameters and performs the connection miniap install -> saves MiniAP config parameters and starts the MiniAP mode -> sets the module operating mode (IDLE, STA, MINI AP) reset -> resets the module factory -> restores the factory default values of the config variables and reboots the module scan -> scans available Wifi networks readconf -> reads current module configuration parameters readvar -> reads a module parameter (see User Manual for the whole list) setvar -> saves a module parameter in NV memory and reboots readstat -> reads current module statistics peers -> returns the list and the statistics of devices connected to the module fwupdate -> performs an over-the-air firmware update fsupdate -> performs an over-the-air filesystem update (ext flash memory) fserase -> erases the content of the external flash memory webserver -> disable/enable the module's web server fsl -> lists the files stored in the module web server create file -> creates a file in the RAM memory and appends blocks of data fsp -> prints the contents of an existing file stored in the module web server fsd -> deletes an existing file (static files may not be deleted) ping -> sends a ping packet to the specified host httpget -> performs a single HTTP GET request to the named host and path httppost -> performs a post of the given path to the specified host radio -> enables/disables the wifi radio gpio control -> allows to configure, read or write a GPIO sockopen -> opens up to 8 TCP/UDP socket sockwrite -> allows to write data to socket sockquery -> returns the number of bytes of data waiting on socket sockread -> allows to read data from socket sockclose -> allows to close the socket powersave -> allows to enable the Power Save Mode sleep -> enables the Sleep Mode standby -> enables the Standby Mode active -> enables the Active Mode exit -> closes the application+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Enter your commands below.Insert ''exit'' to leave the application.Insert the name of the command (help=display the whole list, exit=close the APP): sockopenInsert the target host: [HIDDEN]Insert the TCP/UDP port: 80Insert the socket type <t for TCP | u for UDP>: t ID: 00OK++++++++++++++++++++++++++++++++++++++++++++++ If you see something like this: ID: 00 means that the socket 00 is correctly opened++++++++++++++++++++++++++++++++++++++++++++++Insert the name of the command (help=display the whole list, exit=close the APP): sockwriteInsert the file source <console|localfile>: localfileInsert the socket identifier <from 00 to 07>: 00Insert the filename (the file must be located in the same shell folder): small.datOK+WIND:55:Pending Data:0:390The data have been sent to the Socket ServerInsert the name of the command (help=display the whole list, exit=close the APP): sockreadInsert the socket identifier <from 00 to 07>: 00Choose an action <all=read all|len=bytes to read>: allHTTP/1.1 200 OKServer: nginx/1.6.0Date: Sun, 13 Jul 2014 18:35:32 GMTContent-Type: text/htmlContent-Length: 217Connection: keep-aliveX-Powered-By: PHP/5.3.28<FILENAME>forsend.dat</FILENAME><FILETYPE>text/plain</FILETYPE><UPLOADERROR>0</UPLOADERROR><TEMPRARYNAME>/var/tmp/php8ak0d6</TEMPRARYNAME><LENGTH>1558</LENGTH>OKInsert the name of the command (help=display the whole list, exit=close the APP): sockcloseInsert the socket identifier <from 00 to 07>: 00+WIND:58:Socket Closed:0ERROR: Illegal Socket IDInsert the name of the command (help=display the whole list, exit=close the APP):So my server answered:<FILENAME>forsend.dat</FILENAME><FILETYPE>text/plain</FILETYPE><UPLOADERROR>0</UPLOADERROR><TEMPRARYNAME>/var/tmp/php8ak0d6</TEMPRARYNAME><LENGTH>1558</LENGTH>All is ok. File is recieved without problems.2014-07-13 12:11 PM
Now I send 500 kb file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SPWF01S Embedded Wifi Shell - SPG Application This PYTHON SOFTWARE was tested on Windows XP, Windows 7 and Linux Fedora Python ver. 2.7.3, pyserial 2.5 package+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Insert the ComPort (i.e. COM4 or /dev/ttyUSB0) which is connected the SPWF01S module: COM3Insert the UART Baudrate of the module (i.e. 115200, 921600, ..): 230400HW Flow Control used <O for disabled, 1 for enabled>: 0The following serial port is opened: COM3 SPWF01S is connected to the PC+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The available commands are: help -> shows the available shell commands network install -> saves OPEN, WEP, WPA/WPA2 config parameters and performs the connection miniap install -> saves MiniAP config parameters and starts the MiniAP mode -> sets the module operating mode (IDLE, STA, MINI AP) reset -> resets the module factory -> restores the factory default values of the config variables and reboots the module scan -> scans available Wifi networks readconf -> reads current module configuration parameters readvar -> reads a module parameter (see User Manual for the whole list) setvar -> saves a module parameter in NV memory and reboots readstat -> reads current module statistics peers -> returns the list and the statistics of devices connected to the module fwupdate -> performs an over-the-air firmware update fsupdate -> performs an over-the-air filesystem update (ext flash memory) fserase -> erases the content of the external flash memory webserver -> disable/enable the module's web server fsl -> lists the files stored in the module web server create file -> creates a file in the RAM memory and appends blocks of data fsp -> prints the contents of an existing file stored in the module web server fsd -> deletes an existing file (static files may not be deleted) ping -> sends a ping packet to the specified host httpget -> performs a single HTTP GET request to the named host and path httppost -> performs a post of the given path to the specified host radio -> enables/disables the wifi radio gpio control -> allows to configure, read or write a GPIO sockopen -> opens up to 8 TCP/UDP socket sockwrite -> allows to write data to socket sockquery -> returns the number of bytes of data waiting on socket sockread -> allows to read data from socket sockclose -> allows to close the socket powersave -> allows to enable the Power Save Mode sleep -> enables the Sleep Mode standby -> enables the Standby Mode active -> enables the Active Mode exit -> closes the application+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Enter your commands below.Insert ''exit'' to leave the application.Insert the name of the command (help=display the whole list, exit=close the APP): sockopenInsert the target host: [HIDDEN]Insert the TCP/UDP port: 80Insert the socket type <t for TCP | u for UDP>: t ID: 00OK++++++++++++++++++++++++++++++++++++++++++++++ If you see something like this: ID: 00 means that the socket 00 is correctly opened++++++++++++++++++++++++++++++++++++++++++++++Insert the name of the command (help=display the whole list, exit=close the APP): sockwriteInsert the file source <console|localfile>: localfileInsert the socket identifier <from 00 to 07>: 00Insert the filename (the file must be located in the same shell folder): big.datOKERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: Command not foundERROR: CommaThe data have been sent to the Socket ServerInsert the name of the command (help=display the whole list, exit=close the APP): sockcloseInsert the socket identifier <from 00 to 07>: 00ERROR: Illegal Socket ID+WIND:32:WiFi Hardware Started+WIND:21:WiFi Scanning+WIND:35:WiFi Scan Complete (0x0)+WIND:19:WiFi Join:E0:2Insert the name of the command (help=display the whole list, exit=close the APP):2014-07-13 12:31 PM
Module was connected to usbe trough http://www.terraelectronica.ru/pdf/CHIP45/LITTLEUSB.pdf
Power is taken from DISCOVERY STM32F4 with 407 controller connected to USB trough miniusb (debuger)I have only suspection that DISCOVERY can't give enough power to send 500 kb file. Will make big capacitor in power circut and report you. But wifi module do not report that there is not enough power.So now if I send ~500 kb file with buffer 460 bytesI have low speed because of big delays to recieve OK from module. And mostly sending is OKAnd if I use 2048 bytes buffer I see... same. But few hours ago there are was messages about reboot! I made power off/on for module physicaly. Maybe that is reason. And remark: 2048 buffer is not faster than 460 bytes buffer. Firmware is 140512-complete - FW3.02014-07-15 02:54 AM
Hi,
now that setup is ok, you can use ST team for support: rf-support-emea@st.comthanksj2014-07-15 07:57 PM
Sorry
What do you mean whan write ''now that setup is ok,
''?2014-07-16 01:52 AM
You had right FW from Compel, and Python scripts too, so, you can now start evaluating SPWF01S features.
ST RF team offers technical support on WiFi module and related tools.ciaoj