Ok, let me tell you more detailed what I've done.
I'm using a Wemos D1 Mini which usually will be flashed with 4M1M version of ESPEasy.
I've configured VSCode according to this tutorial:
https://espeasy.readthedocs.io/en/lates ... g-custom-h
I've created the Custom.h and edited the following lines:
Code: Select all
#undef DEFAULT_SSID
#define DEFAULT_SSID "mySSID" // Enter your network SSID
#undef DEFAULT_KEY
#define DEFAULT_KEY "myPassword" // Enter your network WPA key
#define DEFAULT_CONTROLLER_ENABLED true // Enable default controller by default
#define DEFAULT_CONTROLLER_USER "openhabian" // Default controller user
#define DEFAULT_CONTROLLER_PASS "password" // Default controller Password
#undef DEFAULT_PUB
#define DEFAULT_PUB "%sysname%/%tskname%/%valname%" // Enter your pub
#undef DEFAULT_SUB
#define DEFAULT_SUB "%sysname%/#" // Enter your sub
#undef DEFAULT_SERVER
#define DEFAULT_SERVER "100.1.18.59" // Enter your Server IP address
#undef DEFAULT_SERVER_USEDNS
#define DEFAULT_SERVER_USEDNS false // true: Use hostname. false: use IP
#define DEFAULT_USE_EXTD_CONTROLLER_CREDENTIALS false // true: Allow longer user credentials for controllers
#undef DEFAULT_PORT
#define DEFAULT_PORT 1883 // Enter your Server port value
#define DEFAULT_PROTOCOL 5 // Protocol used for controller communications
#undef DEFAULT_USE_NTP
#define DEFAULT_USE_NTP true // (true|false) Use NTP Server
#undef DEFAULT_NTP_HOST
#define DEFAULT_NTP_HOST "ourntpserver.com" // NTP Server Hostname
#define DEFAULT_TIME_ZONE 120 // Time Offset (in minutes)
Then I've added this to platformio.ini (although it's not necessary as I found out, the Custom.h has to exist and that's enough):
[build_flags = -DUSE_CUSTOM_H
During building VSCode correctly says that Custom.h exists and will be used:
C:/Users/myuser/Downloads/ESPEasy-mega/ESPEasy-mega/src/ESPEasy.ino:18:5: warning: #warning "**** Using Settings from Custom.h File ***" [-Wcpp]
# warning "**** Using Settings from Custom.h File ***"
^
I've selected the environment custom_ESP8266_4M1M in Platformio and selected it also as project environment (at the bottom of the VSCode window).
Then I clicked on "Build" in the environments menu. After uploading it there's still the old WIFI credentials in flash memory, so I make a hardware reset on the Wemos D1 mini and restart it, afterwards WIFI credentials are set to the default ones and the Wemos gets connected.
Anyway, the other settings are not complete, p.e. the conteroller is set to 5 (MQTT OpenHab) but the controller's port is set to "1" instead of "1883" and so on. I really do not find out why not every setting is being set.
When I try to load the settings from another Wemos D1 mini which is configured already I have the same problem, some settings won't be updated correctly.