I am using an RCM4310 in a customer’s application and use the web interface for setting the IP address. I save the value in user flash in the CGI method as below:
case CGI_DATA:
if ( !strcmp(FieldName,"IPadd") ) {
strncpy(NewIP, http_getData(s), 15);
NewIP[http_getDataLength(s)] = '\0'; //
if ( !inet_addr( NewIP ) ) // bad address
strcpy(NewIP,szIPadd); // reset NewIP for CGI_EOF
} // FiledName = IPAdd
break;
This is the CGI_EOF section…
case CGI_EOF:
// Since we use switchCGI, there is no need to return CGI_DONE.
if ( strcmp(szIPadd,NewIP) ) { // changed
http_abortCGI(s); // will cause broswer to dump out
lwIPadd = inet_addr( NewIP );
ifconfig(IF_ETH0, IFS_DOWN,
IFS_IPADDR, lwIPadd,
IFS_UP,
IFS_END);
writeUserBlock( IPBase, NewIP, 16 );
strcpy(szIPadd, NewIP);
break;
}
http_switchCGI(s, "/fw/config.shtml");
break;
I have tested it with all 4 private LAN ranges and it works fine. The customer has tried to change the address and the unit stops working. I have one of the ‘bad’ units and reloaded the firmware. I can run it in debug mode and the application is running but cannot access the web page. I can’t even ping the default address that I load in the program.
Here are my default eth settings:
#define ETH_MTU 1000
#define BUFF_SIZE (ETH_MTU-40)
#define TCP_BUF_SIZE ((ETH_MTU-40)*4)
#define TCPCONFIG 1
#define MY_NETMASK “255.255.255.0”
#define _PRIMARY_STATIC_IP “192.168.0.44”
Is there a way to reset to factory defaults?
What would cause the ethernet port to stop working?
Thank you,
Sam Virgillo
samv@sprynet.com