cancel
Showing results for 
Search instead for 
Did you mean: 

WF update. Socket speed

dimitrybulkin
Associate II
Posted on July 07, 2014 at 21:45

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 operation

b) 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-SPWF01S

2. 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-fi
17 REPLIES 17
dimitrybulkin
Associate II
Posted on July 12, 2014 at 23:26

Why SOCKOS is depricated? I was going to use SOCKET as USART...

dimitrybulkin
Associate II
Posted on July 13, 2014 at 21:05

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 socket

Open file

In cycle{

Read file into buffer. Buffer must be not bigger than 450 bytes

Send buffer with socket

Wait 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 tests

2. files I am sending 

3. my sources an explain them

But not in forum because in files info how to acces to my server.

dimitrybulkin
Associate II
Posted on July 13, 2014 at 21:10

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 mo

dule: com3

Insert the UART Baudrate of the module (i.e. 115200, 921600, ..): 230400

HW Flow Control used <O for disabled, 1 for enabled>: 0

The 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 rebo

ots 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)

: sockopen

Insert the target host: [HIDDEN]

Insert the TCP/UDP port: 80

Insert the socket type <t for TCP | u for UDP>: t

 ID: 00

OK

++++++++++++++++++++++++++++++++++++++++++++++

 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)

: sockwrite

Insert the file source <console|localfile>: localfile

Insert the socket identifier <from 00 to 07>: 00

Insert the filename (the file must be located in the same shell folder): small.d

at

OK

+WIND:55:Pending Data:0:390

The data have been sent to the Socket Server

Insert the name of the command (help=display the whole list, exit=close the APP)

: sockread

Insert the socket identifier <from 00 to 07>: 00

Choose an action <all=read all|len=bytes to read>: all

HTTP/1.1 200 OK

Server: nginx/1.6.0

Date: Sun, 13 Jul 2014 18:35:32 GMT

Content-Type: text/html

Content-Length: 217

Connection: keep-alive

X-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>

OK

Insert the name of the command (help=display the whole list, exit=close the APP)

: sockclose

Insert the socket identifier <from 00 to 07>: 00

+WIND:58:Socket Closed:0

ERROR: Illegal Socket ID

Insert 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.

dimitrybulkin
Associate II
Posted on July 13, 2014 at 21:11

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 mo

dule: COM3

Insert the UART Baudrate of the module (i.e. 115200, 921600, ..): 230400

HW Flow Control used <O for disabled, 1 for enabled>: 0

The 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 rebo

ots 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)

: sockopen

Insert the target host: [HIDDEN]

Insert the TCP/UDP port: 80

Insert the socket type <t for TCP | u for UDP>: t

 ID: 00

OK

++++++++++++++++++++++++++++++++++++++++++++++

 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)

: sockwrite

Insert the file source <console|localfile>: localfile

Insert the socket identifier <from 00 to 07>: 00

Insert the filename (the file must be located in the same shell folder): big.dat

OK

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Command not found

ERROR: Comma

The data have been sent to the Socket Server

Insert the name of the command (help=display the whole list, exit=close the APP)

: sockclose

Insert the socket identifier <from 00 to 07>: 00

ERROR: Illegal Socket ID

+WIND:32:WiFi Hardware Started

+WIND:21:WiFi Scanning

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

+WIND:19:WiFi Join:E0:2

Insert the name of the command (help=display the whole list, exit=close the APP)

:

dimitrybulkin
Associate II
Posted on July 13, 2014 at 21:31

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 bytes

I have low speed because of big delays to recieve OK from module. And mostly sending is OK

And 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.0

Posted on July 15, 2014 at 11:54

Hi,

now that setup is ok, you can use ST team for support: rf-support-emea@st.com

thanks

j

dimitrybulkin
Associate II
Posted on July 16, 2014 at 04:57

Sorry

What do you mean whan write ''

now that setup is ok,

''?

Posted on July 16, 2014 at 10:52

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.

ciao

j