cancel
Showing results for 
Search instead for 
Did you mean: 

SPWF04 File print Not Responding

brianshankland9
Associate II
Posted on March 28, 2018 at 17:00

I have been able to use the File Print (AT+S.FSP) in some test situations, but now that I'm using it for real I'm not getting any results.

When I was performing my feasibility tests I was printing sections from within a small text file located in the Application volume.

When i try to do a similar task with a large text or binary file that is on the User Volume the command just hangs with no reply.

I can see from the FSL command that the file is present with the 'E' prefix indicating user volume.

Interestingly the AT+S.FSP command when echoed back is not terminated with 0x0D 0x0A as I would have expected (from seeing other command replied) but with 0x0D 0x00

The binary file is 173Kb in size and the text file was 486Kb in case there is a file limit issue with the command.

The command content I was sending was  AT+S.FSP=/firmware.hex,0,256

It does not matter if I try to list the entire file using 

AT+S.FSP=/firmware.hex,, as this also fails in the same manner.

So is there a known issue with either file size, or using the user flash space with the FSP command?

10 REPLIES 10
Elio Cometti
Senior II
Posted on March 28, 2018 at 17:42

Hello,

could you please report the string printed in +WIND:1:Poweron:...  ?

Thanks

brianshankland9
Associate II
Posted on March 28, 2018 at 18:06

Hello,

Yes I've upgraded the device to Firmware V1.1.0 so the Wind1 message contents is:

Poweron:171117-0328fe3-SPWF04S

Firmware was upgraded using fota with file 'SPWF04S-171117-0328fe3-Release.fota'.

I can get console debug from uVision for all messages if needed.

brianshankland9
Associate II
Posted on March 28, 2018 at 18:16

Tomorrow I'm going to try and put the small text file onto the user flash to see if it can still be read and hopefully eliminate one unknown factor.

Posted on March 28, 2018 at 18:53

There are not known issue with either file size or using any disk volume with the FSP command.

Actually, I just did a test printing a 17MB bin file from SD card and a 400K bin file from user volume.

Anyway, should you confirm the behavior, please give more details about your use case.

brianshankland9
Associate II
Posted on March 29, 2018 at 10:35

Thanks for doing these tests for me.

When you read your files were you reading the entire file or in chunks, if in chunks what size did you use?

I'll continue with my investigation today and update with any findings.

This is the log for what I'm doing, for clarity I've removed by apps state other than bullet markers relating to stages for the module setup. I'm using the UART interface so all test returned is prefixed with 'SPWF04: ' in the log non printable characters are in hex within square brackets. 

Waiting for WiFi text...

SPWF04: 39:+WIND:1:Poweron:171117-0328fe3-SPWF04S[0D]

SPWF04: 88:+WIND:13:Copyright (c) 2012-2017 STMicroelectronics, Inc. All rights Reserved:SPWF04SA[0D]

SPWF04: 23:+WIND:0:Console active[0D]

Console active - can start to talk to module

SPWF04: 28:+WIND:3:Watchdog Running:20[0D]

SPWF04: 26:AT+S.GCFG=nv_wifi_macaddr[0D]

