We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I wonder if there is any way to get information about failed dhcp process? I need to start dhcp, and if it's not succeeded, disable dhcp and use a default local ip (case of a direct connect to a pc). I understand, that i can monitor local ip, but is there a better way? Also when dhcp is not succesful, the mcb2300_debug complains that retransmit timeout is too big.
Thanks, Gennady
According to the RFC2131, there are should be 4 attempts to retransmit DHCP_DISCOVER with delays 4,8,16,32 seconds. According what I see in a debug mode, TCPnet uses 2 attempts (4 and 8 seconds). On the next delay double (16 seconds), TCPnet considers delay too big (that is where the error message comes from), reverts to the INIT state and starts the DHCP process over.
In my situation the device has no means to be configured for the use of static IP or DHCP. If it's connected to the network with DHCP server, it should use DHCP, if it's connected directly to the pc, it should use a static IP.
So according to the retransmittion algorithm used by TCPnet, when would it be a good time to check for the DHCP success ? Also, can DHCP be disabled at any time (at any stage of a DHCP process) or will be safer to shut it up at a certain stage? Is there any way to check the current DHCP state? (since the TCPnet sends messages to the serial port, it may be possible?)
Or probably in my situation the easiest way will be to install the DHCP server on a PC for a direct connection (this is a tech's laptop) and forget about static IP alltogether ?
There is no option to enable both DHCP and static IP in commercial products like: small routers, print servers, ADSL modems, IP telephones etc. You can select either DHCP or static IP, but not both at the same time.
As far as I understand your problem, you would like to present ethernet examples for MCB2300 in two configurations: one for LAN with DHCP, and the other for direct connection to PC with static IP.
My suggestin would be to create 2 targets in uVision project, one for DHCP and the other for static IP. Then you can simply flash MCB2300 with a correct firmware. We have also a redesigned HTTP_demo example with changes just described above which is not a part of standard RL-ARM distribution. If you need it please let me know and I will send it to you.
Franc