Pages: [1]   Go Down
Author Topic: newbie with a code question for combined DHCP/DNS/NTP  (Read 539 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

* master_ether.pde (10.01 KB - downloaded 6 times.)
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12428
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12428
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are welcome,
Logged

Rob Tillaart

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

Pages: [1]   Go Up
Jump to: