I'm trying to get a project working where I pull variables from a webpage and then display them on the serial port (for now). I have your standard UNO Rev3 board, but a ENC28J60 instead of a Ethernet/Wifi Shield to keep initial cost down. I've run through examples on getting the board connect to the internet, however, I'm having trouble getting finding code to help me understand how to correctly read content from a webpage. Any links or advice to get me in the right direction are greatly appreciated.
My other concern is that since I'm using a ENC28J60 instead of the standard ethernet shields, is my code going to have to be completely different due to different libraries?
Lastly, I want my arduino to be able to access the script from any network... so on your standard DHCP server. Will the ENC28J60 be able to support this or will I have to host it on a static IP address?
I'm having trouble finding your code. What web site are you trying to read?
My other concern is that since I'm using a ENC28J60 instead of the standard ethernet shields, is my code going to have to be completely different due to different libraries?
Of course it is.
Lastly, I want my arduino to be able to access the script from any network... so on your standard DHCP server. Will the ENC28J60 be able to support this or will I have to host it on a static IP address?
Don't know. But, at this point, I'm wondering if saving a few pennies was cost effective.
Caltoa:
Some libraries support DHCP for the ENC28J60.
Which library do you use ?
I used an EtherCard library and at least got a connection to work. I tried using the domain with my script on it, and was able to get the server IP. However, when accessing the content, I got a 301 error I believe (don't have my board with me now). However, when I changed the website to another test domain I have with a static IP, it was able to connect and begin reading the content without issues.
Don't know. But, at this point, I'm wondering if saving a few pennies was cost effective.
I'm starting to think you are correct. I may just go pick up an Ethernet shield to save some future headache. But with that being said, would the code be drastically different if I eventually were to switch to a Wifi shield?
Joffroi:
My other concern is that since I'm using a ENC28J60 instead of the standard ethernet shields, is my code going to have to be completely different due to different libraries?
That depends on the library you use. If you choose UIPEthernet your code will be pretty much the same as with standard Ethernet-lib for WIZ5100 based shields
Joffroi:
Lastly, I want my arduino to be able to access the script from any network... so on your standard DHCP server. Will the ENC28J60 be able to support this or will I have to host it on a static IP address?
DHCP works fine with UIPEthernet. Only problem is it requires aprox. 5kb more flash than tcp with static-ip.
I was looking through the examples provided. Should I be able to use the structure of the TCPClient along with some of the function (server call and server, 80 connect and GET function from the standard webclient tutorial?
Also the Ethercard DHCP is working fine. There is an example for DHCP with that library.
I would be interested in reading a webpage myself, and extracting valuable data. It is hard to read a webpage line by line, since there could be no lines. I don't know a good example yet.
Joffroi:
Should I be able to use the structure of the TCPClient along with some of the function (server call and server, 80 connect and GET function from the standard webclient tutorial?
yes, you may even just take the WebClientRepeating sketch and replace the include of Ethernet.h with UIPEthernet.h. Be aware there's a but in WebClientRepeating-sketch not using if (client.connect(server, 80) > 0) as Client.connect() may return negative values in case dns-lookup fails.
I ended up getting the arduino WiFi shield and got the project completely working. I was able to parse data from a php page and then display it to adafruit 7 segment displays. Thanks for the input!