SPWF04: 43:AT-S.Var:nv_wifi_macaddr=00:80:E1:BD:F7:57[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 20:AT+S.STS=fw_version[0D]

SPWF04: 26:AT-S.Var:fw_version=1.1.0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 31:+WIND:32:WiFi Hardware Started[0D]

Disable WiFi for configuration

SPWF04: 12:AT+S.WIFI=0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 26:+WIND:49:WPA Terminated:0[0D]

SPWF04: 27:+WIND:38:WiFi Powered Down[0D]

WiFi Disabled - ready for configuration

SPWF04: 21:AT+S.SSIDTXT=IconLab[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 37:AT+S.SCFG=wifi_wpa_psk_text,NULLNULL[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 27:AT+S.SCFG=wifi_priv_mode,0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 27:AT+S.SCFG=wifi_auth_type,0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 22:AT+S.SCFG=wifi_mode,1[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 25:AT+S.SCFG=ip_use_dhcpc,1[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 35:AT+S.SCFG=ip_ipaddr,192.168.101.42[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 35:AT+S.SCFG=ip_netmask,255.255.255.0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 30:AT+S.SCFG=ip_gw,192.168.101.1[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 22:AT+S.SCFG=ip_use_v6,0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 26:AT+S.SCFG=sleep_enabled,1[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 28:AT+S.SCFG=standby_enabled,0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 27:AT+S.SCFG=wifi_powersave,2[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 35:AT+S.SCFG=wifi_operational_mode,11[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 33:AT+S.SCFG=wifi_listen_interval,0[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 31:AT+S.SCFG=wifi_beacon_wakeup,1[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 12:AT+S.WIFI=1[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 31:+WIND:32:WiFi Hardware Started[0D]

WiFi configured and ready

SPWF04: 37:+WIND:19:WiFi Join:00:1B:2F:AE:FA:7F[0D]

SPWF04: 45:+WIND:25:WiFi Association successful:IconLab[0D]

SPWF04: 33:+WIND:51:WiFi Handshake Complete[0D]

SPWF04: 34:+WIND:24:WiFi Up:0:192.168.101.36[0D]

Network established

SPWF04: 26:+WIND:66:Low Power mode:2[0D]

SPWF04: 9:AT+S.FSL[0D]

SPWF04: 25:AT-S.Free RAM Disk:15360[0D]

SPWF04: 26:AT-S.Free EXT Disk:476160[0D]

SPWF04: 27:AT-S.File:E[09]0[09]contents.txt[0D]

SPWF04: 31:AT-S.File:E[09]486826[09]WiVib-Q.hex[0D]

SPWF04: 28:AT-S.File:I[09]766[09]favicon.ico[0D]

SPWF04: 31:AT-S.File:I[09]3907[09]firstset.html[0D]

SPWF04: 29:AT-S.File:I[09]0[09]FS_VER_002.txt[0D]

SPWF04: 28:AT-S.File:I[09]3908[09]index.html[0D]

SPWF04: 32:AT-S.File:I[09]12087[09]wiviblogo.jpg[0D]

SPWF04: 8:AT-S.OK[0D]

SPWF04: 28:AT+S.FSP=/WiVib-Q.hex,0,256[0D]

brianshankland9
Associate II
Posted on March 29, 2018 at 10:54

I have just run the test I mentioned yesterday.

I put the same text file contents under different names into the Application and user volumes.

With the command 

For the file on the application volume i get this:

SPWF04: 30:AT+S.FSP=/firstset.html,0,128[0D]

Reading Binary 0 128

WIFIModule_ProcessData:128

0A 41 54 2D 53 2E 46 72 65 65 20 52 41 4D 20 44 69 73 6B 3A 31 35 33 36 30 0D 0A

41 54 2D 53 2E 46 72 65 65 20 45 58 54 20 44 69 73 6B 3A 34 37 32 30 36 34 0D 0

A 41 54 2D 53 2E 46 69 6C 65 3A 45 09 30 09 63 6F 6E 74 65 6E 74 73 2E 74 78 74

0D 0A 41 54 2D 53 2E 46 69 6C 65 3A 45 09 33 39 30 37 09 63 6F 70 79 70 61 67 65

2E 68 74 6D 6C 0D 0A 41 54 2D 53 2E 46 69 6C 65 3A 45 09 34 38

SPWF04: 8:AT-S.OK[0D]

For the file on the user volume i get this:

SPWF04: 30:AT+S.FSP=/copypage.html,0,128[0D]

Reading Binary 0 128

and then it hangs while it looks for 128 characters that don't arrive.

Is there some special format for the filename depending on which volume it is located. All the examples I've seen append '/' to the start which I've taken was just to ensure it was from root, but does the user volume need a different prefix?

brianshankland9
Associate II
Posted on March 29, 2018 at 11:52

Possibly a breakthrough, although still not a solution yet:

I may have been masking some evidence that would not have been shown in my earlier logs.

I had previously seen that I was getting a null character returned at times int SPWF04 text which was causing parsing issues so I changed my text processing to ignore NULL and LF from the returning text stream (but not when returning binary file data).

When I removed this the logs shows an issue after I perform the AT+S.FSL command. For space I will remove all but the last few returned filenames from teh FSL command:

Unaltered firmware:

SPWF04: 29:AT-S.File:I[09]3908[09]index.html[0D][0A]

SPWF04: 33:AT-S.File:I[09]12087[09]wiviblogo.jpg[0D][0A]

SPWF04: 9:AT-S.OK[0D][0A]

SPWF04: 32:[00]AT+S.FSP=/copypage.html,0,128[0D][0A]

SPWF04: 32:AT-S.ERROR:1:Command not found[0D][0A]

I checked that I was not posting the null and then for completeness stopped sending commands after the FSl to see what happens:

SPWF04: 29:AT-S.File:I[09]3908[09]index.html[0D][0A]

SPWF04: 33:AT-S.File:I[09]12087[09]wiviblogo.jpg[0D][0A]

SPWF04: 9:AT-S.OK[0D][0A]

SPWF04: 51:[00]+WIND:84:NTP Server delivery:2018.3.29:4:9.37.12[0D][0A]

So the NULL was not being sent and echoed back it was on the receive stream.

I then thought maybe I'm doing something wrong in my receive so I removed the FSL command:

SPWF04: 35:+WIND:24:WiFi Up:0:192.168.101.36[0D][0A]

Network established

SPWF04: 27:+WIND:66:Low Power mode:2[0D][0A]

SPWF04: 31:AT+S.FSP=/copypage.html,0,128[0D][0A]

SPWF04: 9:AT-S.OK[0D][0A]

and it worked!

So I went back to my large file and yes as long as I don't do the FSL command and instead have the filelength as a constant it will read it.

So the original issue is resolved - I can read large files from the user volume, but is there any reason I'm seeing an extra NULL character after the AT-S.OK from a AT+S.FSL command?

brianshankland9
Associate II
Posted on March 29, 2018 at 13:19

Ok, final piece of info I think for today.

Even if I ignore any NULL characters that follow the FSL command, if I try to perform the file print after receiving a NULL, it doesn't complete.

As I need to list the files to find the file size for the file print (otherwise wit UART I have no idea how many characters will be returned), I have introduced a workaround in which I perform a hard reset of the device after the FSL command and then once its reset I then print th efile contents.

This is working so we at least have a product solution even if it is a little messy.

Elio Cometti
Senior II
Posted on March 30, 2018 at 09:18

Can you type your command sequence directly to the SPWF04 UART interface from a terminal (e.g. teraterm,)?

Actually, there are unexpected characters in your log. For example you should expect [0A] as line terminator but receiving [0D][0A]