Optional DHCP at run-time

I want to make an application that can be configured for either DHCP or static address at boot time. I can’t find a sample to do this. Can someone point me to such an example?

I’m not talking about DHCP with fallback. When I say “static” I mean that the device will use the specified address even if there is a DHCP server on the network.

I want to make an application that can be configured for either DHCP or static address at boot time. I can’t find a sample to do this. Can someone point me to such an example?

I’m not talking about DHCP with fallback. When I say “static” I mean that the device will use the specified address even if there is a DHCP server on the network.

Did you ever get an answer to this or get it working?

It seems to me (after many hours of trial and error!!!) that you can’t simply set static IP mode and ignore DHCP. Like you I need to let a user select static mode even when a DHCP server is present.

Cliff

So I continued fighting the problem and found an answer.

The trick is shown below. The #defines are the vital bits.

TCPCONFIG 1

#define _PRIMARY_STATIC_IP IPAddress
#define _PRIMARY_NETMASK IPNetmask
#define IFC_WIFI_SSID SSID

Actually only the first two defines are needed. In case you are wondering IPAddress, IPNetmask and SSID are variables declared as char[64] (or whatever size you want). I read them out of EEPROM at boot up, before bringing up the Wireless.

If you do the above then IFS_DHCP switches DHCP on and off even if a server is present on the network. For the record I’m using DC10.64 and my hardware is an RCM5600W.

Rabbit badly need an example to show DHCP/static IP selection. Anyone using the module will surely need to allow a user to switch between the two.