0

FONA FTP from SD card
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: FONA FTP from SD card

by adafruit_support_mike on Thu Jan 10, 2019 5:46 am

Error code 1,64 is a timeout, and error code 1,77 is an error with a specific operation.

Post the code you're using between CODE tags and we'll see what we can find.

adafruit_support_mike
 
Posts: 55265
Joined: Thu Feb 11, 2010 2:51 pm

Re: FONA FTP from SD card

by JerrySantaCruz on Thu Jan 10, 2019 9:33 pm

Hi Eric,

the problem is that after you send the FTPPUT=1 you get two replies. fona.sendCheckReply gets the first one, but then you have to use fona.getReply to get the second one.

fona.sendCheckReply("AT+FTPPUT=1","OK" , 10000); //this opens the FTP session
fona.getReply("+FTPPUT:1,1,1360",30000);

You'll find the meaning of your error codes (64 and 77) in the SIM800 command manual here: https://learn.adafruit.com/adafruit-fon ... /downloads

Good luck!

Jerry

JerrySantaCruz
 
Posts: 27
Joined: Tue Aug 16, 2016 4:46 pm

Re: FONA FTP from SD card

by blong99 on Sun Jan 13, 2019 11:35 pm

I have successully done FTP on a project using a SIM900 chip not SIM800.

Currently trying to use the same code in another Arduino project for the SIM800 now but need a new SIM as old SIM provider is unreliable
and that just adds to my development hassles.

The FTPPUT=1 command and its response is a pain . The SIM 900 works fine and responds quickly (a few seconds).

Bear with me a few days (waiting for SIM card to arrive from company for whom I am doing the development)
and then would be happy to share my completed code when it works.

Also I am uploading a file from the SD card and not using readLine.

The FTPPUT,1,1,1360 response is NOT always 1360 .... the 3rd argument "1360" is max bytes that can be taken by provider in
one chunk. My code on sim900 loops the file from SD card in chunks of "whatever" and then sends final leftover bytes as well.
i.e. chunk 1 at 1300, chunk 2 at 1300, etc etc, then final chuck at (e.g.) 754 bytes and gets confirmation of each chunk.

In my case my provider gives 1300 as 3rd argument. (I do not live in USA but am in Thailand).

blong99
 
Posts: 5
Joined: Thu Oct 18, 2018 9:02 pm

Re: FONA FTP from SD card

by blong99 on Thu Jan 17, 2019 12:41 am

Got the SIM card but having no joy ...

Sure the FTPPUT=1 responds with OK but no second reply. i.,e. the 1,1,1360 entry

Also the fona.getReply is protected ??? how to use this ??

blong99
 
Posts: 5
Joined: Thu Oct 18, 2018 9:02 pm

Re: FONA FTP from SD card

by blong99 on Wed Jan 23, 2019 6:39 pm

I have now come to the conclusion that the SIM800 will NOT do FTP.

I tested 2 boards and both hang on the FTPPUT=1 command. They never receive a 2nd reply with the maximum bytes that can be uploaded from the network. One can even test by making the FTP login incorrect and you should get back proper error codes. This does not happen either.

I also tried FTPGET=1 and same problem.

FTP is important as Arduino users measure sensors and make dataloggers and want to send data to Cloud so can download onto PC's etc.

The card is basically power and a serial port... nothing fancy in terms of hookup and in the past I had used a SIM900 shield and it worked well.

So I switched my project to SIM 900 and lo and behold my exact software worked fine. The FTPPUT=1 command has a 2nd response within a few seconds as it should ! This cost me days of development wasted and a fair bit of re-engineering to switch from SIM800 Adafruit breakout to a SIM900 shield.

I therefore challenge Adafruit to test FTP on the board and add FTP to the library for the SIM800. I am an experienced programmer (40+ years) and have been working on Arduino for about last 5 years.

The only small possibility is that some form of setup command is needed for SIM800 that is NOT needed on SIM900 but I feel this is small chance. I would say the firmware which does everything but make coffee (i.e. bluetooth, FM radio etc) is dodgy. Note that I am testing on GSM network in Thailand which is European standard and am not in USA.

I also found on the net other users of SIM800 chips that have experienced firmware problems. For instance the SIM800L chip was even stated by manufacturers (China) as a lemon and only meant for local use (China). Supposedly the SIM800H etc are OK .

blong99
 
Posts: 5
Joined: Thu Oct 18, 2018 9:02 pm

Re: FONA FTP from SD card

by blong99 on Mon Feb 11, 2019 4:42 am

I would appreciate some comment from TECH SUPPORT
on my queries/problems about FONA FTP.

blong99
 
Posts: 5
Joined: Thu Oct 18, 2018 9:02 pm

Re: FONA FTP from SD card

by adafruit_support_mike on Sat Feb 16, 2019 2:53 am

We haven't done any work with the SIM800's FTP commands.

Here in the US, FTP is generally regarded as a security hole. Most servers don't enable it, and many firewalls and ISPs block it by default. If your testing shows that the commands in the SIM800 reference don't work over a network that supports FTP from other cellular devices, you're probably correct that it doesn't work.

We've found the same thing is true for the SIM800's SSL features: the documentation says they should work, but we've never seen anyone post working code.

adafruit_support_mike
 
Posts: 55265
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.