Go Down

Topic: DNS, DHCP and Bonjour/Zeroconf with Arduino (Read 5785 times) previous topic - next topic

spatry

There is a warning about not using Ethernet.begin(), what about if EthernetDHCP.begin() is unable to obtain a lease?

seems that something like the following would allow a fall back ip address if there is no DHCP server to talk to.
Code: [Select]

boolean DHCPconnection=true;

void setup()
if (EthernetDHCP.begin(mac)==0){
 Ethernet.begin(mac, defaultip, defaultgateway, defaultsubnet)
 DHCPconnection=false;
}

void loop()

if(DHCPconnection) {
 EthernetDHCP.maintain()
}


I don't know if the DHCP library sets things in the Ethernet library such that I can't do this?  I'm writing the code ahead of getting my ethernet shield, but I wanted to know if there might be any issues with the above code.

Mavromatis

Great Bonjour library!   How do can add multiple text-records?  I seem to be only able to add a single one.   What's the delimiter?

Bremen_GSO

I have a problem with the EthernetDNS.
(This post is only, because otherwise I am not allowed to post images)

Bremen_GSO

#18
Oct 23, 2010, 05:13 pm Last Edit: Oct 23, 2010, 05:14 pm by Bremen_GSO Reason: 1
I think, the libraries will exactly do what I want, but it doesn't work.
I copied the libraries in my libraries folder.
But after the import of EthernetDNS.h it isn't displayed red, like the other libraries.
And there are many errors.
I hope somebody can hep me, because I think the libraries are excellent.
(It doesn't work with the images)

Mavromatis

What are the errors?  I'm using these libraries and they seem to work fine.  What version of the arduino app are you using?  Maybe 19 and above broke them?  I'm using 18 still.

Bremen_GSO

I used arduino21 and that was the problem.
Now, with arduino18 it works very well.
Thank you!

nailbmb

The bonjour library is exactly what I was looking for, any chance of getting an update for arduino 21?

Go Up