Skip to main content
Matti Sillanpaa
Associate III
April 26, 2017
Question

Sending large amounts of data over SPWF01SA

  • April 26, 2017
  • 5 replies
  • 932 views
Posted on April 26, 2017 at 14:51

Hi.

So I'm trying to send large amount of data to server (~200kB). I can send and receive smallish amounts ok (<2k), however at 3k the send fails. I'm sending data in 1000byte blobs to respect the 1021byte limit in the socket code.

I've added delays and tried smaller sends also, but no luck so far. I coudn't find any applicaple callback to syncronize fe 2k transfers.

How should I handle this sort of situation?

+WIND:1:Poweron (170111-665d284-SPWF01S)

+WIND:13:ST SPWF01SA1 IWM: Copyright (c) 2012-2016 STMicroelectronics, Inc. Al.

+WIND:3:Watchdog Running

+WIND:0:Console active

+WIND:32:WiFi Hardware Started

+WIND:2:Reset

+WIND:1:Poweron (170111-665d284-SPWF01S)

+WIND:13:ST SPWF01SA1 IWM: Copyright (c) 2012-2016 STMicroelectronics, Inc. Al.

+WIND:3:Watchdog Running

+WIND:0:Console active

+WIND:46:WPA: Crunching PSK...

+WIND:32:WiFi Hardware Started

+WIND:21:WiFi Scanning

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

+WIND:19:WiFi Join:xx.xx.xx.xx.xx.xx

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

+WIND:51:WPA Handshake Complete

+WIND:24:WiFi Up:192.168.0.100

>>Socket Open OK

>>Socket ID: 0

Writing 1000 bytes to socket, left 128825

<<OK

>>Socket Write OK

Writing 1000 bytes to socket, left 127825

<<OK

>>Socket Write OK

Writing 1000 bytes to socket, left 126825

>>Socket Write FAIL

+WIND:55:Pending Data:0:ENC

+WIND:58:Socket Closed:0

Reached SockON_Data_Length

Data Receive Callback...

AT+S.SOCKR=0,313

HTTP/1.1 400 Bad Request

Server: Server

Date: Wed, 26 Apr 2017 12:29:29 GMT

Content-Type: text/html

Content-Length: 167

Connection: close

As the server reponds with the bad request something is sent.

This topic has been closed for replies.

5 replies

Mridupawan Das
Visitor II
April 27, 2017
Posted on April 27, 2017 at 08:11

seems like Socket Write has failed for some reason.

Currently all the 'Error' reasons are not decoded in the firmware to give a clearer picture.

Is it possible for you to check in wifi_module_uart_01.c, the function Process_Buffer(), the condition:

else if((((strstr((const char *)process_buffer,'ERROR'))) != NULL))

You can maybe debug this part to understand and see the process_buffer variable to check what is the description of the ERROR. If there is a description, then it would be more clearer.

Matti Sillanpaa
Associate III
April 27, 2017
Posted on April 27, 2017 at 09:22

Hmm... This might be problem with my data.

' Details:'AT+S.SOCKW=0,1000\r\n\r\nERROR: Server closed during data sending\r\n', '\0' <repeats 448 times>'

Gerardo GALLUCCI
ST Employee
May 3, 2017
Posted on May 03, 2017 at 19:21

Module allows sockw up to 4kb in length.