I started printing an enclosure for this project and while it was printing, I had a go at converting a gate opener sketch which used ap mode for direct connection, to enable deep sleep.
My problem now is the wemos will not go out of ap mode. No matter what sketch I upload, it creates an ap named what ever the last ap sketch was.
I've been googling all day and have tried
ESP8266WiFiMulti wifiStation;
WiFiClient client;
ESP8266WiFi.mode(wifi.STATION);
wifi.mode(STATION);
etc.
Nothing seems to work.
The libraries I used on the ap sketch are
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WebSocketsServer.h>
#include <Hash.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
I have even started think about reloading the firmware in an attempt to overwrite the ap mode.
Any help would be appreciated.