Internal Ethernet Library - DHCP

General discussion on mikroC PRO for FT90x.
Post Reply
Author
Message
alanp
Posts: 27
Joined: 18 Feb 2013 14:22

Internal Ethernet Library - DHCP

#1 Post by alanp » 04 Nov 2015 05:43

HI,

I am having trouble with using DHCP in Int ethernet lib
I have set the mac address as 00:14:A5:74:19:3f and an IP address of 0.0.0.0.

I am calling
Ethernet_Intern_Init(myMacAddr, myIpAddr, _ETHERNET_CFG_SPD100 | _ETHERNET_CFG_FULLDUPLEX); where myMacAddr and myIPAddr equate to above.
Ethernet_Intern_enable(_ETHERNET_FILTER_TYPE_CRC | _ETHERNET_FILTER_TYPE_MULTICAST);
i am then trying to request DHCP using
while (1) {
Ethernet_Intern_initDHCP(5); // get network configuration from DHCP server, wait 5 sec for the response
}

no Ip address is being received and I am not even seeing the request go out onto network (using Wireshark).

Am I missing something?


thanks

If I manually enter the IP address. Interface works and is pingable.

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: Internal Ethernet Library - DHCP

#2 Post by biljana.nedeljkovic » 05 Nov 2015 14:29

Hello,

as I have already answered you to the helpdesk, I suggest to continue our conversation there and leave this topic open in case someone has the similar problem or advice for you.

Kind regards,
Biljana

alanp
Posts: 27
Joined: 18 Feb 2013 14:22

Re: Internal Ethernet Library - DHCP

#3 Post by alanp » 08 Nov 2015 16:25

Hi
I fixed the timer by enabling interrupts :oops:

DHCP is now delivering Ip address and unit is now pingable.

However I am unable to fetch IP address using Ethernet_Intern_getIPAddress function.
I am trying to write the IP address to console using UART1_Write but it is delivering 00s.
The debugger shows that the correct IP address is located at Ethernet_Intern_IpAddr.

Can anyone suggest how to get this working.
The memcpy routine Ethernet_Intern_getIpAddress() listed in Library doesn't seem to do the job.
I probably have my pointer syntax wrong.
thanks

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: Internal Ethernet Library - DHCP

#4 Post by biljana.nedeljkovic » 09 Nov 2015 15:46

Hello,

I have answered you at the helpdesk. Please answer there.

Kind regards,
Biljana

Post Reply

Return to “mikroC PRO for FT90x General”