How to indicate a specific ip for auto-ip rather than random generation

i want to use a fix ip when board can’t retrieve ip from dhcp.
so i enable auto-ip to setup a ip if dhcp not found.
but the auto-ip random generate 169.254.x.x for ip address.

i want to indicate a fix ip, for example:
i try to modify the definition in
etos73\src reck\include rmacro.h as below
#define TM_IP_LOCAL_NET 0xC0A80000
#define TM_IP_LOCAL_FIRST 0xC0A80164
#define TM_IP_LOCAL_LAST 0xC0A80164
then rebuild… but it doesn’t work :stuck_out_tongue:

how to change the ip address for auto-ip? :frowning:


Message was edited by: joy

you can’t specify an Auto-IP address, but you can specify a Static IP address. I’d do the following:

  • setup the module for dhcp / remove autoip (this has to be done programically using the IAM functions, see the API reference if you’re not familiar with it)

  • set BSP_WAIT_FOR_IP_CONFIG in bsp_net.h to false

  • do a sleep/check loop at the start of applicationStart (customizeIamGetIfAddrInfo) to see if you’ve gotten an IP address. If you don’t get one by the time you decide to timeout, set a static IP and use naIamDisable / naIamEnable to restart the interface.

thanks for your suggestion.
i will try your solution. :smiley: