diff --git a/SMRtoMQTT.ino b/SMRtoMQTT.ino index 25ab53c..038563c 100644 --- a/SMRtoMQTT.ino +++ b/SMRtoMQTT.ino @@ -262,7 +262,7 @@ void parseTelegram(char* telegram) tmpValue = ""; tmpValue.reserve(value.length()/2); - for (int i = 0; i < value.length()/2; i++) { + for (size_t i = 0; i < value.length()/2; i++) { value.substring(i*2).getBytes(hexbuf, 3); hexbuf[2] = 0; @@ -331,7 +331,7 @@ void parseTelegram(char* telegram) metricDef* getMetricDef(const char* ident) { - for (int i = 0; i < sizeof(metricDefs)/sizeof(metricDefs[0]); i++) + for (size_t i = 0; i < sizeof(metricDefs)/sizeof(metricDefs[0]); i++) { if (strcmp(ident, metricDefs[i].ident) == 0) { return &metricDefs[i]; diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..21d5788 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,24 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[platformio] +src_dir = . + +[env:default] +platform = espressif8266 +board = d1_mini +framework = arduino +monitor_speed = 115200 +upload_speed = 1000000 +build_flags = -DMQTT_MAX_PACKET_SIZE=1024 +lib_ldf_mode = deep +lib_deps = + PubSubClient +