Go Down

Topic: newbie with a code question for combined DHCP/DNS/NTP (Read 643 times) previous topic - next topic

kelly7552

I've combined a number of code segements and libraries to achieve a combination of DHCP/DNS/NTP.  I'm working to add a client connection to a website to allow a PHP/MYSQL database to be updated from the arduino.

As I'm layering code, what would seem the easiest addition, that of a client call to a web site, in this case google fails to compile for:

master_ether.cpp: In function 'void loop()':
master_ether:211: error: 'client' was not declared in this scope
master_ether:216: error: 'client' was not declared in this scope

Could anyone provide a suggestion?

robtillaart


Client client(theserver, 80); is declared in setup() so one cannot reach it inside loop()
=> define Client client global, outside setup and it will be reachable again


Thats a very big setup()  consider defining functions to get some overview.
- setupDHCP()
- setupNTP()
- etc


I noticed you use quite a lot of "long" strings, there might be a RAM shortage nearby. MInimizing these strings will help prevent this. (it might not be a problem yet)

Rob

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

kelly7552

Thanks!  That fixed it.  Yup, I'm playing and learning; so I'll try to minimize the strings and I'll work on learning about functions.

Bill

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up