Perhaps someone can help with a esp / arduino question

perhaps no one noticed or perhaps its just me - but every time one creates an new device with esp under arduino IDE as client, it creates a secondary AP using the ESP chip ID as the SSID. ( with LUA you do not have this issue)… I was wondering does anyone know how to stop that from happening… as it a little bothersome as if I create 6 esp clients under arduino I end up with 6 new SSID all on the same channel as what ever my client channel is. and it plays havoc with the wifi as it reaches saturation…
even worse it creates open connection, and dhcp is enabled so you can log into these devices remotely to boot

Not much to go on here, so point me at the code. I don’t understand what you mean by creating a new device. What you are describing sounds like WiFiManager attempting to establish a connection to a WiFi network. But that doesn’t add up because, although I have never tried six, the published limit for ESP connections is five.

Maybe you should try looking at/running some of the example sketches provided in the Arduino IDE.

I believe the WiFi config is stored in flash as part of the the WiFi library in the ESP8266 Arduino Core, and will be restored to the previous state if not told explicitly to do something different. I am still trying to find a good example of how to properly work with this.

does not matter what arduino code one uses. from what I see if it is espwifi set in client mode. it creates an additional AP at the same time on the same channel … usually with a SSID of something along the line as esp-123456. generally not password locked and DHCP enabled so you get 192.168.4.1 as the gateway
does not matter which esp one uses, nodemcu, wemos,esptoy, generic …etc all do the same. though I believe nodemcu the wifi APis encrypted while the rest are not
example code
https://community.openenergymonitor.org/uploads/default/original/2X/c/c91dcebac6e639f6e818fd625adbd0574b785b1f.zip
but you can see it with just the any default espWIFI mqtt and it will happen.
Its a huge security risk, but also annoying as it causes erratic wifi behaviour. I live remote and I generally would not care for the open wifi. but I wrote alot of stuff primarily in lua… and it seams to have issue with all these SSIDs that are being created by arduino projects (causes it to crash…) it play nice with one esp arduino but as soon as there a second stability goes out the window for LUA-- I can get around it by putting up a separate APs for different types of firmwares. and let arduino stuff fight with arduino stuff and let LUA play nicely with everything else. but it would be nice to just stop the the ESP from creating a needless AP when it in client mode

Yes, the ESP stores the ID of the connection in flash and tries to reconnect at startup and anytime the connection drops. But all of that can be controlled. If you are playing around with ESP and WiFi, I suggest you give this guy $10 and download his book. It’s a treasure trove and addresses these questions.
Kolban’s Book on ESP

Id look at ESP-NOW as a possible cause if it happens when you put two in range of each other. I have three or four running pretty much continuously and have not experienced this problem.

are you running a mix or lua and arduino coded devices or purely arduino coded devices. my issues appeared only when arduino wifi was introduced . my previous LUA coded devices were running rock soild for months. until I started with arduino and esp , now the LUA stuff crashes. recently I pulled all my arduino stuff and all the LUA stuff is rock solid again. and I am pretty sure it the redundant AP that being created. that causing my issues. as I can eliminate the issue by putting it on separate AP . - but in either case I would like to stop the creation of the redundant AP when running as a client

I don’t understand how to put an AP on a separate AP. All of my devices are coded using Arduino/ESP826. Try reading up on Arduino WiFi in Kolban’s book. It is very helpful.

the arduino devices built are all CLIENTS , - they only create a redundant AP under arduino IDE all on the same channel as what ever client connects at( i do not want this AP it just created by default for some reason by arduino IDE and I can not figure out how to stop it it from doing so- as it also poses a high security risk as it creates unsecured backdoor to your network) - there within is the problem. it creates a channel saturation that LUA does not like.

I will admit my 2.4ghz spectrum is fairly congested already. as my connection to the internet is 2.4ghz backhaul to an AP 5 miles away. then that is bridge from there to my house by 2.4ghz( 200 metre) then with in my house there are 2 APs one for my internet usage and one for my devices that all connect to orange pi that is an AP

Once again, read Kolban’s book. He explains how the ESP WiFi works and the system calls to start and stop the AP. My impression of the way it works is that the SDK underpinns all of the layered implementations, including the LUA and arduino/ESP8266. The WiFi runs under that and the SDK has an API set to control it. Most of the Arduino WiFi methods that I have looked under the hood at use those APIs, as I believe the LUA environment does.

You can call any of those functions from the Arduino/ESP8266 environment. You can call any of the SDK functions, you can manipulate the hardware registers (I do that a lot), and I believe you can even insert assembler code.

