Apparently the ftp code is correct. The close
statement is not necessary, since you don't need to keep the ftp session open for further operations, but that cannot be an issue. You can try to save the stdout and stderr of the ftp command, using the verbose option for checking, e.g.
ftp -in -v xx.xx.xx.xx << EOF > ftpout.log 2> ftperr.log
or eventually try a different tool like curl
By the way, are the files you want to retrieve actually downloaded to the local machine?