CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Upload File via FTP SIM7080G
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Marco27293



Joined: 09 May 2020
Posts: 110

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 9:19 am     Reply with quote

Hi Ttelmah,

I got:

....

AT+FTPEXTPUT=1

OK

AT+FTPEXTPUT=2,0,64022,100000

+FTPEXTPUT: 0,64022

//send 64.022KB data to sim7080g via uart

OK

AT+FTPPUT=1

OK

+FTPPUT: 1,0
...

BUT when I open uploaded file on FTP host it has 1360 bytes size which is the maximum for a normal ftp put, while I'm using a extended FTP put...
temtronic



Joined: 01 Jul 2010
Posts: 9100
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 9:44 am     Reply with quote

Simple, easy test..

Use a PC terminal program to 'see' the data between PIC and SIM, both ways.
That WILL confirm whether the 64K worth of data IS being sent from PIC to SIM....

I use Realterm, though others will work to verify data IS being sent from 'A' to 'B' as I don't trust ANY computer as far as I can throw them !
Marco27293



Joined: 09 May 2020
Posts: 110

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 10:05 am     Reply with quote

I can confirm that all data are correctly transmitted from PIC to SIM7080g.
benoitstjean



Joined: 30 Oct 2007
Posts: 543
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 10:12 am     Reply with quote

How can you 'confirm' that all data is successfully sent?
Marco27293



Joined: 09 May 2020
Posts: 110

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 10:21 am     Reply with quote

Yes,

I got:

....

AT+FTPPUT=2,1000

+FTPPUT: 2,100

//send 1000 data bytes via uart from PIC to sim7080g

OK

+FTPPUT: 1,1,1360

//repeate the above steps

...

//Finally

AT+FTPPUT=2,0

OK

+FTPPUT: 1,0


When I check the file on FTP host some data are lost...
benoitstjean



Joined: 30 Oct 2007
Posts: 543
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 10:56 am     Reply with quote

What does the '2' and '100' mean in +FTPPUT?

I don't have the docs for this command and mine is different.
temtronic



Joined: 01 Jul 2010
Posts: 9100
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 10:57 am     Reply with quote

re:
Quote:
When I check the file on FTP host some data are lost...

That would indicate data was lost between the SIM and FTP, so NOT a 'PIC problem'
benoitstjean



Joined: 30 Oct 2007
Posts: 543
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 11:03 am     Reply with quote

Still curious as to what the '2' and '100' mean in +FTPPUT response...

I know for SMS messages, the returned value is just some incremental number that wraps around when it hits 255. I don't think this is the case here. Wondering if that's the amout of data that got sent.

For SIMCOM, usually the first retuned value is a confirmation of some sort, like '0' means success when issuing a command but can also mean "option off" when querying a command. In this case it's '2'. What does that mean? Partial sent? Error encountered?
temtronic



Joined: 01 Jul 2010
Posts: 9100
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 22, 2021 6:34 pm     Reply with quote

Curious..so I googled, got a LOT of hits...
one of them...

What I'm doing is reading my file from the SD and writing with the command AT+FTPPUT=2,numberBytes, where numberBytes is the max length of data can be sent at a time, it depends on the network status, in my case the max lenght is 1360, so i decided to send 1000 first, then send the other bytes that are left. I'm still working in this code but hope it helps
...
Now this is NOT for the OP's SIM card, another version..and I've yet to see what '2' means.

This...
Quote:
it depends on the network status

would be an important detail to know from whomever controls the 'network'.
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Sat Jan 23, 2021 1:03 am     Reply with quote

The 2 just means this is the mode to write FTP data. The mode byte can be
'1' to open the session, or '2' to send data. The reply uses the same byte.

I must admit just looked back at my own code for handling this modem,
and I'm doing so much status checking compared to this. Have the modem
set to send 'unsolicited' messages if the status changes, and the RX ISR
parses how the link is running, and this status is checked before every
transmission. Funnily though I use FTPEXTPUT, I'm also explicitly setting
"APPE", or "STOR" with FTPPUTOPT, with a note that I was having problems
with FTPEXTPUT unless this separate setting was done. I also set the
timeout in the FTPEXTPUT command, so I don't get hung up if the link
fails. There seems to be a poorly documented setting for this:

fprintf(GSM,"AT+FTPEXTPUT=2,0,1024,15000\r"); //Extended mode
//15 seconds timeout

Are you sending in binary or ASCII mode?. If ASCII it is vital that the
last byte is a carriage return.
Marco27293



Joined: 09 May 2020
Posts: 110

View user's profile Send private message

PostPosted: Mon Jan 25, 2021 2:32 am     Reply with quote

Hi,

I use carriage return.

My problem is: How can I upload 64KB with extended put FTP method ?

I tried and I got:

AT+FTPEXTPUT=2,0,64022,100000

+FTPEXTPUT: 0,64022

but the file in FTP hosting has only 1360 bytes...

Regards,

Marco
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Mon Jan 25, 2021 2:52 am     Reply with quote

You have already been told. You can't.
You have to send it is smaller blocks. The actual maximum block size allowed
is available from the connection status. You just have to send the first 1024
bytes (say), then send the next 1024 bytes, and keep repeating till it is
all sent.
There are a swath of pieces between your modem. and the final ftp
device receiving the packets. All have packet size limits. You need to ensure
you are sending a packet smaller than the smallest in the entire link. The MTU
for standard ethernet, is 1500 bytes, but even this can cause problems on
some systems. The standard recommendation is to start somewhere under
1400 bytes packet. A common figure is 1260 bytes.
temtronic



Joined: 01 Jul 2010
Posts: 9100
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 25, 2021 5:25 am     Reply with quote

Think of it like having a bowl of soup.
You can't have the whole bowl at once, beause you only have a spoon !
As Mr. T. points out, you have a range of spoons (tiny, small, bit bigger..) but NOT one super large one !!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group