AW: [En-Nut-Discussion] Nut/OS Ver. 4.2.2 DHCP Problem on ethernut3.0d?

Ernst Stippl ernst at stippl.org
Sun Jan 22 09:50:41 CET 2006


Hi Jesper!

Just as a workaround (and because I dont have a DHCP server at home) I
changed httpd:

Added:

u_char mac[] = { MYMAC };           //ES added at beginning of "main"
u_long ip_addr = inet_addr(MYIP);   //ES added at beginning of "main"
u_long ip_mask = inet_addr(MYMASK); //ES added at beginning of "main"


Replaced:

    /*
     * LAN configuration using EEPROM values or DHCP/ARP method.
     * If it fails, use fixed values.
     */
    if (NutDhcpIfConfig("eth0", 0, 60000)) {
        u_char mac[] = { MYMAC };
        u_long ip_addr = inet_addr(MYIP);
        u_long ip_mask = inet_addr(MYMASK);

        puts("EEPROM/DHCP/ARP config failed");
        NutNetIfConfig("eth0", mac, ip_addr, ip_mask);
    }
By:

        NutNetIfConfig("eth0", mac, ip_addr, ip_mask);


That will not help diagnosing any DHCP Problem (or whatever it is you are
experiencing) , but it will let you test httpd. I added possible (for my
net) values to the #define for MYMAC MYIP and MYMASK, too.

Regards
Ernst

-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Jesper Hansen
Gesendet: Samstag, 21. Jänner 2006 23:52
An: Ethernut User Chat (English)
Betreff: Re: [En-Nut-Discussion] Nut/OS Ver. 4.2.2 DHCP Problem on
ethernut3.0d?

There seems to be something with the eeprom struct or something.
Considering that there IS no eeprom, it could be the cause.

My 3.0 board correctly startup and gets a DHCP assigned address at boot
time, but apps such as httpd doesn't work. It complains at start that it
cant get an IP, and then don't go any further.

Haven't had time to look into why, but I'm sure it's a simple change in the
httpd example.


/Jesper

Kroum Vassilev wrote:
> Hi Guys,
> 
> is there a known DHCPC problem on 3.0?
> My app is not getting a valid IP from DHCP server.
> But the same app is running perfectly on the AVR platform, 2.1?
> 
> regards
> Alex
> (Kroum Vassilev)
> 
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> 
> 
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list