Did you use
setmode() to put it in station mode?
Configures the WiFi mode to use. NodeMCU can run in one of four WiFi modes:
- Station mode, where the NodeMCU device joins an existing network.
- Access point (AP) mode, where it creates its own network that others can join.
- Station + AP mode, where it both creates its own network while at the same time being joined to another existing network.
- WiFi off.
When using the combined Station + AP mode, the same channel will be used for both networks as the radio can only listen on a single channel.
NOTE: WiFi Mode configuration will be retained until changed even if device is turned off.
mode value should be one of
- wifi.STATION for when the device is connected to a WiFi router. This is often done to give the device access to the Internet.
- wifi.SOFTAP for when the device is acting only as an access point. This will allow you to see the device in the list of WiFi networks (unless you hide the SSID, of course). In this mode your computer can connect to the device, creating a local area network. Unless you change the value, the NodeMCU device will be given a local IP address of 192.168.4.1 and assign your computer the next available IP address, such as 192.168.4.2.
- wifi.STATIONAP is the combination of wifi.STATION and wifi.SOFTAP. It allows you to create a local WiFi connection and connect to another WiFi router.
- wifi.NULLMODE to switch off WiFi
current mode after setup