diff --git a/README.md b/README.md
index 910ce69e..a3fb586b 100644
--- a/README.md
+++ b/README.md
@@ -93,7 +93,7 @@ If your device has a **real time clock** it can be updated bei either LoRaWAN ne
# Building
-Use PlatformIO with your preferred IDE for development and building this code. Make sure you have latest PlatformIO version.
+Use PlatformIO with your preferred IDE for development and building this code. Make sure you have latest PlatformIO version, **at least v4.0.0a15**.
# Uploading
diff --git a/platformio.ini b/platformio.ini
index e42691a4..8cde83eb 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -6,7 +6,7 @@
; ---> SELECT TARGET PLATFORM HERE! <---
[platformio]
-;env_default = generic
+env_default = generic
;env_default = ebox
;env_default = eboxtube
;env_default = ecopower
@@ -24,7 +24,7 @@
;env_default = lolin32litelora
;env_default = lolin32lora
;env_default = lolin32lite
-env_default = wemos32oled
+;env_default = wemos32oled
;env_default = octopus32
;env_default = ecopower, eboxtube, heltec, ttgobeam, lopy4, lopy, ttgov21old, ttgov21new, ttgofox
;
@@ -74,7 +74,10 @@ build_flags_basic =
-include "src/hal/${PIOENV}.h"
-include "src/paxcounter.conf"
-w
- '-DARDUINO_LMIC_PROJECT_CONFIG_H=../../../src/lmic_config.h'
+ ;use this is you have platformio version >= 4.0.0a15
+ '-DARDUINO_LMIC_PROJECT_CONFIG_H=../../../../../src/lmic_config.h'
+ ;use this is you have platformio version < 4.0.0a15
+ ;'-DARDUINO_LMIC_PROJECT_CONFIG_H=../../../src/lmic_config.h'
'-DCORE_DEBUG_LEVEL=${common.debug_level}'
'-DLOG_LOCAL_LEVEL=${common.debug_level}'
'-DBINTRAY_PACKAGE="${PIOENV}"'
diff --git a/src/mbedtls_aes.c b/src/mbedtls_aes.c
index aa481790..23b18a06 100644
--- a/src/mbedtls_aes.c
+++ b/src/mbedtls_aes.c
@@ -10,10 +10,10 @@
* AES encryption using ESP32's hardware AES unit.
*******************************************************************************/
-#include "mbedtls/aes.h"
-#include "lmic/oslmic.h"
+#ifdef USE_MBEDTLS_AES
-#if defined USE_MBEDTLS_AES
+#include "mbedtls/aes.h"
+#include "../../lmic/oslmic.h"
void lmic_aes_encrypt(u1_t *data, u1_t *key)
{