How do I disable broadcast mode in ESP32 devices using IoT?

I have just noticed, not sure how long it's been the case, that all of my current ESP8266 IoT Cloud enabled devices (running the 'stock' sketch) are all broadcasting a ESP_xxxxxxx WiFi connection hotspot.

Is this intentional, and why are they broadcasting? Of the 50+ ESP devices in my current network, there are the only ones doing do (when not in initial setup mode).

How can I turn this off? Can I turn this off? I need to check if my other project using these ESP8266 boards has the same result.

EDIT: Okay it appears it might be a D1 Mini thing, as it's a DEV board. Where I need to configure the device to appropriate WiFi Mode (not broadcast). Though I'm unsure where I place this within the IoT Cloud code.

See below, I need to define wifi.setmode(wifi.STATION)

wifi.setmode(mode)

Parameters

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

Returns

current mode after setup

Okay, I've changed the title to a better one.

I would have to assume other Arduino Dev boards have various AP/hotspot functionality built into them too, how do I go about using the IoT libraries and turn off the broadcast/AP functionality of the Dev function in a ESP8266 (D1 Mini) board.

I can see options when using the 'standard' Wifi libraries, but can't seem to find syntax for IoT libraries.

I had to add the following to the end of the setup process

WiFi.mode(WIFI_STA);

Actually didn't help, as it does turn off the AP broadcast. I now get it disconnecting and these errors/messages:

ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 9 connection attempt at tick time 613501

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.