Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: dmitryponv on July 28, 2011, 02:52:02 am

Title: Cannot compile source code for Webserver
Post by: dmitryponv on July 28, 2011, 02:52:02 am
Good Afternoon,
I am having several issues with the source code for the webserver platform

1.
I am starting with the simplest steps, replacing the TCPIP MMD Demo App in the Microchip Application Libraries with files in the MCstack-SDcard-server.

The problem is that I don't know which version of application libraries to use.
I doubt it is the most recent one v2011-07-14, which I believe came out after MpLabX, but I have tried it as well without success. (it doesn't have the MMD demo app)

I have been trying to use the v2009-11-18 libraries, which seem to have been around the same time that the Web Server on a Business Card has been created.
When I replaced TCPIP MMD Demo App with files in the MCstack-SDcard-server,
I got this error trying to compile in MpLab 8
pic30-coff-cc1.exe: error: Invalid -mcpu option.  CPU 33FJ128GP204 not recognized.

I changed from dsPIC33FJ128GP204 which uses the v3.10_C assembler to dsPIC33FJ128GP206 which uses the v2.02 assembler. (I don't know why they are different, maybe someone can help me understand that)
I got 500 or so errors, which I posted in the attached document.
This seems to be most likely related to the version incompatibility, maybe I downloaded a TCP-IP stack that is too old.

If that is the issue, can you please let me know what version/date I should be using.

I also need to know if that issue with the dsPIC33FJ128GP204 can be resolved by downloading a more recent verison of C30, and whether or not the software will run on the Webserver if it compiled under dsPIC33FJ128GP206 ?

By the way, I tried compiling the original TCPIP MMD Demo App, however I received errors from the linker that the program memory was full
...pic30-coff-ld.exe: Link Error: region program is full (TCPIP MDD SD Card Demo App-C30.cof section .const)
data_init: Link Error: Could not allocate section .dinit, size = 422 PC units, attributes = code
default_isr: Link Error: Could not allocate section .isr, size = 2 PC units, attributes = code

Would this be because I am using the dsPIC33FJ128GP206 as my device? I am using the large code model which was selected by default when I opened the project. Everything else i set to default.

2.

This is a question about the Web Server on a  Business Card project which I originally started to attempt to compile.

The problem I ran into was with the FATHTTP.patch process.
First, I was not sure what version of the application library/tcpip stack to use, and thus I downloaded the 2009-11-18 version which seems to have been released a few months after the project, but it is the earliest version available.

I tried patching the http.c file with Linux and Tortoise svn but the .patch file seems to be of a wrong format, because it doesn't include "Index: " line and other things.

What is the proper program I should be using to apply this patch? Does anyone have a fathttp.c file they can send me? (dmitryponv (at) gmail (dot) com)  or perhaps a patch that I can use with Tortoise SVN?

3.

This is a question regarding the FreeRTOS distribution (matt/eric) that came with the Webserver package.

Is this the source that is running on the Webserver, including the bootloader, and etc?
I have been unable to compile it as well
Does this distribution require the TCPIP stack from Microchip?

If so how would I go about combining the two so that I can compile the firmware of the Webserver board?

If not, then where is the firmware? there are many different projects in the firmware folder of the source.
Are these still based on the MicroChip TCPIP stack or do they use a different source for the stack?


Thank you for taking your time to read my questions.
If some of these have been answered before please let me know where to look for them.

I would really like to purchase the Webserver board or to build the web server on a business card for my research. But unfortunately, I cannot do anything until I can compile the source code.
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on July 28, 2011, 07:01:02 am
To compile the SD card web server, I suggest you start at http://dangerousprototypes.com/docs/SD_ ... erver_demo (http://dangerousprototypes.com/docs/SD_card_web_server_demo) where the versions that have been successfully compiled are noted.

As for "pic30-coff-cc1.exe: error: Invalid -mcpu option. CPU 33FJ128GP204 not recognized", well, yes, you're obviously using an older version of the compiler. You need to upgrade :)
Title: Re: Cannot compile source code for Webserver
Post by: dmitryponv on July 29, 2011, 12:07:14 am
Thanks for your reply,
I compiled the MCstack-SDcard-server with the newest C30 and , 3.30b and v2009-11-18 libraries.
It seems like everything should be ok.

I am still interested if anyone can help me with the patch file for the pic24 web server on a business card and explaining if the FreeRTOS distribution is what goes on the webserver.

What boards was the original MMD TCPIP source from microchip made to work with?

Thanks,
PS. Sorry for the short message, loud keyboard + class :)
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on July 29, 2011, 01:32:51 am
See http://dangerousprototypes.com/docs/Web_Platform (http://dangerousprototypes.com/docs/Web_Platform) for all the web platform documentation and to answer all your web platform questions.

No idea about the business card webserver which was the precursor to the web platform.
Title: Re: Cannot compile source code for Webserver
Post by: ian on July 29, 2011, 08:23:07 am
Hi dmitryponv,

Quote
Is this the source that is running on the Webserver, including the bootloader, and etc?
I have been unable to compile it as well
Does this distribution require the TCPIP stack from Microchip?

The web platform has two FreeRTOS ports. Both should work with the bootloader, but the bootloader is a separate project. FreeRTOS has its own TCPIP stack, included with the project, so it should be easier to compile and get started with.

Quote
I am still interested if anyone can help me with the patch file for the pic24 web server on a business card and explaining if the FreeRTOS distribution is what goes on the webserver.

I'm sorry, I wish I could distribute the files, but Microchip sent a takedown notice for the last ones.

The FreeRTOS has never been ported to the web server on a business card, I don't know if it will work on the PIC24F. With a few changes maybe, but there isn't much flash on the 24F.
Title: Re: Cannot compile source code for Webserver
Post by: dmitryponv on July 30, 2011, 04:25:12 am
Thanks for your reply.

I had one last quesiton, for now,
The FreeRtos port I am trying to compile (matt) is not fitting within the memory of the microcontroller dsPic33fj128gp204. Saying that "pic30-coff-ld.exe Error: Not enough memory for stack (528 bytes needed, 270 bytes available)". What memory model/ heap/stack sizes should I be using? Is the software supposed to barely fit onto the uC?

Thanks,
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on July 30, 2011, 04:49:33 am
I seem to recall you should be using the large memory model. Try it and let us know.
Title: Re: Cannot compile source code for Webserver
Post by: ian on July 30, 2011, 06:47:45 am
There should be plenty of space, that just means the stack memory setting is too small. I think you can change it in the .gld file, or maybe using the large memory model as dpropicweb suggests.
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 13, 2011, 11:37:51 am
Hi

I bought the Web Platform V1.1. It works fine with the precompiled demo application  (MCstackDemo).
I have compiling problem with the SD card demo application. I'm using TCP/IP STACK V5.31, C30 compiler v3.30.
I made the following changes: 
1) Put the replacement files in this folder into the Microchip MDD HTTP demo
//  directory (C:Microchip SolutionsTCPIP MDD Demo App)
//  Replace 6 files in total:
//    Maindemo.c/.h, HardwareProfile.h, TCPIPConfig.h, TCPIP MDD SD Card Demo App-C30.mcw/.mcp
2) add a delay using 9 Nop()s in the WriteReg() function after the statement Dummy = ENC_SSPBUF;
3) omit the second occurrence of {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 200, 200}

