Skip to content

Commit

Permalink
add version info to wifi manager #2, add neutral current to config 630s
Browse files Browse the repository at this point in the history
  • Loading branch information
merlokk committed Apr 11, 2017
1 parent 0d44d88 commit d4d96dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ESP8266EASTRON/ESP8266EASTRON.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <Arduino.h>
#include <ESP8266WiFi.h> // https://github.com/esp8266/Arduino
#include <DNSServer.h> // Local DNS Server used for redirecting all requests to the configuration portal
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <WiFiManager.h> // https://github.com/merlokk/WiFiManager original:https://github.com/tzapu/WiFiManager
#include <PubSubClient.h> // https://github.com/knolleary/pubsubclient/releases/tag/v2.6
#include <Ticker.h>
#include <EEPROM.h>
Expand Down Expand Up @@ -127,7 +127,7 @@ void mqttPublishRegularState() {
}

void mqttPublishState(const char *topic, const char *payload) {
mqttPublishState(topic, payload, true);
mqttPublishState(topic, payload, false); // true - for release!!!!
}

void mqttPublishState(const char *topic, const char *payload, bool retained) {
Expand Down Expand Up @@ -227,6 +227,7 @@ void wifiSetup(bool withAutoConnect) {
}

WiFiManager wifiManager(DEBUG_SERIAL);
wifiManager.mainProgramVersion = PROGRAM_VERSION;

WiFiManagerParameter custom_mqtt_text("<br/>MQTT config: <br/>");
wifiManager.addParameter(&custom_mqtt_text);
Expand Down
4 changes: 3 additions & 1 deletion ESP8266EASTRON/eastron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mqttMapConfigS eastron220[eastron220Len] = {
{"PowerVAR", POLL_INPUT_REGISTERS, 0x18, MDB_FLOAT}
};

#define eastron630smallLen 17
#define eastron630smallLen 18
mqttMapConfigS eastron630small[eastron630smallLen] = {
{"Voltage1", POLL_INPUT_REGISTERS, 0x00, MDB_FLOAT},
{"Voltage2", POLL_INPUT_REGISTERS, 0x02, MDB_FLOAT},
Expand All @@ -30,6 +30,7 @@ mqttMapConfigS eastron630small[eastron630smallLen] = {
{"PowerVAR1", POLL_INPUT_REGISTERS, 0x18, MDB_FLOAT},
{"PowerVAR2", POLL_INPUT_REGISTERS, 0x1A, MDB_FLOAT},
{"PowerVAR3", POLL_INPUT_REGISTERS, 0x1C, MDB_FLOAT},
{"NeutralCurrent", POLL_INPUT_REGISTERS, 0xE0, MDB_FLOAT},
// {"Data", POLL_INPUT_REGISTERS, 0x00, MDB_16BYTE_HEX}, // debug only

{"Frequency", POLL_INPUT_REGISTERS, 0x46, MDB_FLOAT},
Expand Down Expand Up @@ -296,6 +297,7 @@ void Eastron::ModbusSetup(char *deviceType) {
if (strncmp(deviceType, "630s", 5) == 0) {
AddModbusDiap(POLL_INPUT_REGISTERS, 0x000, 0x1D);
AddModbusDiap(POLL_INPUT_REGISTERS, 0x046, 0x02);
AddModbusDiap(POLL_INPUT_REGISTERS, 0x0E0, 0x02);
AddModbusDiap(POLL_HOLDING_REGISTERS, 0x02A, 0x04); // serial number

mapConfig = eastron630small;
Expand Down

0 comments on commit d4d96dc

Please sign in to comment.