If you want to get to the bottom of your problem, put together a short sketch that causes this unwanted AP to be created, and make it available so I can see what’s going on. You may be invoking something implicitly that is causing your problem. I’m dubious that it’s a flaw of the Arduino/ESP8266 environment per-se or some reaction to “channel saturation”.

hi bob
here something for you to try. take a brand new esp - in my case it a wemos d2
hook it up

scan your wifi for avalible APs
out of the box it will display default SSID of AI thinker_XXXXX( chip id) it will have not DHCP but you can connect to it but no ip will assigned

no open up arduino IDE grab any the default example for esp wifi as a client sketch i used MQTT and esp Example>PubSupClient > mqtt_esp8266

insert your Wifi details and MQTT server - upload to your ESP.
now check your wifi again. the “AI-THINKER_XXXXX” AP is still there now log onto it it again you now have DHCP enable and you will be assigned 192.168.4.X and a gateway of 192.168.4.1 .

Now I have not checked out how vulnerable this is but in either case you now have a unsecured backdoor to your network.

it a flaw in what adruino and esp works as if you program with LUA you are not left with such a gaping security flaw. I’ve ask at both arduino forum and esp8266 forums it falls on deaf ears as to how to correct this issue

I use nodeMCU 1.0 with the brand Amica. They have AI-Thinker ESP -12. I tried three of them, all brand new just out of the package. If I power them up with a 5V USB supply, they do not broadcast an SSID and do not appear in a scan by either an IOS device or a Windows 10 laptop.

well that weird yet every one I buy out of the box i scan and they all have SSID’s just open a new batch wemos today and did the same. I plugged also in a generic and an esptoy they all scan with a SSID out of the box for me with a windows 7 computer and I did a scan from a commercial radio too in case of a particular quirk of my computer
the ones on corresponding channels relates to the AP it is connected too… I can add more ESP and everyone will display a SSID and I have close 10 different brands from 10 different vendors

ai-thinker_XXXXX wemos
esp_XXXXX esptoy
ESPAP generic

IOT is PI AP
Wii30 normal router AP
FRNetwork internet bridge

I would think most likely your computer is blocking OPEN SSID’s I know windows 10 will do that… do not play with ios that offen can not say for that one

I don’t think so. When I deliberately enable AP mode, it works fine. More likely it has to do with whatever software WeMos is pre-loading onto the boards. Seems like a cumbersome form factor anyway, but I guess it lets you plug your arduino shields directly? Since starting with the ESP, I have no interest in Arduino. Just seems like a toy.

yes you can use arduino shield on them( wemos D2), no use reinventing the wheel- but I have wemos d2, wemos mini, nodemcu v1, 2 and 3 , esptoy, random generics , witty cloud and probably others. and everyone has a SSID at initial boot some on purpose ( esptoy) other as empty boards. the thing is If I flash to LUA as client access ( no SSID is displayed) then later reflash to arduino core as client . it still has the same issue the SSID name will be different but it exhibits the same behaviour… so I do not know why you do not see the same issue. unless it related to my work station as it is a linux machine as I do not generally use windows for security reasons.

but i guess if I can not figure out how to shut that AP downs creation – I should start probing these APs and see how big of a risk they really are.- but really all one has to is most likely telnet in bridge the AP and the client and you have complete access to the internal network

Steven, I’ve been using ESP03s and have never experienced this. Although you have lots of different versions it might be worth going back to basics like an 01 or 03 and seeing if you still have the problem.

Also you could maybe try reflashing the base code as well as your app.

Simon

tried your suggestion - still the same
install newest version of ardunio IDE on window
newest esp core
and pubsubclient
all from with in arduino libary
no different either
still the AP is created when acting as a client
I NMAP the esp AP port 67 is open as expected dhcps- but 5 more come up as filtered so nmap could not determine if it was open or closed. 4 were service ports. 1 was at port 44000 listed as unknown. so there is the possibility that the esp can be compromised –

Is this issue related ?

@Paul – looks to be the same issue

I now even erased my esp using two different methods uploading a blank bin via espflash tool and used esptool.py

   ./esptool.py -p /dev/ttyUSB0 -b 115200 erase_flash

each give identical results. sure after flash it nolonger broadcast SSID at initial boot. but once you reflash with default setting as client you again have the AP but instead of AI-thinker_xxxxx ( chipID – in the case of wemos D2) it now broadcast as ESP_XXXXXX ( chipID)

@stephen do you mean @pb66?

Paul