In MPLAB Project/build options/project -> Include Search Path add this folder: C:Microchip Solutions v2010-10-19MicrochipInclude
I can't compile the project. The error message :
Quote
CustomHTTPApp.c: In function 'HTTPExecutePost':
CustomHTTPApp.c:321: warning: unused variable 'cwdPathPtr'
CustomHTTPApp.c:320: warning: unused variable 'cwdPath'
CustomHTTPApp.c:689:29: error: macro "SaveAppConfig" passed 1 arguments, but takes just 0
CustomHTTPApp.c: In function 'HTTPPostConfig':
CustomHTTPApp.c:689: error: 'SaveAppConfig' undeclared (first use in this function)
CustomHTTPApp.c:689: error: (Each undeclared identifier is reported only once
CustomHTTPApp.c:689: error: for each function it appears in.)

I have tried to download earlier version of the compiler, but I could not install, because the program wanted a serial number. I haven't found the lite version of the earlier compiler.
Sorry my bad english, I don't speak english well.
Please help me to solve this compiling problem.
Thank you!
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 13, 2011, 12:28:07 pm
It looks like the only problem you have is the changed (and now incorrect declaration) of SaveAppConfig. You can either:

1) fix the declaration; or
2) use the earlier v2009-11-18 library which you can download from http://www.microchip.com/stellent/idcpl ... odeId=2896 (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2896)
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 13, 2011, 03:44:56 pm
Thanks for your reply!

