This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MakingHttpServer Presentation Problems

Hi Everyone,

I am currently working on TIRTOS to set up httpServer and store server content on the SD card following Todd Mullanix's presentation (http://processors.wiki.ti.com/index.php/TI-RTOS_HTTP_Example).

The board is TI concerto F28M35H52C1. I followed the presentation and everything worked fine as described until slide 44. When I tried to add the file "efs_stdio.c" into the project, the source file "http/osif.h" can not be opened (line 11 of efs_stdio.c). I searched that source file and finally found it in "os" folder, so I tried to change the directory to "#include <ti/ndk/inc/os/osif.h>". The previous error disappeared but another 100 new errors occured. Till now, I am not able to debug the problems. I attached two images, one is your presentation page 45 and another one is the error messages.

Thanks in advance for any help.

Bin

  • Hi Bin,

    I'll try to reproduce this and get back to you.

    Todd

  • Bin,

    I was able to reproduce this. It looks like the wrong efs_stdio.c file was included in the zip. I need to figure out what happen and re-post the proper file. It will take a day or so to iron this out.

    Todd

  • Hi Todd,

    Thanks for your help. I am looking forward to your new file.

    Many Thanks,

    Bin

  • Bin,

    Can you try this file instead? If it works for you, I'll update the zip file on the wiki.

    2642.efs_stdio.c

    Thanks,
    Todd

  • Hi Todd,

    Thanks very much for your kind help and it is very appreciated.

    The new file is working absolutely fine as described. I kept on following the steps to enable LFN support and finally I can sucessfully compile it. However, when I tried to input my IP address, I still got the 404 Error. But if I type in "<IP>/greetings.html" or "<IP>/default.html" in my browser, I can get the information stored in the SD card. I am wondering is that correct to get 404 Error again when I only type in my IP address ?

    Many Thanks,

    Bin

  • Hi Todd,

    There is one more question. In function "AddWebFiles", the "efs_createfile("getTime.cgi", 0, (UINT8 *)&getTime);" is uncommented. Why cannot I see the cgi from the webpage when I input my IP address ?

    Kind Regards,

    Bin

  • Do you have index.html file on the SD card?

    Regarding the cgi, you should be able to see it if you point your browser to <ip addr>/getTime.cgi.

    What browser are you using?

    Todd

  • Hi Todd,

    That code is now working ok by adding an index.html file. But another problem occured.

    I loaded the demo code example but errors occured when I built it as shown in Figure. I am guessing this is because of the xdc folder had been changed. Are you able to help how to solve this to make both of these two codes working.

    Many Thanks,

    Bin

  • Bin,

    Once you rebuild FatFS in SYS/BIOS to support long-names, you need to supply these functions. This is done in the HTTP PPT on slide 47 step 3 by adding the ccsbcs.c file. You need to do something similar for all projects that use the rebuilt FatFS.

    Todd

  • Hi Todd,

    Thanks very much for your kind help. That solved the problem.

    Regards,

    Bin

  • Hi Todd,

    I created a project which uses SD card as the web server. My index.html code is stored in the SD card. Before I added any images in my code, the web server was working ok. The problems occured when I added two images into the index.html code (the code added is shown below). These two images are only 24KB and 32KB and are also stored in the SD card. When I typed my IP address into the web browser, "out of memory" message appeared. The screenshot is shown below. I even tried to reduced the images to be 2KB or used only one image, but still not working. Are you able to help ?

    Thanks,

    Bin

    <img src="Logo.jpg" height="70" width="242">

    <img src="SQUID.jpg" height="150" width="240">

  • What browser are you using?

  • Hi Todd,

    I tried different browsers, Firefox, Internet Explorer and Chrome. All these browsers are not working, but Internet Explorer worked a couple of times. Also, I attached the screenshot of ROV when problem occurs, it seems like it is the dchild problem.

    I am sorry to reply you normally at this time. I am in the UK and this is the time I come to work.

    Regards,

    Bin

  • Hi Bin,

    When you have things like a picture in a webpage, the browser will send another request to the target. This generates a new socket request. So if you have multiple pictures in a page, these will generate multiple socket connections...which uses more memory. You can refer to http://processors.wiki.ti.com/index.php/TI-RTOS_Networking_Stack_Memory_Usage for more details about the Networking Stack's dynamic memory allocation.

    So, you need to increase the size of the heap that the NDK is using.

    Todd

  • Hi Todd,

    I followed the instructions of the link you provided to reduce the stack sizes of NDK in "ndk/Global->Scheduling". However, I am not able to find where can I adjust the heap size in ndk/global. Could you please advise this a bit more detailed.

    Alternatively, I am thinking about another idea. I converted my "index.html" file into "default.h" file. This "default.h" file is included in my project in the Project Explorer. I can visit the website without SD card by following the first part of your presentation. However, in this case, I am not able to visit my ".txt" file in the SD card. Do you have any solution for my specific application ?

    Many Thanks,

    Bin

  • Bin,

    The default SYS/BIOS heap's size is controlled by the BIOS.heapSize configuration parameter.

    Can you please start a new post for the other question. We prefer to keep the threads short to make searching easier.

    Todd