Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Versie 0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mrWheel committed Jul 19, 2019
1 parent cba5dfd commit c7d9174
Show file tree
Hide file tree
Showing 17 changed files with 1,361 additions and 105 deletions.
1,003 changes: 1,003 additions & 0 deletions DSMRloggerWS_v44.ino

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Documentatie DSMRloggerWS
# Documentatie DSMRloggerWS (laatste Versie 0.4.4)

<p>Voor de project beschrijving ga naar <a href="https://willem.aandewiel.nl/index.php/2018/08/28/slimme-meter-uitlezer/">www.aandewiel.nl</a>.</p>
<br>
<table>
<tr><th>Versie</th><th>Opmerking</th></tr>
<tr>
<td>0.4.3</td>
<td>Mogelijkheid om de Timestamp niet uit de Slimme Meter te halen
<br>maar uit een NTP server.
<br>Betere meldingen op het Oled-scherm (o.a. start AP mode).
<br>Directe reactie als op de Wake-Up knop (FLASH) wordt gedrukt.
<br>Diverse cosmische verbeteringen.
</td>
<tr>
<tr><td>0.4.3</td><td>Update meterstanden voor tab [per Uur], [per Dag] en [per Maand]</td></tr>
<tr><td>0.4.0</td><td>Eerste publieke versie</td></tr>
</table>
<br>
<h2 id="inhoudsopgave">Inhoudsopgave</h2>
<ul>
<li><a href="https://mrwheel.github.io/DSMRloggerWS/introductie/">Introductie</a></li>
Expand Down
4 changes: 2 additions & 2 deletions data/DSMReditor.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
***************************************************************************
** Program : DSMReditor.html, part of DSMRlogger
** Version : v0.4.1
** Program : DSMReditor.html, part of DSMRloggerWS
** Version : v0.4.4
**
** Copyright (c) 2019 Willem Aandewiel
**
Expand Down
4 changes: 2 additions & 2 deletions data/DSMReditor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
***************************************************************************
** Program : DSMReditor.js, part of DSMRlogger
** Version : v0.4.1
** Program : DSMReditor.js, part of DSMRloggerWS
** Version : v0.4.4
**
** Copyright (c) 2019 Willem Aandewiel
**
Expand Down
21 changes: 10 additions & 11 deletions data/DSMRgraphics.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
/*
/*
***************************************************************************
** Program : DSMRgraphics.js, part of DSMRlogger
** Version : v0.4.1
** Program : DSMRgraphics.js, part of DSMRloggerWS
** Version : v0.4.4
**
** Copyright (c) 2019 Willem Aandewiel
**
** TERMS OF USE: MIT License. See bottom of file.
** TERMS OF USE: MIT License. See bottom of file.
***************************************************************************
*/

