roarfred / mbusmqttlogger Goto Github PK
View Code? Open in Web Editor NEWAn M-bus master that poll a meter and logs data to an MQTT server
An M-bus master that poll a meter and logs data to an MQTT server
Arduino: 1.8.9 (Windows 10), Board: "WeMos D1 R1, 80 MHz, Flash, Disabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
Build options changed, rebuilding all
MqttLogger:42:1: error: 'Config' does not name a type
Config gAppConfig; // The configuration, as set in EEPROM from the web config page
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\MBusMqttLogger\MqttLogger\MqttLogger.ino: In function 'void setup()':
MqttLogger:128:28: error: 'gAppConfig' was not declared in this scope
if (APButtonPressed() || !gAppConfig.Load(EEPROM_CONFIG_ADDRESS))
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\MBusMqttLogger\MqttLogger\MqttLogger.ino: In function 'void SetupMqtt()':
MqttLogger:217:18: error: 'gAppConfig' was not declared in this scope
Serial1.println(gAppConfig.MqttServer);
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\MBusMqttLogger\MqttLogger\MqttLogger.ino: In function 'void GetMqttTopic(char*)':
MqttLogger:233:18: error: 'gAppConfig' was not declared in this scope
strcpy(pBuffer, gAppConfig.MqttTopic);
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\MBusMqttLogger\MqttLogger\MqttLogger.ino: In function 'bool ConnectToWiFi()':
MqttLogger:428:16: error: 'gAppConfig' was not declared in this scope
Serial1.print(gAppConfig.Ssid);
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\MBusMqttLogger\MqttLogger\MqttLogger.ino: In function 'String GetConfigPage()':
MqttLogger:526:2: error: 'Config' was not declared in this scope
Config vConfig;
^
MqttLogger:526:9: error: expected ';' before 'vConfig'
Config vConfig;
^
MqttLogger:527:6: error: 'vConfig' was not declared in this scope
if (vConfig.Load(EEPROM_CONFIG_ADDRESS))
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\MBusMqttLogger\MqttLogger\MqttLogger.ino: In function 'String HandleSavePage(ESP8266WebServer)':
MqttLogger:575:2: error: 'Config' was not declared in this scope
Config vConfig;
^
MqttLogger:575:9: error: expected ';' before 'vConfig'
Config vConfig;
^
MqttLogger:576:2: error: 'vConfig' was not declared in this scope
vConfig.Ssid = new char[vSsid.length() + 1];
^
exit status 1
'Config' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hi my name is David, I'm setting up a similar system where I need to read two zenner C5 energy meters. But so far I have not succeeded in getting the counters to send me a reply telegram. I use an ESP8266 and the diagram I sent attached as a shield. I sent them 10 5b 01 5c 16 to try to get a telegram from the counter 01 but it does not respond. Any ideas. Can you show me the circuit you used for the connection between the ESP8266 and the Zenner C5?
Thank you very much for the MBusMqttLogger. I have just started reading my Zenner zelsius C5 IUF over M-BUS. My desire is to get the data in MQTT. This example is actually exactly what I need. Unfortunately, I cannot manage to compile the project, probably due to outdated libraries. I have since managed to modify a few things, but I still keep getting stuck (mainly due to my lack of knowledge of Arduino). I understand that this repo is already old and has not seen much activity, but is there anyone who has a working version that uses the current libraries. Thanks in advance for a response! Best regards, Ivo
I know this repo is old and probably not really maintained, but I found a small bug in UserData.cpp. Negative numbers (in my case temperatures) are not read correctly (the sign is ignored). This can be fixed by changing UserData::DataAsInteger
to:
long UserData::DataAsInteger()
{
uint8_t negative = Data[DataLength - 1] & SIGN_MASK;
long vValue = negative ? -1 : 0;
for (int i = DataLength - 1; i >= 0; i--)
{
vValue = vValue << 8;
vValue += Data[i];
}
return vValue;
}
I Could make a pull request if you are interested.
Nice project,
could you describe procedure, in general, what is the procedure if you would want to adjust this project to read data from mbus from different manufacturer?
Could you describe the hardware you used?
Would you share some useful docs about the protocol it self?
Arduino: 1.8.9 (Windows 10), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\libraries\webconfig\WebConfig.cpp:9:61: error: use of deleted function 'ESP8266WebServer::ESP8266WebServer(const ESP8266WebServer&)'
ESP8266WebServer WebConfig::gWebServer = ESP8266WebServer(80);
^
In file included from C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\libraries\webconfig\WebConfig.h:7:0,
from C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\libraries\webconfig\WebConfig.cpp:5:
C:\Users\pc1\Desktop\kontroleri\arduino\portable\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:70:7: note: 'ESP8266WebServer::ESP8266WebServer(const ESP8266WebServer&)' is implicitly deleted because the default definition would be ill-formed:
class ESP8266WebServer
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:70:7: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = HTTPUpload; _Dp = std::default_delete]'
In file included from c:\users\pc1\desktop\kontroleri\arduino\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\memory:81:0,
from C:\Users\pc1\Desktop\kontroleri\arduino\portable\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:28,
from C:\Users\pc1\Desktop\kontroleri\arduino\portable\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28,
from C:\Users\pc1\Desktop\kontroleri\arduino\portable\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,
from C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\libraries\webconfig\WebConfig.h:6,
from C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\libraries\webconfig\WebConfig.cpp:5:
c:\users\pc1\desktop\kontroleri\arduino\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\unique_ptr.h:273:7: error: declared here
unique_ptr(const unique_ptr&) = delete;
^
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\libraries\webconfig\WebConfig.cpp: In static member function 'static void WebConfig::WebServer_SaveConfig()':
C:\Users\pc1\Desktop\kontroleri\arduino\portable\sketchbook\libraries\webconfig\WebConfig.cpp:58:49: error: use of deleted function 'ESP8266WebServer::ESP8266WebServer(const ESP8266WebServer&)'
String vHtmlText = gSavePageFunction(gWebServer);
^
exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.