I figured out how to edit the pubsub file however the whole thing won’t complie for me due to the following errors. Could you please help me out here @maragelis ? Unfortunately Arduino isn’t my strong point.
Arduino: 1.8.4 (Windows 8.1), Board: “WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)”
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp: In member function ‘void WiFiManager::setupConfigPortal()’:
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:146:71: error: no matching function for call to ‘ESP8266WebServer::on(String, std::_Bind_helper<false, void (WiFiManager::)(), WiFiManager const>::type)’
server->on(String(F(“/”)), std::bind(&WiFiManager::handleRoot, this));
^
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:146:71: note: candidates are:
In file included from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.h:17:0,
from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:13:
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: void ESP8266WebServer::on(const char*, ESP8266WebServer::THandlerFunction)
void on(const char* uri, THandlerFunction handler);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: no known conversion for argument 1 from ‘String’ to ‘const char*’
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: candidate expects 3 arguments, 2 provided
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: candidate expects 4 arguments, 2 provided
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:147:81: error: no matching function for call to ‘ESP8266WebServer::on(String, std::_Bind_helper<false, void (WiFiManager::)(unsigned char), WiFiManager const, bool>::type)’
server->on(String(F(“/wifi”)), std::bind(&WiFiManager::handleWifi, this, true));
^
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:147:81: note: candidates are:
In file included from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.h:17:0,
from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:13:
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: void ESP8266WebServer::on(const char*, ESP8266WebServer::THandlerFunction)
void on(const char* uri, THandlerFunction handler);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: no known conversion for argument 1 from ‘String’ to ‘const char*’
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: candidate expects 3 arguments, 2 provided
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: candidate expects 4 arguments, 2 provided
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:148:83: error: no matching function for call to ‘ESP8266WebServer::on(String, std::_Bind_helper<false, void (WiFiManager::)(unsigned char), WiFiManager const, bool>::type)’
server->on(String(F(“/0wifi”)), std::bind(&WiFiManager::handleWifi, this, false));
^
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:148:83: note: candidates are:
In file included from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.h:17:0,
from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:13:
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: void ESP8266WebServer::on(const char*, ESP8266WebServer::THandlerFunction)
void on(const char* uri, THandlerFunction handler);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: no known conversion for argument 1 from ‘String’ to ‘const char*’
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: candidate expects 3 arguments, 2 provided
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: candidate expects 4 arguments, 2 provided
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:149:83: error: no matching function for call to ‘ESP8266WebServer::on(String, std::_Bind_helper<false, void (WiFiManager::)(), WiFiManager const>::type)’
server->on(String(F(“/wifisave”)), std::bind(&WiFiManager::handleWifiSave, this));
^
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:149:83: note: candidates are:
In file included from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.h:17:0,
from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:13:
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: void ESP8266WebServer::on(const char*, ESP8266WebServer::THandlerFunction)
void on(const char* uri, THandlerFunction handler);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: no known conversion for argument 1 from ‘String’ to ‘const char*’
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: candidate expects 3 arguments, 2 provided
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: candidate expects 4 arguments, 2 provided
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:150:72: error: no matching function for call to ‘ESP8266WebServer::on(String, std::_Bind_helper<false, void (WiFiManager::)(), WiFiManager const>::type)’
server->on(String(F(“/i”)), std::bind(&WiFiManager::handleInfo, this));
^
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:150:72: note: candidates are:
In file included from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.h:17:0,
from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:13:
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: void ESP8266WebServer::on(const char*, ESP8266WebServer::THandlerFunction)
void on(const char* uri, THandlerFunction handler);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: no known conversion for argument 1 from ‘String’ to ‘const char*’
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: candidate expects 3 arguments, 2 provided
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: candidate expects 4 arguments, 2 provided
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:151:73: error: no matching function for call to ‘ESP8266WebServer::on(String, std::_Bind_helper<false, void (WiFiManager::)(), WiFiManager const>::type)’
server->on(String(F(“/r”)), std::bind(&WiFiManager::handleReset, this));
^
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:151:73: note: candidates are:
In file included from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.h:17:0,
from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:13:
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: void ESP8266WebServer::on(const char*, ESP8266WebServer::THandlerFunction)
void on(const char* uri, THandlerFunction handler);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: no known conversion for argument 1 from ‘String’ to ‘const char*’
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: candidate expects 3 arguments, 2 provided
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: candidate expects 4 arguments, 2 provided
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:153:77: error: no matching function for call to ‘ESP8266WebServer::on(String, std::_Bind_helper<false, void (WiFiManager::)(), WiFiManager const>::type)’
server->on(String(F(“/fwlink”)), std::bind(&WiFiManager::handleRoot, this)); //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
^
C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:153:77: note: candidates are:
In file included from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.h:17:0,
from C:\Users\David\Documents\Arduino\libraries\WiFiManager\WiFiManager.cpp:13:
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: void ESP8266WebServer::on(const char*, ESP8266WebServer::THandlerFunction)
void on(const char* uri, THandlerFunction handler);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:78:8: note: no known conversion for argument 1 from ‘String’ to ‘const char*’
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:79:8: note: candidate expects 3 arguments, 2 provided
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: void ESP8266WebServer::on(const char*, HTTPMethod, ESP8266WebServer::THandlerFunction, ESP8266WebServer::THandlerFunction)
void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
^
C:\Users\David\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:8: note: candidate expects 4 arguments, 2 provided
exit status 1
Error compiling for board WeMos D1 R2 & mini.
This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.
EDIT (AGAIN): I am getting nowhere with this. Could someone please help by either letting me know what I’m doing wrong, or compiling the code into a binary for me so I can just flash that to the wemos…?
EDIT: I am super happy to report that I finally have my Wemos D1 mini programmed with the awesome work of @maragelis. Now I just need to work out how to get that mqtt data into HA and acting as part of the alarm system I already have within it. Thanks you @maragelis for this and sorry for my long messages of frustration above!