[En-Nut-Discussion] DHCP

Michael Hellwig farwest at gmx.de
Fri Dec 2 00:26:36 CET 2011


Harald Kipp schrieb:
> Hi Ulrich,
> 
> On 28.11.2011 23:39, Ulrich Prinz wrote:
>> Could be that it is related to the same problem as connection
>> recognition is. The stack doesn't see if the connection is broken and so
>> it cannot take any measurements to restart.
> 
> DHCP is connection-less.
> 
> 
>> Am 28.11.2011 21:15, schrieb Michael Hellwig:
>>> updated my program accordingly and found that the lease I got is not
>>> renewed. After 8hrs the ethernuts are not responding anymore and I have
>>> to restart them. There is no hardcoded IP-address in the eeprom and I
>>> tried several example codes to no avail.
> 
> Quite some time ago that we've tested the lease time renewal. But there
> hadn't been many changes in this area, so it should still work.
> 
> 
>>> Is anybody out there using DHCP with NutOS successfully?
>>> Im using Nut/OS 4.8.9.0.
> 
> We prefer to use DHCP and it works very well. Umhh... almost, except...
> 
> Depending on the compiler/linker version, the stack space that is
> allocated for the DHCP client may be too small.
> 
> Change to ethernut-x.y/nutbld, add
> 
> HWDEF+=-DNUT_THREAD_DHCPSTACK=512
> 
> to UserConf.mk and run
> 
>  make clean all install
> 
> I assume, that your toolchain binaries are reachable from the PATH
> environment.
> 
> 
> Regards,
> 
> Harald
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 

Hello,

just to be sure, I tested today with a clean install of the toolchain, 
only enabled NUTDEBUG in pro/dhcpc.c and started the webdemo from 
basemon. Im working under Ubuntu with avr-gcc (GCC) 4.3.4.
Here's the output that I get:

BaseMon 4.2.0
Nut/OS 4.8.9.0
Compiled by AVRGCC for ATmega128
Baudrate select = 95
External RAM Test... 28416 bytes
Banked RAM Test...   none
Serial FLASH...      0 bytes
Detecting NIC...     RTL8019AS
Testing NIC...       OK
I/O Port Test...     OK

Press any of the following keys:
     B - Send broadcasts
     E - Ethernet controller read/write
     J - Jump to bootloader
     S - SRAM read/write
     X - Exit BaseMon, configure network and start WebServer

MAC address (00069801101A):
Host name (nn18004):
IP address (0.0.0.0):
Using DHCP or ARP method (Y):



[1.DHCP-INIT]
[1.DHCP-REBOOTING 192.168.181.200][DHCP-Send to 
255.255.255.255][DHCP-Recv Timeout 4000]
[2.DHCP-REBOOTING 192.168.181.200][DHCP-Send to 
255.255.255.255][DHCP-Recv Timeout 8000]
[3.DHCP-REBOOTING 192.168.181.200][DHCP-Send to 
255.255.255.255][DHCP-Recv from 
aaa.bbb.ccc.ddd][DHCP-Opt-53][DHCP-Opt-54][DHCP-Opt-51][DHCP-Opt-1][DHCP-Opt
[4.DHCP-BOUND 12][DHCP-Config 192.168.181.200]MAC  00-06-98-01-10-1A
IP   192.168.181.200
Mask 255.255.255.0
Gate 192.168.181.250
HTTP server running. URL http://192.168.181.200/

[1.DHCP-BOUND 12]
[1.DHCP-BOUND 640]
[1.DHCP-ERROR 1]


After 640 seconds the dhcpc-thread reaches line 1476 and doesn't
recover from the idle state anymore.

             if (dhcpApiTimeout <= tt) {
                 dhcpError = DHCPERR_TIMEOUT;
                 dhcpState = DHCPST_IDLE;
                 continue;
             }

The lease is still valid for about 8hrs, but it is not renewed.

In earlier tests I already increased NUT_THREAD_DHCPSTACK to 512, but it 
didn't help. Though I have a little relief now, because our network guys 
made an exception for the ethernuts, it would be cool to have dhcp 
working. Next I will setup an own dhcp-server with a short lease-time 
for testing and see if the problem persists.

Regards,
Michael



More information about the En-Nut-Discussion mailing list