I have a new trouble :( I want to use the internal RTCC. I copied the codes for RTCC from FREERTOS project. (rtcc.c and rtcc.h) It seems correct working, but I don't know how to use exactly. My InitHardware function (still in SD card webserver project): rtcc_init(); at the end
219 should be 2011 ts.tm_year=11; wasn't good (maybe it was 217..) So it is a problem with the formatting. Any idea what I am doing wrong? That wasn't good:
Update2: I made the following changes: add: long yearstr[10]; ultoa(tt.tm_year,yearstr);putsUART3(yearstr); Not uitoa! But the result is still the same. How can I fix this year displaying problem? With ts.tm_year=2011; the result is 220.0.1.
// ADC AD1CHS0 = 0; // Input to AN0 (potentiometer) AD1CON1 = 0x84E4;// Turn on, auto sample start, auto-convert, 12 bit mode (on parts with a 12bit A/D) AD1CON2 = 0x0404;// AVdd, AVss, int every 2 conversions, MUXA only, scan AD1CON3 = 0x1003;// 16 Tad auto-sample, Tad = 3*Tcy
Now I see on the homepage only numbers between 20 and 40, and it isn't stabil... I cannot change the value with the potentiometer. Any suggestion?
I read this intro tutorial, but that isn't a big help to me. I don't know how to use ADC by this PIC. I found examples only for dsPIC30-s, is it same for dsPIC33-s? I need few examples to learn use this compiler. (for this PIC! on webplatform)
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
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)
#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
// 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 "˙˙˙˙˙˙"...
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.
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
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!
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/
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"