diff --git a/Software/EmonESP/src/emoncms.cpp b/Software/EmonESP/src/emoncms.cpp index 970bef9..d11b742 100644 --- a/Software/EmonESP/src/emoncms.cpp +++ b/Software/EmonESP/src/emoncms.cpp @@ -32,7 +32,7 @@ #include "wifi.h" //EMONCMS SERVER strings -const char* e_url = "/input/post.json?json="; +const char *e_url = "/input/post.json?json="; boolean emoncms_connected = false; unsigned long packets_sent = 0; diff --git a/Software/EmonESP/src/energy_meter.cpp b/Software/EmonESP/src/energy_meter.cpp index 3da5d4f..c42f5b7 100644 --- a/Software/EmonESP/src/energy_meter.cpp +++ b/Software/EmonESP/src/energy_meter.cpp @@ -95,11 +95,10 @@ unsigned long startMillis; unsigned long currentMillis; const int period = 1000; //time interval in ms to send data -#ifdef SOLAR_METER -bool canBeNegative = true; -#else -bool canBeNegative = false; //set to true if current and power readings can be negative (like when exporting solar power) -#endif +/*Power values are usually only negative when exporting solar power + Otherwise a CT may be backwards */ +bool canBeNegative = true; + char result[200]; char measurement[16]; @@ -300,7 +299,7 @@ void energy_meter_loop() if (LineFreq == 389) { totalSolarWatts = eic_solar.GetTotalActivePower()*2; } - else ( + else { totalSolarWatts = eic_solar.GetTotalActivePower(); //all math is already done in the total register } diff --git a/Software/EmonESP/src/energy_meter.h b/Software/EmonESP/src/energy_meter.h index f708f22..967620c 100644 --- a/Software/EmonESP/src/energy_meter.h +++ b/Software/EmonESP/src/energy_meter.h @@ -60,10 +60,13 @@ 37106 - 9v AC Transformer - Jameco 157041 38302 - 9v AC Transformer - Jameco 112336 29462 - 12v AC Transformer - Jameco 167151 + For Meters > v1.4 purchased after 11/1/2019 and rev.3 + 7611 - 9v AC Transformer - Jameco 157041 */ #define VOLTAGE_GAIN 37106 /* + 10170 - SCT-006 20A/25mA 25498 - SCT-013-000 100A/50mA 39473 - SCT-016 120A/40mA 46539 - Magnalab 100A diff --git a/Software/EmonESP/src/http.cpp b/Software/EmonESP/src/http.cpp index 342e1b1..c821581 100644 --- a/Software/EmonESP/src/http.cpp +++ b/Software/EmonESP/src/http.cpp @@ -39,7 +39,6 @@ #error Platform not supported #endif - WiFiClientSecure client; // Create class for HTTPS TCP connections get_https() HTTPClient http; // Create class for HTTP TCP connections get_http() diff --git a/Software/EmonESP/src/src.ino.esp32.bin b/Software/EmonESP/src/src.ino.esp32.bin index cf42037..970c7ee 100644 Binary files a/Software/EmonESP/src/src.ino.esp32.bin and b/Software/EmonESP/src/src.ino.esp32.bin differ diff --git a/Software/EmonESP/src/web_server.cpp b/Software/EmonESP/src/web_server.cpp index 6d69692..bf6da5a 100644 --- a/Software/EmonESP/src/web_server.cpp +++ b/Software/EmonESP/src/web_server.cpp @@ -53,7 +53,7 @@ static const char _DUMMY_PASSWORD[] PROGMEM = "_DUMMY_PASSWORD"; #define TEXTIFY(A) #A #define ESCAPEQUOTE(A) TEXTIFY(A) -String currentfirmware = "2.5.4"; //ESCAPEQUOTE(BUILD_TAG); +String currentfirmware = "2.5.5"; //ESCAPEQUOTE(BUILD_TAG); void dumpRequest(AsyncWebServerRequest *request) { if (request->method() == HTTP_GET) { diff --git a/Software/EmonESP/src/wifi.cpp b/Software/EmonESP/src/wifi.cpp index ef7a6c0..a2ea856 100644 --- a/Software/EmonESP/src/wifi.cpp +++ b/Software/EmonESP/src/wifi.cpp @@ -36,7 +36,7 @@ const byte DNS_PORT = 53; // Access Point SSID, password & IP address. SSID will be softAP_ssid + chipID to make SSID unique const char *softAP_ssid = "emonESP"; -const char* softAP_password = ""; +const char *softAP_password = ""; IPAddress apIP(192, 168, 4, 1); IPAddress netMsk(255, 255, 255, 0); int apClients = 0; diff --git a/Software/EmonESP/src_solar/emoncms.cpp b/Software/EmonESP/src_solar/emoncms.cpp index 970bef9..d11b742 100644 --- a/Software/EmonESP/src_solar/emoncms.cpp +++ b/Software/EmonESP/src_solar/emoncms.cpp @@ -32,7 +32,7 @@ #include "wifi.h" //EMONCMS SERVER strings -const char* e_url = "/input/post.json?json="; +const char *e_url = "/input/post.json?json="; boolean emoncms_connected = false; unsigned long packets_sent = 0; diff --git a/Software/EmonESP/src_solar/energy_meter.cpp b/Software/EmonESP/src_solar/energy_meter.cpp index 27b2a51..c42f5b7 100644 --- a/Software/EmonESP/src_solar/energy_meter.cpp +++ b/Software/EmonESP/src_solar/energy_meter.cpp @@ -95,11 +95,10 @@ unsigned long startMillis; unsigned long currentMillis; const int period = 1000; //time interval in ms to send data -#ifdef SOLAR_METER -bool canBeNegative = true; -#else -bool canBeNegative = false; //set to true if current and power readings can be negative (like when exporting solar power) -#endif +/*Power values are usually only negative when exporting solar power + Otherwise a CT may be backwards */ +bool canBeNegative = true; + char result[200]; char measurement[16]; diff --git a/Software/EmonESP/src_solar/energy_meter.h b/Software/EmonESP/src_solar/energy_meter.h index ed8f1c7..ac5a1bd 100644 --- a/Software/EmonESP/src_solar/energy_meter.h +++ b/Software/EmonESP/src_solar/energy_meter.h @@ -29,7 +29,6 @@ //#define ENABLE_OLED_DISPLAY #define SOLAR_METER - /* Uncomment to send metering values to EmonCMS, like Fundamental, Harmonic, Reactive, Apparent Power, and Phase Angle */ @@ -61,10 +60,13 @@ 37106 - 9v AC Transformer - Jameco 157041 38302 - 9v AC Transformer - Jameco 112336 29462 - 12v AC Transformer - Jameco 167151 + For Meters > v1.4 purchased after 11/1/2019 and rev.3 + 7611 - 9v AC Transformer - Jameco 157041 */ #define VOLTAGE_GAIN 37106 /* + 10170 - SCT-006 20A/25mA 25498 - SCT-013-000 100A/50mA 39473 - SCT-016 120A/40mA 46539 - Magnalab 100A diff --git a/Software/EmonESP/src_solar/src_solar.ino.esp32.bin b/Software/EmonESP/src_solar/src_solar.ino.esp32.bin index 9f308b2..30897d9 100644 Binary files a/Software/EmonESP/src_solar/src_solar.ino.esp32.bin and b/Software/EmonESP/src_solar/src_solar.ino.esp32.bin differ diff --git a/Software/EmonESP/src_solar/web_server.cpp b/Software/EmonESP/src_solar/web_server.cpp index 6d69692..bf6da5a 100644 --- a/Software/EmonESP/src_solar/web_server.cpp +++ b/Software/EmonESP/src_solar/web_server.cpp @@ -53,7 +53,7 @@ static const char _DUMMY_PASSWORD[] PROGMEM = "_DUMMY_PASSWORD"; #define TEXTIFY(A) #A #define ESCAPEQUOTE(A) TEXTIFY(A) -String currentfirmware = "2.5.4"; //ESCAPEQUOTE(BUILD_TAG); +String currentfirmware = "2.5.5"; //ESCAPEQUOTE(BUILD_TAG); void dumpRequest(AsyncWebServerRequest *request) { if (request->method() == HTTP_GET) { diff --git a/Software/EmonESP/src_solar/wifi.cpp b/Software/EmonESP/src_solar/wifi.cpp index ef7a6c0..a2ea856 100644 --- a/Software/EmonESP/src_solar/wifi.cpp +++ b/Software/EmonESP/src_solar/wifi.cpp @@ -36,7 +36,7 @@ const byte DNS_PORT = 53; // Access Point SSID, password & IP address. SSID will be softAP_ssid + chipID to make SSID unique const char *softAP_ssid = "emonESP"; -const char* softAP_password = ""; +const char *softAP_password = ""; IPAddress apIP(192, 168, 4, 1); IPAddress netMsk(255, 255, 255, 0); int apClients = 0;