View previous topic :: View next topic |
Author |
Message |
spesh
Joined: 28 Mar 2006 Posts: 10
|
DHCP Problems with PICDEM.NET 2 running CCS TCP/IP Stack |
Posted: Thu Feb 14, 2008 2:18 pm |
|
|
I'm developing a web server app on the PICDEM.NET 2 development board and have used CCS Ex14 as the starting point. I've managed to get the example working on the PICDEM.NET 2 by editing the code to reflect the hardware differences but I've tried to add DHCP support without success (by adding STACK_USE_DHCP).
I'm using the external Ethernet controller (ENC28J60) as opposed to the onboard one on the PIC18F97J60 if that makes any difference.
The server works fine using a static IP address but DHCP doesn't work when I connect to the company network.
Has anyone had any similar experience or got any suggestions as to where I'm going wrong ? |
|
![](templates/subSilver/images/spacer.gif) |
Bob Sacamano
Joined: 17 Jan 2008 Posts: 16 Location: Somewhere Cold, USA
|
|
Posted: Thu Feb 14, 2008 3:52 pm |
|
|
It's possible you'll have to add another UDP socket to your stack. I don't believe the CCS stack automatically allocates sockets when you enable/disable modules.
I believe the define you need to edit is called MAX_UDP_SOCKETS (as opposed to MAX_SOCKETS which is for TCP sockets only). Increase the value of that define by 1 or 2 (each UDP socket only consumes a couple of bytes of RAM) and see if that works.
Do you have a network sniffer (wireshark) installed on a PC to see whether or not the PIC is actually sending out DHCP requests? DHCP is all done on a broadcast basis, so you should be able to see the entire transaction on your PC.
Other than that, there may be some debugging printf statements that are defined out or commented. If you activate them, you may get some insight into where it's failing. _________________ "And you want to be my latex salesman." |
|
![](templates/subSilver/images/spacer.gif) |
spesh
Joined: 28 Mar 2006 Posts: 10
|
|
Posted: Fri Feb 15, 2008 3:34 am |
|
|
Thanks for the suggestions Bob. I'll give that a try when I'm back Monday. |
|
![](templates/subSilver/images/spacer.gif) |
spesh
Joined: 28 Mar 2006 Posts: 10
|
|
Posted: Tue Feb 19, 2008 4:11 am |
|
|
Further to my question, I checked the MAX_UDP_SOCKETS and that was defined as 2 so OK but still no IP address.
I installed DHCP Turbo on my PC and connected directly to the PICDEM board (via crossover cable) and hey presto, it worked. However, connecting to the company network does work.
Unfortunately, I don't understand enough about networks to know why it might not work.
If I load the original Microchip code into the board as it was supplied, it acquires an IP address OK so it isn't a hardware issue.
Any ideas ? |
|
![](templates/subSilver/images/spacer.gif) |
joven
Joined: 30 Jan 2007 Posts: 56 Location: Viana do Castelo - Portugal
|
|
Posted: Tue Feb 19, 2008 5:42 am |
|
|
maybe in your company is using switch witch "ARP spoofing"
This problem have happened too. |
|
![](templates/subSilver/images/spacer.gif) |
|