---
title: "Wiznet 5100 aoLibrary DHCP request not working"
url: "https://maker.wiznet.io/forum/12526"
markdown_url: "https://maker.wiznet.io/forum/12526/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "ToasTer86"
created: "2017-10-23T15:31:00+09:00"
last_activity: "2017-10-24T08:50:41+09:00"
language: "en"
views: 895
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Wiznet 5100 aoLibrary DHCP request not working

## Question

Asked by ToasTer86 on 2017-10-23 in Ethernet Chips.

While using the aoLibrary I just can’t get the DHCP on the wiznet 5100 to start working.
I own a ethernetshield for arduino with the wiznet 5100 and it works immediatly using the ethernet libraries.

As of right now this is the basic code structure:

```
spi0_master_init();  
user_ethernet_init();

DHCP_time_handler();  

DHCP_init(DHCP_SERVER_PORT, dhcp_buff);

reg_dhcp_cbfunc(my_ip_assign, my_ip_assign, my_ip_conflict);

while(true){
printf("\r\n Entering DHCP state machine");
    switch (DHCP_run()) {
        case DHCP_IP_ASSIGN:
            printf("\r\nIP assigned");
        
            break;
        case DHCP_IP_CHANGED:
            printf("\r\n IP changed");
            break;
            
        case DHCP_RUNNING:
            printf("\r\n DHCP running");  
            get_network_address();
            dhcp_is_leased = true;
            break;
            
        case DHCP_FAILED:
            printf("\r\n DHCP failed");
            break;
            
        case DHCP_STOPPED:
            printf("\r\n DHCP failed");
            break;
            
        default:
            break;
    }
}
```

void DHCP_time_handler(void)
{
dhcp_tick_1s++;
}

I am not seeing any request for message with wireshark and the loop just keeps returning " DHCP is running " .

I have no idea what I should do with the timer and if I have that correctly set up. I am using the wiznet5100 on a nRF52840

## Replies

### Reply 1 by ToasTer86, 2017-10-24

Well tried more things and got it to work.
Seems I did not have the DHCP set up correctly.

---

Source: https://maker.wiznet.io/forum/12526
