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 CCS Technical Support

HELP! Configure Manually IP from ex_stWebserver.c

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Rodrigo Rios A de Souza



Joined: 30 Apr 2010
Posts: 10

View user's profile Send private message Send e-mail MSN Messenger ICQ Number

HELP! Configure Manually IP from ex_stWebserver.c
PostPosted: Fri Jun 25, 2010 9:35 am     Reply with quote

Hello,

I really need some help here.
Hi guys, I´m having some problems when trying to configure manually the IP address of ex_stwebserver.c and ex_st_webserver2.c examples that come with CCS Embedded Ethernet.
It seems that the webserver examples only work with DHCP enabled.

I tried to change the Lines in code Hardware.h manually.
to my IP addresses. Nothing happened.
----------------------------------------------------------------------
#define MY_DEFAULT_IP_ADDR_BYTE1 192 //IP ADDRESS
#define MY_DEFAULT_IP_ADDR_BYTE2 168 // This unit's IP address.
#define MY_DEFAULT_IP_ADDR_BYTE3 0
#define MY_DEFAULT_IP_ADDR_BYTE4 15

#define MY_DEFAULT_MASK_BYTE1 255 //NETMASK
#define MY_DEFAULT_MASK_BYTE2 255 // Netmask tells the IP / ARP stack which
#define MY_DEFAULT_MASK_BYTE3 255 // IP's are on your local network.
#define MY_DEFAULT_MASK_BYTE4 0

#define MY_DEFAULT_GATE_BYTE1 192 //GATEWAY IP ADDRESS
#define MY_DEFAULT_GATE_BYTE2 168 // Gateway acts as a conduit between two networks.
#define MY_DEFAULT_GATE_BYTE3 0
#define MY_DEFAULT_GATE_BYTE4 1

-------------------------------------------------------

and I also changed the ex_webserver2.c file.

#if STACK_USE_MAC
#define STACK_USE_DHCP FALSE //for auto resolution of IP address
#define STACK_USE_ARP TRUE //needed to resolve MAC addresses of IP addresses
#define STACK_USE_UDP TRUE //needed for dhcp and announce
#define STACK_USE_ANNOUNCE TRUE //announce our IP periodically to the network
#endif

After these Changes. the LCD output the IP Address of 0.0.0.0 .
And I can´t access the WEbserver.

But If I DEFINE DHCP Enabled in ex_st_Webserver2.c everything comes to normal?
Any Suggestions?

Rodrigo Rios
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 25, 2010 12:59 pm     Reply with quote

There are two versions of the hardware.h file in the TCP-IP directory:
Quote:

c:\program files\picc\tcp-ip\pic examples source\drivers\hardware.h
c:\program files\picc\tcp-ip\pic examples source\tcpip\hardware.h

Are you sure that you changed the correct file ?
Rodrigo Rios A de Souza



Joined: 30 Apr 2010
Posts: 10

View user's profile Send private message Send e-mail MSN Messenger ICQ Number

Help with Disabling DHCP on ex_st_webserver2
PostPosted: Fri Jun 25, 2010 1:29 pm     Reply with quote

I've changed both. Nothing happened.

Can you help me?
SimpleAsPossible



Joined: 19 Jun 2004
Posts: 21

View user's profile Send private message

Maybe something simple?
PostPosted: Wed Jun 30, 2010 7:53 am     Reply with quote

Did you call IPAddrInit() as part of your initialization? I usually have it right before StackInit().
dpechman



Joined: 04 Dec 2007
Posts: 43

View user's profile Send private message Visit poster's website

PostPosted: Sun Jan 29, 2012 7:06 pm     Reply with quote

once I have initiated my program with STACK_USE_DHCP 1 how can I disable it in runtime?

I want to setup in eeprom a byte to enable/disable DHCP like.

if(read_eeprom(0)){
usingDhcp = 1;
}else{
usingDhcp = 0;
}
dpechman



Joined: 04 Dec 2007
Posts: 43

View user's profile Send private message Visit poster's website

PostPosted: Sun Jan 29, 2012 7:44 pm     Reply with quote

seems to work this way to disable DHCP:

smDHCPState = SM_DHCP_DISABLED;

and to enable it again

smDHCPState = SM_DHCP_INIT_FIRST_TIME;

just not sure if it is the right way to do
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