Awesome man, congrats. Yeah, my 2 year old is a hand full, I'll come to my computer and find chunks of code deleted, or added characters, (I make massive code revisions), she broke my N key off, pulls wires, etc, etc.
I have my code working finally, we'll be posting soon and looking at your code again, very nice structure.
I imagine that your problem is the sizes of pages, right?
Ever consider storing the pages in SD Card?
Because that is what I plan to do when I receive my ethernet shield and SD shield
Hi, all. Our newborn son Siebe is now 6 days old and doing well. Time to get back to Arduino.
@xanok: We know you can use SD, but we don't want to. My final goal is a library for Ethernet Setup. That would make it very easy for other projects to have a network one can easy set up. (more arduino's on the same network)
I'm looking into this as well. I am especially interested in using the SD card instead of EEPROM. That way you can create an ini file on the card from another computer that contains all of the settings. Also, the HTML files can be served from the card freeing up that much more memory.
I've got serving html from an SD card working. Now I am working on reading data from the card for ethernet settings and being able to save the settings back to the card.
If there is anyone who has already been down this road I'd rather not reinvent the wheel.
I finally found out how to read the data out of the URL, so now I can finish this project. I'll dump all html code and restart with a very simple web page.
DONE, I managed to make the setup page. I didn't use dhcp or static any longer. Now you can change IP, SUBNETMASK and GATEWAY, but for now you'll have the hard reset. You'll also notice the sketch eats SRAM, which is not good, but you could use a buffer to flow the HTML through it, keeping all the HTML code out of SRAM.
Hello JO3RI
thankyou or your hard work here, this is exactly what I need to make a PLC network tester, with one small thing missing DHCP/Static choice.
I have been trying, but I can not make this work, it just hangs when DHCP selected. Did you manage to make that work? Why did you remove it?
I have also tried your older code with DHCP but it doesn't seem to stay selected, it changes back to static.
Any help much appreciated
thanks for trying out my code, now for your question.
There is a reason why I ditched DHCP. for DHCP you'll need the Arduino IDE above 1.0, but when you do, it will not compile because it's confusing DNS for some reason (I don't really know why) and it only is with the byte DNS[] = { , , , }
Now in my code you won't find anything on DNS, but I have been working on this thing for other projects and there it has DNS included (needed for things like twitter lookups). Maybe I should continue my work on this and include a choice on DHCP/STATIC. But I'll have to figure out how to get it working on the new IDE.
this is actually how those setup pages look at this moment:
Hello J03RI
sorry for the delay, life interferes with my fun.
Thanks again, for your work, this is (nearly) perfect for me but I could not possibly achieve this alone. Somehow I just can not get the details right.
To answer your questions.
I need only 1 page, just setup, I will use also an LCD to display IP, Gateway, connection to server (ping) ok, if DHCP or Static etc.
The fancy layout is nice, but I need only basic form for entering data.
I can use IDE 1.0 or 1.0.1
I don't think I need DNS, but...maybe to make my ping function work (for example ping www.google.com) to test internet connectivity.
I hope this is ok? I can try to explain my application further if you need, but what you have done is so close except for DHCP/Static.
I hope this is ok? I can try to explain my application further if you need, but what you have done is so close except for DHCP/Static
.
Ok, I'll continue my work and add dhcp/static switch, but you'll have to give me time.
1 more question. What has to be default? Static or dhcp. You'll have to consider a lot, before deciding.
2nd extra question. Does it have to save settings into EEEprom? Once done, you can't fall back on a simple reset button to go back to default settings (or has this to be a possible selection: save to eeprom/don't save to eeprom)
3th question: why don't I make separate program for your needs, but then I need full explanation of your project, better email about it and we'll work together. info at JO3RI.be
I used your Webpage with some modifications in my project. Basically, I want to be able to change IP address from browser, transmit some simple data, and have some sensor readings.
I encountered strange bahaviour: first time I load "setup" page, and submit form data, everything works as expected. However, if I use same form to submit data again, values from first submit get transferred. After third try, data from second time finally arrives and so on. Some research showed, that parser gets all values twice: from the form (or request URL) itself, and from "referer" field.
In other words: After we press "submit" button, we also see all form contents in URL in our browser. Next time we press button, we send new form data again, and once more old data as referring URL.
The reason for the bug is that terminate expression in findUntil is wrong, and it leads to referer being parsed. According to Wiki the request line and headers must all end with /r/n. And that's what I see in Wireshark. Now, you look for /n/r, i.e. other way around. I guess, you just took example from TextFinder manual, which was wrong.
I hope I understand everything right. Feel free to correct me, if it's not the case.
Thanks man and you are right. Some time ago, I made an other sketch (a better one) that I'm using in all, but I should make a new one, basic for other people to use, I know and I will. Just need more time.
Wow, this sketch goes 99% of the way I need to go for a project i just started working on.
Unfortunately, when I try to compile it in IDE 1.0.1 on Fedora, I get a TON of compilation errors:
hack.cpp:59:1: error: 'prog_char' does not name a type
hack.cpp:60:1: error: 'prog_char' does not name a type
hack.cpp:61:1: error: 'prog_char' does not name a type
hack.cpp:62:1: error: 'prog_char' does not name a type
hack.cpp:63:56: error: variable 'string_table0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
hack.cpp:63:61: error: 'htmlx0' was not declared in this scope
hack.cpp:63:69: error: 'htmlx1' was not declared in this scope
hack.cpp:63:77: error: 'htmlx2' was not declared in this scope
hack.cpp:63:85: error: 'htmlx3' was not declared in this scope
hack.cpp:65:1: error: 'prog_char' does not name a type
hack.cpp:66:1: error: 'prog_char' does not name a type
hack.cpp:67:1: error: 'prog_char' does not name a type
hack.cpp:68:1: error: 'prog_char' does not name a type
hack.cpp:69:1: error: 'prog_char' does not name a type
hack.cpp:70:1: error: 'prog_char' does not name a type
hack.cpp:71:1: error: 'prog_char' does not name a type
hack.cpp:72:1: error: 'prog_char' does not name a type
hack.cpp:73:56: error: variable 'string_table1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
hack.cpp:73:61: error: 'htmla0' was not declared in this scope
hack.cpp:73:69: error: 'htmla1' was not declared in this scope
hack.cpp:73:77: error: 'htmla2' was not declared in this scope
hack.cpp:73:85: error: 'htmla3' was not declared in this scope
hack.cpp:73:93: error: 'htmla4' was not declared in this scope
hack.cpp:73:101: error: 'htmla5' was not declared in this scope
hack.cpp:73:109: error: 'htmla6' was not declared in this scope
hack.cpp:73:117: error: 'htmla7' was not declared in this scope
hack.cpp:75:1: error: 'prog_char' does not name a type
hack.cpp:76:1: error: 'prog_char' does not name a type
hack.cpp:77:1: error: 'prog_char' does not name a type
But you will encounter other problems to, better is to upgrade to IDE 1.0.3 (no need to look for pgmspace.h library) or higher and you should be ready to continue