I've downloaded and installed this library and made the same changes except 2) and 3).
Now I have the following error message:
Quote
In file included from C:/Microchip Solutions/Microchip/Include/TCPIP Stack/TCPIP.h:284,
                from MainDemo.c:30:
C:/Microchip Solutions/Microchip/Include/TCPIP Stack/Helpers.h:64: error: conflicting types for 'ultoa'
c:/program files (x86)/microchip/mplabc30/v3.30b/bin/bin/../../include/stdlib.h:91: error: previous declaration of 'ultoa' was here
In file included from C:/Microchip Solutions/Microchip/Include/TCPIP Stack/FileSystem.h:59,
                from C:/Microchip Solutions/Microchip/Include/TCPIP Stack/TCPIP.h:369,
                from MainDemo.c:30:
C:/Microchip Solutions/Microchip/Include/MDD File System/FSIO.h:42:22: error: FSconfig.h: No such file or directory
In file included from C:/Microchip Solutions/Microchip/Include/MDD File System/FSIO.h:47,
                from C:/Microchip Solutions/Microchip/Include/TCPIP Stack/FileSystem.h:59,
                from C:/Microchip Solutions/Microchip/Include/TCPIP Stack/TCPIP.h:369,
                from MainDemo.c:30:
C:/Microchip Solutions/Microchip/Include/MDD File SystemSD-SPI.h:41:22: error: FSconfig.h: No such file or directory

Very annoying message:
Quote
FSconfig.h: No such file or directory
In the solution explorer (called in other compilers, the window where the source files are listed) clicked (right click) I to the FSconfig.h then locate missing file and browsed the file c:Microchip SolutionsTCPIP MDD Demo AppFSconfig.h
F10 and got the same error message. Any idea? What am I doing wrong?
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 13, 2011, 05:07:10 pm
You need to go to Project -> Build Options -> Project -> Show directories and select include path and add the paths to your Microchip include directory, MDD FS include directory, TCPIP stack include directory; you also need to do the same for the library directories.
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 13, 2011, 06:30:39 pm
Thanks for your reply!
But I am not sure I've right understand it. So please check my options: I wanted to link my screenshot about MPLAB, but I couldn't, because I'm a new user...
I write here the included folders:
In Include Search Path:
C:Microchip SolutionsMicrochipTCPIP Stack
C:Microchip SolutionsTCPIP MDD Demo App
C:Microchip SolutionsMicrochipInclude
.
..MicrochipInclude
%PROGRAMFILES%MicrochipMPLAB C30include

In Library Search Path:
C:Microchip SolutionsMicrochipTCPIP Stack
C:Microchip SolutionsTCPIP MDD Demo App
C:Microchip SolutionsMicrochipInclude

Is it right?
Now I've this error message:
Quote
c:program files (x86)microchipmplabc30v3.30bbinbin..bin/pic30-coff-ld.exe Error: A heap is required, but has not been specified
Link step failed.
What does it mean? How can I fix it?
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 14, 2011, 12:05:29 am
Right - except you don't need
Code: [Select]
C:Microchip SolutionsMicrochipInclude
in the Library search path, though it probably won't hurt.

