CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

DHCP Problems with PICDEM.NET 2 running CCS TCP/IP Stack

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
spesh



Joined: 28 Mar 2006
Posts: 10

View user's profile Send private message

DHCP Problems with PICDEM.NET 2 running CCS TCP/IP Stack
PostPosted: Thu Feb 14, 2008 2:18 pm     Reply with quote

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 ?
Bob Sacamano



Joined: 17 Jan 2008
Posts: 16
Location: Somewhere Cold, USA

View user's profile Send private message

PostPosted: Thu Feb 14, 2008 3:52 pm     Reply with quote

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."
spesh



Joined: 28 Mar 2006
Posts: 10

View user's profile Send private message

PostPosted: Fri Feb 15, 2008 3:34 am     Reply with quote

Thanks for the suggestions Bob. I'll give that a try when I'm back Monday.
spesh



Joined: 28 Mar 2006
Posts: 10

View user's profile Send private message

PostPosted: Tue Feb 19, 2008 4:11 am     Reply with quote

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 ?
joven



Joined: 30 Jan 2007
Posts: 56
Location: Viana do Castelo - Portugal

View user's profile Send private message

PostPosted: Tue Feb 19, 2008 5:42 am     Reply with quote

maybe in your company is using switch witch "ARP spoofing"

This problem have happened too.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group