Setting IP, Gateway IP, and Netmask

Wi-Fi is a separate network interface and so it has its own IP address, which is set using the wln.ip property. This address is different from the IP address of the Ethernet interface (see net.ip). We noticed that many people find it "unusual" that a Tibbo hardware device could have two IP addresses. In fact, this is completely normal. On a PC, every network interface has an IP of its own as well.

Technically speaking, the IP address configuration can be done at any time. This topic has been placed into this section to remind you that the IP of the wln. object has to be set, if not right after the boot, then at a later point. If your application uses a static IP, then setting it in the boot section of your code is a good idea. If the application obtains the IP address through DHCP, then the IP can only be set after communicating with the DHCP server, and this will only be possible after associating with an access point. You may even need to set the IP address repeatedly if your product switches between different networks (access points).

There are also wln.gatewayip and wln.netmask properties that may need to be set along with the IP address. This is optional and is only required if your device will have to establish outgoing connections to the network hosts outside of your LAN.

Note that IP, gateway IP, and the netmask of the Wi-Fi interface can't be set when there is at least one socket in your system that is currently not closed and operates on the Wi-Fi interface (sock.statesimple<> 0- PL_SSTS_CLOSED and sock.currentinterface= 2- PL_SOCK_INTERFACE_WLN).


Our DHCP library can handle IP, gateway IP, and netmask configuration both for the Ethernet (net.) and Wi-Fi (wln.) interfaces of your device. Use it and save yourself a ton of work!