var Label = [];
var Label = [];
var Delivered = [];
var Returned = [];
var Gas = [];
var Returned = [];
var Gas = [];
var Delivered2 = [];
var Returned2 = [];
var Gas2 = [];
var Returned2 = [];
var Gas2 = [];
var DeliveredL1 = [];
var DeliveredL2 = [];
var DeliveredL3 = [];
Expand Down Expand Up @@ -361,7 +360,7 @@ function graphStart() {
webSocketConn.send("graphActualNext");
TimerActual=setInterval(function(){
webSocketConn.send("graphActualNext");
},10000);
},9900);
} else if (graphType == 'F') {
console.log("graphStart: graphFinancialRow");
//webSocketConn.send("graphFinancialRow,r=1");
Expand Down
4 changes: 2 additions & 2 deletions data/DSMRlogger.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
***************************************************************************
** Program : DSMRlogger.css, part of DSMRlogger
** Version : v0.4.1
** Program : DSMRlogger.css, part of DSMRloggerWS
** Version : v0.4.4
**
** Copyright (c) 2019 Willem Aandewiel
**
Expand Down
4 changes: 2 additions & 2 deletions data/DSMRlogger.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
***************************************************************************
** Program : DSMRlogger.html, part of DSMRlogger
** Version : v0.4.1
** Program : DSMRlogger.html, part of DSMRloggerWS
** Version : v0.4.4
**
** Copyright (c) 2019 Willem Aandewiel
**
Expand Down
4 changes: 2 additions & 2 deletions data/DSMRlogger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
***************************************************************************
** Program : DSMRlogger.js, part of DSMRlogger
** Version : v0.4.1
** Program : DSMRlogger.js, part of DSMRloggerWS
** Version : v0.4.4
**
** Copyright (c) 2019 Willem Aandewiel
**
Expand Down
24 changes: 8 additions & 16 deletions menuStuff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,14 @@ void displayBoardInfo() {
Debug("ESP8266_ESP12");
#endif
Debug("]\r\n SSID ["); Debug( WiFi.SSID() );
#ifdef SHOW_PSK_KEY
Debug("]\r\n PSK key ["); Debug( WiFi.psk() );
#else
Debug("]\r\n PSK key [**********");
#endif
Debug("]\r\n IP Address ["); Debug( WiFi.localIP() );
Debug("]\r\n Hostname ["); Debug( _HOSTNAME );
Debug("]\r\n Last reset reason: ["); Debug( ESP.getResetReason() );
Debug("]\r\n upTime ["); Debug( upTime() );
Debugln("]\r");
Debugln("==================================================================\r\n");
Expand Down Expand Up @@ -200,9 +205,11 @@ void handleKeyInput() {

case 'F': Debugf("\r\nConnect to AP [%s] and go to ip address shown in the AP-name\r\n", _HOSTNAME);
delay(1000);
WiFi.disconnect(); // deletes credentials !
WiFi.disconnect(true); // deletes credentials !
//setupWiFi(true);
delay(2000);
ESP.reset();
delay(2000);
break;
case 'i':
case 'I': for(int I=0; I<10; I++) {
Expand Down Expand Up @@ -244,15 +251,6 @@ void handleKeyInput() {
Verbose2 = false;
}
break;
case 'w':
case 'W': if (waitForATOupdate > millis()) {
OTAinProgress = false;
waitForATOupdate = millis();
} else {
OTAinProgress = true;
waitForATOupdate = millis() + 30000; // wait for 30 seconds
}
break;
default: _dThis = false;
Debugln("\nCommands are:\r\n");
Debugln(" B - Board Type\r");
Expand All @@ -278,12 +276,6 @@ void handleKeyInput() {
if (Verbose1 & Verbose2) Debugln(" V - Toggle Verbose Off\r");
else if (Verbose1) Debugln(" V - Toggle Verbose 2\r");
else Debugln(" V - Toggle Verbose 1\r");
if (waitForATOupdate > millis()) {
Debugln(" W - Cancel Wait for ATO update\r");
} else {
Debugln(" W - Wait for OTA upload \r");
}
Debugln("\r");

} // switch()
while (TelnetStream.available() > 0) {
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,5 +327,5 @@ <h2 id="inhoudsopgave">Inhoudsopgave</h2>

<!--
MkDocs version : 1.0.4
Build Date UTC : 2019-07-16 09:34:27
Build Date UTC : 2019-07-16 09:35:43
-->
Binary file modified mkdocs/site/sitemap.xml.gz
Binary file not shown.
85 changes: 23 additions & 62 deletions networkStuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ void configModeCallback (WiFiManager *myWiFiManager) {
//if you used auto generated SSID, print it
_dThis = true;
Debugln(myWiFiManager->getConfigPortalSSID());
#ifdef HAS_OLED_SSD1306
oled_Clear();
oled_Print_Msg(0, "** DSMRloggerWS **", 0);
oled_Print_Msg(1, "AP mode active", 0);
oled_Print_Msg(2, "Connect to:", 0);
oled_Print_Msg(3, myWiFiManager->getConfigPortalSSID(), 0);
#endif

} // configModeCallback()

Expand All @@ -64,22 +71,35 @@ void startWiFi() {

//sets timeout until configuration portal gets turned off
//useful to make it all retry or go to sleep in seconds
manageWiFi.setTimeout(180); // 3 minuten
manageWiFi.setTimeout(240); // 4 minuten

//fetches ssid and pass and tries to connect
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP"
//here "DSMR-WS-<MAC>"
//and goes into a blocking loop awaiting configuration
if (!manageWiFi.autoConnect(thisAP.c_str())) {
_dThis = true;
Debugln("failed to connect and hit timeout");
#ifdef HAS_OLED_SSD1306
oled_Clear();
oled_Print_Msg(0, "** DSMRloggerWS **", 0);
oled_Print_Msg(1, "Failed to connect", 0);
oled_Print_Msg(2, "and hit TimeOut", 0);
oled_Print_Msg(3, "***** RESET *****", 0);
#endif

//reset and try again, or maybe put it to deep sleep
delay(3000);
ESP.reset();
delay(1000);
delay(2000);
}

_dThis = true;
Debugf("Connected with IP-address [%s]\n\n", WiFi.localIP().toString().c_str());
#ifdef HAS_OLED_SSD1306
oled_Clear();
#endif


#ifdef USE_UPDATE_SERVER
httpUpdater.setup(&httpServer);
Expand All @@ -100,65 +120,6 @@ void startTelnet() {
} // startTelnet()


//===========================================================================================
#ifdef USE_ARDUINO_OTA
void startArduinoOTA() {
//===========================================================================================

//ArduinoOTA.setHostname();
//ArduinoOTA.setPassword("");

ArduinoOTA.onStart([]() {
String type;

OtaInProgress = true;

Serial.end();
webSocket.disconnect();
webSocket = 0;

if (ArduinoOTA.getCommand() == U_FLASH) {
type = "sketch";
} else { // U_SPIFFS
type = "filesystem";
if (SPIFFSmounted) {
SPIFFS.end();
SPIFFSmounted = false;
}
}
_dThis = true;
Debugln("Start updating " + type);
DebugFlush();
});
ArduinoOTA.onEnd([]() {
Debugln("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
_dThis = true;
Debugf("Progress: %u%%\r", (progress / (total / 100)));
DebugFlush();
});
ArduinoOTA.onError([](ota_error_t error) {
Debugf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) {
Debugln("Auth Failed");
} else if (error == OTA_BEGIN_ERROR) {
Debugln("Begin Failed");
} else if (error == OTA_CONNECT_ERROR) {
Debugln("Connect Failed");
} else if (error == OTA_RECEIVE_ERROR) {
Debugln("Receive Failed");
} else if (error == OTA_END_ERROR) {
Debugln("End Failed");
}
DebugFlush();
});
ArduinoOTA.begin();

} // startArduinoOTA()
#endif


//=======================================================================
void startMDNS(const char *Hostname) {
//=======================================================================
Expand Down
Loading

0 comments on commit c7d9174

Please sign in to comment.