wifiesp library and mode

The esp8266 wifi libraries are a bit confusing as it is not always clear whether they are for a esp8266 board like the WEMOS of for a 'normal' Arduino board with a esp8266 module attached.

I work with a Arduino Mega with a esp8266 module attached and the library to use seems to be the WifiEsp.h. I have most features working, but it escapes me how to both run a server and a client in the same sketch. With AT commands, I would use 'AT+CWMODE=3, but with the WifiESP library I cannot check or set the AP mode.

Can anybody help me or am I on the wrong track?

Paai

AP mode is something else as server… you can run a server with WiFiEsp library but you can’t start AP

Dear Sir, knowing the details of various systems such as the AT command set or the jumptable in the BDOS of the CP/M system is a different kind of knowledge from computer languages and the concepts of programming. The last example may give you an idea how long I have been working with computers. And as a retired professor in CS, I feel obliged to point out where you went wrong. But this is neither the place or time to elaborate on that.

So I understand that the AP settings have nothing to do with using the board as client or server. Good. I learnt something new today.

you will learn Arduino fast.

of course you can set the AP mode with AT commands, but you would need to change the WiFiEsp library if you want to use it with AP mode, because the library sets the STA mode in init.

but better is not to use AT command and program the esp8266 with Arduino

A Beginner's Guide to the ESP8266