Hot!SOLVED: problem with HTTP service.. Can't find the files. ( harmony 2.04 )

Author
mrpackethead
Super Member
  • Total Posts : 766
  • Reward points : 0
  • Joined: 2007/04/01 23:33:39
  • Location: 0
  • Status: offline
2017/10/12 16:41:37 (permalink)
0

SOLVED: problem with HTTP service.. Can't find the files. ( harmony 2.04 )

I have configured a new project from scratch, and it has some web pages assocaited with it.  I used MPFS file generator to create the web pages, and they are included into my project.      

No matter whati do,i'm getting a  
404: File not found


Files are stored in NVM, The NVM is registered with the file system.

The default page is index.htm, which is the file in the MPFS.

Any hints as to what could be going wrong.
post edited by mrpackethead - 2017/10/13 18:07:26
#1

6 Replies Related Threads

    mrpackethead
    Super Member
    • Total Posts : 766
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: problme with HTTP service.. Can't find the files. ( harmony 2.04 ) 2017/10/12 17:07:43 (permalink)
    0
    Its almost like the file system is'nt being attached.   How could i test that?
    #2
    rainad
    Moderator
    • Total Posts : 832
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: online
    Re: problme with HTTP service.. Can't find the files. ( harmony 2.04 ) 2017/10/13 08:48:22 (permalink)
    3 (1)
    Please make sure that SYS_FS is successfully mounted and then try to open a file directly from your code using SYS_FS_FileOpen("/path/index.htm", SYS_FS_FILE_OPEN_READ).
    We'll be able to tell if it's SYS_FS or HTTP to blame.
     
    #3
    friesen
    Super Member
    • Total Posts : 1724
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: problme with HTTP service.. Can't find the files. ( harmony 2.04 ) 2017/10/13 09:06:57 (permalink)
    0
    This is sort of answered in the other post, but you have to make sure the file system is getting mounted either by auto mount or manually mounting. Compare yours against the demo. Using two versions of mplab and harmony to compare the two can be helpful.

    Erik Friesen
    #4
    BillP
    Super Member
    • Total Posts : 194
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: problme with HTTP service.. Can't find the files. ( harmony 2.04 ) 2017/10/13 15:28:28 (permalink)
    3 (1)
    I stumbled on something like this.  There is a subtle catch in the http demos.  The state machine in app.c has an initial state to mount the FS, then changes the state.  It appears that this is a once-through state, but that is not the case.  It takes several loops through that initial state before the FS is mounted.  I had to put the FS mount back into the app.c state machine to get the FS mounted with the web pages.
    #5
    mrpackethead
    Super Member
    • Total Posts : 766
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: problme with HTTP service.. Can't find the files. ( harmony 2.04 ) 2017/10/13 18:06:02 (permalink)
    0
    Thanks folks for the useful tips.   In deed the problem was due to the file system not being open. And i've now resolved it.  This is a bit of harmony configuration clanger though, that is not completely obvious.

    By default in MHC.. ( at least in vs 2.04 ) the configuration for "LOCAL_WEBSITE_PATH_FS" is not somethign that can be configured in MHC.     Harmony just pops all of these parameters into system_config.h



    /*** TCPIP SYS FS Wrapper ***/
    #define SYS_FS_MAX_PATH 80
    #define LOCAL_WEBSITE_PATH_FS "/mnt/mchpSite1"
    #define LOCAL_WEBSITE_PATH "/mnt/mchpSite1/"
    #define SYS_FS_DRIVE "FLASH"
    #define SYS_FS_NVM_VOL "/dev/nvma1"
    #define SYS_FS_FATFS_STRING "FATFS"
    #define SYS_FS_MPFS_STRING "MPFS2"


    When you configure the file system in harmony it uses /dev/myDrive1 as the default name.  

    The two names don't' match.  hence the missing files.      

    Maybe this is one that microchip might like to pick up in future harmony releases, just to get the consistency of names, between the modules.  Not a bug but certainly something that doesn't make it easy!
     

     
    #6
    mrpackethead
    Super Member
    • Total Posts : 766
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: problme with HTTP service.. Can't find the files. ( harmony 2.04 ) 2017/10/13 18:07:00 (permalink)
    0
    This is the default MHC config for the file module

    Attached Image(s)

    #7
    Jump to:
    © 2017 APG vNext Commercial Version 4.5