• AVR Freaks

Hot!Trying to get my FTP server working in passive mode.

Author
markQ
Junior Member
  • Total Posts : 85
  • Reward points : 0
  • Joined: 2013/09/24 07:53:59
  • Location: 0
  • Status: offline
2019/07/19 07:23:58 (permalink)
0

Trying to get my FTP server working in passive mode.

Hi there
I am putting a stack in to a new development using an PIC24FJ256GB410 adabting the MDFS example to work with FatFS tragetting SDCARD over SPI and ENC28J60. And, boy I have not found it very easy. However I can see the finish post coming into view but an stumbeling at the final hurdel. I have fired up filexilla which I got to work connecting to a well known comercial HMS module which worked. I was thinking that if I got a working example I could reverse engineer it into the microcode stack. The zillarohms.GIF has the WireShark dump I saw with fillezilla and the HMS module. The other show what I managed to achieve with my board.

First thing I noticed was that because the initial implimentation of the microchip ftp did not include a PASV command it tried to work in an active mode which did not work. So I have implimented PASV to return

227 Pasv. mode (192,168,1,3,191,124) assigning my data port to 49020. I tried the defaul of 20 but filezilla seemed to not like that and refused to send a LIST command.

It now sends the list with the start of a hand shake, just like the HMS example. However I am ( TCP socket ) is not responding correctly as it should.

It is sending

60 1024 -> 49020 [SYN].....

when it should return

60 49020 -> 51160 [SYN]... which should then prompt Filezilla to complete the hand shake and allow the LIST to complete.


The question is, where and how do I intercept the 66 51160 -> 49020 and then what do I do to set up the correct response?

Do I have to create another Socket?


I know this will not be an easy thing to answer and I am not expecting anyone to debug my code, put any suggestions or pointers will be welcome. For referend I have included my working TCP and FTP c files. You may see a reference to DARIOG in it where I tried his veersion of the FTP switch, but unfortunatly it made no difference to my problem so it is ifdefed out with a bit of merging from his into mine.

[ will not let me add code to this so look at my REPLIES for it , looks like it does not like the TCP.c so I have attached it a txt file]...



PS is there a way of switching of the TCP ACKs that do not appeaar in the HMS transactions?
post edited by markQ - 2019/07/22 00:44:29

Attached Image(s)

#1

5 Replies Related Threads

    markQ
    Junior Member
    • Total Posts : 85
    • Reward points : 0
    • Joined: 2013/09/24 07:53:59
    • Location: 0
    • Status: offline
    Re: Trying to get my FTP server working in passive mode. 2019/07/19 07:28:24 (permalink)
    0
    files have been attached to the first as txt files.
     
    post edited by markQ - 2019/07/31 00:39:21
    #2
    karan123
    Super Member
    • Total Posts : 833
    • Reward points : 0
    • Joined: 2009/02/02 11:11:21
    • Location: 0
    • Status: offline
    Re: Trying to get my FTP server working in passive mode. 2019/07/20 10:54:22 (permalink)
    0
    markq
    [code][/code]Here is my code... 
    . Where?
    #3
    Jim Nickerson
    User 452
    • Total Posts : 6117
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Trying to get my FTP server working in passive mode. 2019/07/20 10:59:12 (permalink)
    0
    at least he used code tags Smile: Smile
    #4
    ric
    Super Member
    • Total Posts : 23185
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Trying to get my FTP server working in passive mode. 2019/07/20 17:29:45 (permalink)
    0
    The C file is attached to post#1, renamed to .txt
    It looks like the OP had several attempts to post it.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    markQ
    Junior Member
    • Total Posts : 85
    • Reward points : 0
    • Joined: 2013/09/24 07:53:59
    • Location: 0
    • Status: offline
    Re: Trying to get my FTP server working in passive mode. 2019/07/22 00:46:52 (permalink)
    0
    Several attempts indeed

    As I said the TCP.c would not post at all, it was blocked by the server, probably a fire wall thing. However I thought the FTP.C went in, here goes again.

     BUT NOW!!!!

    Keep getting this

    "Access Denied

    You don't have permission to access "**********************" on this server.

    Reference #18.39367a5c.1563780798.5d04a29f"


     So will attach ftp.c it as a text file too. See original post.

    Thanks for the constructive comments so far.
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5