Static IP address in STA mode

Hi,

We don’t want to set up static IP address from Router side.
With AmebaD standard SDK, is it possible to force request static IP address from Ameba side to Router in STA mode ?

Regards,

do you need a static IP or dynamic one?

@xidameng
Thank you for your reply.

We need static IP address.

We don’t want to set up static IP address from Router side.

What I mean on above is, normally if we need static IP address we have to set up from Router side.
Is it possible to force request by from Ameba side without any Router set up ?

Regards,

You might want to try using WiFI::config to set a local IP address. This would probably require that the DHCP server on the router is disabled, otherwise the router might assign a different IP address, which would mean that all other devices connected to the same router would need to have their IP addresses set correctly to avoid conflicting IPs.

@wyy
Thank you for reply.
Do you mean that I have to config from Wi-Fi Router side right ? We cannot force it from Ameba side right ?

Regards,

@ruanjanc
You have to configure the router to allow for devices to define their own IP addresses, before you can define it in Ameba.
Otherwise, most routers are configured to use DHCP by default, in which the router is in charge of allocating IP addresses.

My suggestion is that if you only have one device out of many that needs a fixed IP address, it is easier to configure the router to link a specific IP address to the device’s MAC address.

1 Like
You have to configure the router to allow for devices to define their own IP addresses, before you can define it in Ameba.
Otherwise, most routers are configured to use DHCP by default, in which the router is in charge of allocating IP addresses.

Understood, may I know with AmebaD standard SDK how I can define IP in Ameba ?

My suggestion is that if you only have one device out of many that needs a fixed IP address, it is easier to configure the router to link a specific IP address to the device’s MAC address.
This is the solution that we did, but requirement is don’t want Router side to link a specific IP via MAC address.

Regards,

@wyy
More information, Router side already reserve IP range for Ameba devices.
So, with AmebaD standard SDK how I can define IP in Ameba ?

Regards,

@ruanjanc

You can set IP addresses in \project\realtek_amebaD_va0_example\inc\inc_hp\main.h, and when configuring LwIP, call LwIP_UseStaticIP instead of LwIP_DHCP

1 Like

@wyy
Thank you for quick reply, I will try it.

Best regards,