For our network, the default timeout of 15 seconds was too short when using DHCP. It needs to be around 30 seconds or more.
I suspect that is the case at many large organizations that lock down the network a bit for more security.
So if you get an error trying to get an IP address, try increasing the timeout a bit with eth.setup(30000);
For our network, the default timeout of 15 seconds was too short when using DHCP. It needs to be around 30 seconds or more.
I suspect that is the case at many large organizations that lock down the network a bit for more security.
So if you get an error trying to get an IP address, try increasing the timeout a bit with eth.setup(30000);
I am using internet through a proxy server. Will you please told me how can i configure these parameters??
EthernetNetIf eth(
IpAddr(192,168,0,101), IP Address
IpAddr(255,255,255,0), Network Mask
IpAddr(192,168,0,1), Gateway
IpAddr(192,168,0,1) DNS
);
IP address of my proxy server is 192.168.1.1(private) and HTTP/HTTPS port number is 8070.
Thanks in advance
I am using internet through a proxy server. Will you please told me how can i configure these parameters??
EthernetNetIf eth(
IpAddr(192,168,0,101), //IP Address
IpAddr(255,255,255,0), //Network Mask
IpAddr(192,168,0,1), //Gateway
IpAddr(192,168,0,1) //DNS
);
IP address of my proxy server is 192.168.1.1(private) and HTTP/HTTPS port number is 8070.
Thanks in advance
I've been experimenting with the code, because I would like to be able to change the way mbed conects to the network at run-time.
I've noticed that if I define Ethernet eth. inside the main loop, the code runs with no problem.
int main (){
...
EthernetNetIf eth;
...
return 0;
}
But if I create a function to asign a particular IP Adress based on external parameters, and then pass this object to the main function, this does not work.
EthernetNetIf getIP(){
EthernetNetIf eth(
IpAddr(192,168,0,101), //IP Address
IpAddr(255,255,255,0), //Network Mask
IpAddr(192,168,0,1), //Gateway
IpAddr(192,168,0,1) //DNS
);
return eth;
}
int main (){
...
EthernetNetIf eth = getIP();
...
return 0;
}
I assume this is because there is no implementation of the Copy Constructor, I've tried to look at the code but I can't figure out the way to make this work.
What I want to do is be able to read from a Text file the IP adress to assign to mbed, without recompliling a new program. Is this posible?
I've been experimenting with the code, because I would like to be able to change the way mbed conects to the network at run-time.
I've noticed that if I define Ethernet eth. inside the main loop, the code runs with no problem.
<<code>>
int main (){
...
EthernetNetIf eth;
...
return 0;
}
<</code>>
But if I create a function to asign a particular IP Adress based on external parameters, and then pass this object to the main function, this does not work.
<<code>>
EthernetNetIf getIP(){
EthernetNetIf eth(
IpAddr(192,168,0,101), //IP Address
IpAddr(255,255,255,0), //Network Mask
IpAddr(192,168,0,1), //Gateway
IpAddr(192,168,0,1) //DNS
);
return eth;
}
int main (){
...
EthernetNetIf eth = getIP();
...
return 0;
}
<</code>>
I assume this is because there is no implementation of the Copy Constructor, I've tried to look at the code but I can't figure out the way to make this work.
What I want to do is be able to read from a Text file the IP adress to assign to mbed, without recompliling a new program. Is this posible?
Hi Emilio,
Just a quick question, we are currently using the EthernetNetIf library in our project, but we are having trouble with the DHCP (seems that it is getting stuck while waiting for an IP address). We are looking at moving to the new EthernetInterface library, but it seems that we are missing some files. I believe our current library uses the objects HOST and IPADDR (and our project is heavily based on them...), but those are not present in the new library. Is there an easy way to move from one to the other ?
Thank you for your help.
Hi Emilio,
Just a quick question, we are currently using the EthernetNetIf library in our project, but we are having trouble with the DHCP (seems that it is getting stuck while waiting for an IP address). We are looking at moving to the new EthernetInterface library, but it seems that we are missing some files. I believe our current library uses the objects HOST and IPADDR (and our project is heavily based on them...), but those are not present in the new library. Is there an easy way to move from one to the other ?
Thank you for your help.
Please login to post comments.