As for the linker error message: it sounds like you changed the Build Options for the linker? Is the heap still specified in Build Options -> MPLAB LINK30 as 512 bytes?
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 14, 2011, 09:52:00 am
I didn't change it, but it wasn't any number in the Heap size.
Now I writed 512, compiled and finally build succeeded!
Thank you very much for your help!
But the PIC freezes, when I try to open the index.htm file (this is the only file on SD card, and I formatted the card with SDFormatter V2.0.0.3)
Probably because this code don't like my SD card...
With the FreeRTOS SD card webserver worked. But it freezed too after the opening or downloading one file.
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 14, 2011, 11:12:08 am
Try removing the extra nops and using the first option (ie change the statement ENC_SPICON1bits.CKE = 1; to ENC_SPICON1bits.CKE = 0 and let me know how you go. This seems to work more reliably in the v5.36 stack I'm currently checking.
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 19, 2011, 09:20:33 am
Sorry I didn't noticed the second page...
I tried it, but the pic still freezes. I use now two SD cards: 1GB Transcend, 2GB Kingston. Yesterday I installed a new copy of the Stack (V5.20) and made the initial changes. I can see with the ethernet discoverer the webplatform, but when I open it in my browser (chrome) it freezes.
Currently I've no idea what's the problem, except the SD cards. Should I buy a new one? (I bought my SD card approx 4 years ago)
I followed your instructions step by step in this topic: MicroChip demo pages functionality
I were succesfull, except this SD card project.
Other: I asked it in other topic: I writed a lot of C code to PIC, but this MPLAB C30 programming absolutely new to me. Is there any basic introduction? How to use ADC, PWM, timers, etc? I used CCS and its help were really useful.
Thank you!
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 19, 2011, 11:32:59 am
I recently revised and updated the documentation of the SDcard server demo. Please refer to: http://dangerousprototypes.com/docs/SD_ ... erver_demo (http://dangerousprototypes.com/docs/SD_card_web_server_demo) and let us know how you go.
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 19, 2011, 12:54:48 pm
Versions: C30: v3.30b
   Mplab: v8.73
1, I've downloaded and installed the current version of the TCP/IP Stack (v5.36).
2, I've copied the replacement files.
3, I've added file paths, detailed in SD card web server demo page (http://dangerousprototypes.com/docs/SD_ ... erver_demo (http://dangerousprototypes.com/docs/SD_card_web_server_demo))
At this time the most of the files are not found. I try to compile it. Maybe it's needed to getting work these path changes. No success. Restart Mplab and still lot of files not found.
4, Comment out the second "{TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 200, 200},", reduce the MAX_HTTP_CONNECTIONS   2 to 1
5, Remove LegacyHTTPApp.c and HTTP.c46, In MainDemo.h replace the line #define SaveAppConfig() NOP() with #define
SaveAppConfig(dummy) Nop().
Compile and still not found. Restart Mplab, nothing changed.
Start thinking what's the problem? The project directory is: C:Microchip Solutions v2011-06-02TCPIPDemo App MDD
Maybe because of "v2011-06-02" is this file not found problem.
Rename the directory to: C:MS SDTCPIPDemo App MDD
Correct the search paths (step 3). Restart Mplab, compile and still not working!
Here is my screenshot: http://https://picasaweb.google.com/lh/photo/SPPm8Ff81Tk0_cil4ZWC1w?feat=directlink
If I remember right I could solve this problem only with installing the v5.20 Stack (by the eeprom version).
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 19, 2011, 02:29:02 pm
If you fix the search paths, the files will be found. You could try right-clicking on each file and using the Locate option, though I've only done this when a small number of files could not be found.

If it's any help, my directory structure looks like [deleted old link]
There are two include directories for each of the TCPIP and MDD libraries. Try including both in the include search path.

(Sorry couldn't read your image as it was too small)
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 19, 2011, 02:54:13 pm
Please check: http://https://picasaweb.google.com/lh/photo/e_mPgVIvj8du6rPqYo_MHA?feat=directlink
You can zoom in above the picture.
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 19, 2011, 03:03:23 pm
You need to include the include directories for the TCPIP and MDD modules in your include search paths. At the moment you have the directory above each of those included (ie TCPIP and MDD, not TCPIP/include and MDD/include).
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 19, 2011, 04:33:03 pm
I'm not sure I understanded right. Did you mean so: http://https://picasaweb.google.com/lh/photo/AnKlquGfxI-dKU-mERrkqw?feat=directlink ?
If not please write  exactly which directories should be there.
It's not clear to me, because I followed these instructions:
Quote
1. select include search path and add file paths to:

Microchip SolutionsMicrochipInclude directory;
Microchip SolutionsMicrochipTCPIP Stack directory; and
Microchip SolutionsTCPIP MDD Demo App directory.
2. select library search path and add file paths to:

Microchip SolutionsMicrochipTCPIP Stack directory; and
Microchip SolutionsTCPIP MDD Demo App directory.
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 20, 2011, 02:52:53 am
You need to fix the include paths for the compiler. I cannot tell you exactly what they should be for your particular installation. You're going to have to figure that out for yourself. The example paths are not exact - they show you just enough of the directory paths to point you in the right direction. Everyone's installation is likely to be different which is, of course, why the files cannot be found in the first place when using someone else's project file.

I still suggest you include the two extra include directories TCPIP Stack/include and MDD/include in your includes search path, but I have no idea where you have these located so I cannot tell you exactly what the pathnames should be.

Alternatively, delete all the files (which cannot be found) from the project and then add them back one at a time. It may take a little time, but then at least all the files will then be found by the compiler.
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 20, 2011, 12:05:00 pm
I found the problem: In the project file:
...
file_002=..MicrochipTCPIP StackTick.c
...
"..Microchip..." was the problem.
I replaced all ".." to "C:Microchip Solutions" and it works...
So build succeeded.

Before that I renamed my "MS SD" directory to "Microchip Solutions"
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 20, 2011, 12:49:29 pm
Excellent!
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 20, 2011, 02:49:19 pm
SD card webserver demo working!!
But there is a bug: When I open the demo page in chrome: after toggle one LED than blinking stops (only on page, on hardware the LED is still blinking, and the other LED toggles, when I click to toggle, but on the page I don't see any changing)
In firefox works fine!
The eeprom version worked fine in both browser.
Here is my webserver: http://alex077.dyndns-at-work.com/ (http://alex077.dyndns-at-work.com/)
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 21, 2011, 11:07:36 am
I have a new problem:
By the eeprom webserver demo all modifications worked properly. (detailed here: http://http://dangerousprototypes.com/forum/viewtopic.php?f=24&t=475)
Now I wanted to add email sending to restricted zone (protect folder).
1, I created a new folder (protect).
2, I copied email.htm from the eeprom webserver project to protect folder.
3, I changed header.inc: <a href="/protect/email.htm">Send E-mail[/url]
4, I changed in CustomHTTPApp.c:
in function
Code: [Select]
static HTTP_IO_RESULT HTTPPostEmail(void)
:
Code: [Select]
strcpypgm2ram((char*)curHTTP.data, "/email/index.htm");
  to
Code: [Select]
 strcpypgm2ram((char*)curHTTP.data, "protect/email.htm");

---
in function
Code: [Select]
HTTP_IO_RESULT HTTPExecutePost(void)
:
Code: [Select]
if(!strcmppgm2ram((char*)filename, "email/index.htm"))
to
Code: [Select]
if(!strcmppgm2ram((char*)filename, "protect/email.htm"))

commented out
Code: [Select]
if(!memcmppgm2ram(filename, "index.htm",9))
return HTTPPostDDNSConfig();
if(!strcmppgm2ram((char*)filename, "dyndns/index.htm"))
return HTTPPostDDNSConfig();
beacuse HTTPPostDDNSConfig(); does not exist.
5, In TCPIPConfig.h enabled the email and other demos, as described here: http://http://dangerousprototypes.com/forum/viewtopic.php?f=24&t=475
6, deleted HTTPPrint.h , HTTPPrint.idx
7, runned MPFS2.exe (without upload)
8, copied files from Webpages2 to SD card and DynRcrd.bin, FileRcrd.bin
9, recompiled the project and downloaded to PIC
When I open the demo page in my browser I can only after authentication open email.htm (as expected), but only the text is displayed. Nothing else. It seems the browser don't find header.inc, footer.inc, etc.
Is it expected that DynRcrd.bin and FileRcrd.bin aren't overwrited? Last modification: ‎2011. 06. ‎03., ‏‎1:40:15  (yyyy, mm, dd format), today is: 21/08
Any idea what to do?
Thank you!
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 21, 2011, 12:07:02 pm
> 8, copied files from Webpages2 to SD card and DynRcrd.bin, FileRcrd.bin

I think you will find newer versions of DynRcrd.bin, FileRcrd.bin in your project directory (not the webpages2 directory) ?
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 21, 2011, 12:27:37 pm
I copied from project directory.
I've never  seen a newer version of these files...(anywhere)
(MPFSImg2.bin is refreshed)
MPFS version: v2.1
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 21, 2011, 12:33:24 pm
You don't need MPFSImg2.bin - did you check the MDD option to generate the DynRcrd.bin, FileRcrd.bin files?
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 21, 2011, 02:33:50 pm
I didn't know the right option is MDD. I selected it, generated, recompiled, etc and works!
But not perfect. When I clicked on send button the page is reloaded, but the message isn't sendet and there is no message about "Your message have been sent" or not.
The same steps did you followed as you writed here (by getting work email sending by sd card webserver)?http://http://dangerousprototypes.com/forum/viewtopic.php?f=24&t=475
By eeprom version worked in protect folder too.
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 21, 2011, 03:29:12 pm
> I didn't know the right option is MDD. I selected it, generated, recompiled, etc and works!

Cool :)

> The same steps did you followed as you writed here (by getting work email sending by sd card webserver)?

It's been a while, but I don't believe I did anything that was not in that post to get email working. Any error messages? Does it try to send email (mailserver log entries) ?
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 21, 2011, 04:07:23 pm
I didn't found any mailserver log file. Where do I have to search it?
I suppose the problem is maybe here:
in function: HTTP_IO_RESULT HTTPExecutePost(void)
Code: [Select]
#ifdef STACK_USE_MDD

#if defined(STACK_USE_SMTP_CLIENT) || defined(STACK_USE_DYNAMICDNS_CLIENT)
cwdPathPtr=FSgetcwd ((char *) cwdPath, 20); //We are taking 20 bytes of buffer to store the CWD

for(i=0;i<20;i++) //Convert CWD path string to lower case
if((cwdPathPtr[i] >= (BYTE)'A') && (cwdPathPtr[i] <= (BYTE)'Z'))
cwdPathPtr[i] += 'a' - 'A';

for(i=0;i<20;i++)
{
if(cwdPathPtr[i] == (BYTE)'e') //email
{
if(!memcmppgm2ram(&cwdPathPtr[i], "email",5))//is CWD == email ?
//if(!memcmppgm2ram(&cwdPathPtr[i], "protect",5))//is CWD == email ?
{
//In MDD, to open a file, we change current working directory to
//the file directory. Hence only the reuqested file name need to be compared.
if(!memcmppgm2ram(filename, "index.htm",9))
// if(!memcmppgm2ram(filename, "email.htm",9))
return HTTPPostEmail();
}
}
else if(cwdPathPtr[i] == (BYTE)'d') //dyndns
{
if(!memcmppgm2ram(&cwdPathPtr[i], "dyndns",6))//is CWD == dyndns ?
{
// if(!memcmppgm2ram(filename, "index.htm",9))
//return HTTPPostDDNSConfig();
}
}


}
if(i==21) //This means current working directory is not "email"
return HTTP_IO_DONE; //return as we cant process this request.

#else

#if defined(STACK_USE_SMTP_CLIENT)
//if(!strcmppgm2ram((char*)filename, "email/index.htm"))
if(!strcmppgm2ram((char*)filename, "protect/email.htm"))
return HTTPPostEmail();
#endif

#if defined(STACK_USE_DYNAMICDNS_CLIENT)
// if(!strcmppgm2ram((char*)filename, "dyndns/index.htm"))
//return HTTPPostDDNSConfig();
#endif

in function: static HTTP_IO_RESULT HTTPPostEmail(void)
Code: [Select]
// Redirect to the page
//strcpypgm2ram((char*)curHTTP.data, "/email/index.htm");
strcpypgm2ram((char*)curHTTP.data, "//protect/email.htm");
curHTTP.httpStatus = HTTP_REDIRECT;
return HTTP_IO_DONE;
"//" is somewhere defined as MDD rootdir
It doesn't work without /, with /, and with //
It would be a big help, if I could send data via serial port. I tried UART1TX("H"); and UART1TX('h'); but doesn't work :(

Update: I call InitializeUART1(); , after that : UART1TX('h');UART1TX('e');UART1TX('l');UART1TX('l');UART1TX('o');
in never ending loop: UART1TX('A');
In Tera Term (with baudrate 115200) I see only "˙˙˙˙˙˙"...
Title: Re: Cannot compile source code for Webserver
Post by: dpropicweb on August 21, 2011, 11:06:22 pm
> I didn't found any mailserver log file. Where do I have to search it?

The mailserver you were trying to send the email to.

> In Tera Term (with baudrate 115200) I see only "˙˙˙˙˙˙"...

See viewtopic.php?f=24&t=2636#p26123 (http://dangerousprototypes.com/forum/viewtopic.php?f=24&t=2636#p26123) for the UART1TX() problem solution.
Title: Re: Cannot compile source code for Webserver
Post by: alex077 on August 23, 2011, 04:42:28 pm
I solved the problem!!! (so I'm very happy now :) )
In HTTP_IO_RESULT HTTPExecutePost(void)
Code: [Select]
if(cwdPathPtr[i] == (BYTE)'p')   // change 'e' to 'p'
if(!memcmppgm2ram(&cwdPathPtr[i], "protect",5))//is CWD == protect ?  change email to protect
if(!memcmppgm2ram(filename, "email.htm",9))  //if i remember right here was index.htm

In cwdPathPtr is stored the Current Work Directory
original was email, now protect

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01552225968session_write_close ( )...(null):0
20.01582357560ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01582358336Database_MySQL->query( ).../DatabaseHandler.php:119
40.06082497072Database_MySQL->error( ).../Db-mysql.class.php:273