-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding errors #3
Comments
Addendum: When I try to decode the data from a commercial M-BUS device (whose payload is not encoded with MBUSPayload), things look even worse. I tried to decode the data of an elvaco MBUS thermostat. No problem with LorusFree. MBusPaypal does not find any data fields and reports 4 errors: Data from Thermostat (payload starts at address 19): And here the decoding by LorusFree: |
Hello, Thank you for the libary! I have the same issue. Do you find a solution? Try to develop a M-Bus MQTT gateway. Now i try to write a new version with the mbus-payload libary to enable more M-Bus devices, but there are some problems. The M-Bus data part of the telegram is right received. I also tried your code above HWHardsoft, but exactly the same. |
Answer to myself: It is just an issue of the size of the involved variables. Now I have different issues, but step by step. |
I've tried your new version of MBUS Payload library today. Also I've increased the size of the JSON buffer to 4k but no change. The errors during decoding of data of elvaco thermostat are still the same. |
Hi,
First of all, thank you for this great library.
Based on your library, I wrote a demo program for a small consumption meter (MBUS slave) for the ESP32. That works fine too. For tests I used LorusFree and LibMBUS (on the Raspberry Pi). I can read my meter correctly with both programs.
I am currently trying to write a similar program for a master that decodes the data on the ESP32 with your library. Unfortunately, there seems to be a couple of problems. MBUSPayload recognizes the 7 data fields of the meter, but only displays 5 as JSON code??
`
#define DEBUG true
#include "MBUSPayload.h"
#include "ArduinoJson.h"
// Serial interface used for mbus to allow use of 8E1 encoding
#include <HardwareSerial.h>
HardwareSerial *customSerial;
#define MBUS_BAUD_RATE 2400
#define MBUS_ADDRESS 2
#define MBUS_TIMEOUT 1000 // milliseconds
#define MBUS_DATA_SIZE 255
#define MBUS_GOOD_FRAME true
#define MBUS_BAD_FRAME false
unsigned long loop_start = 0;
unsigned long last_loop = 0;
bool firstrun = true;
int Startadd = 0x13; // Start address for decoding
void setup() {
Serial.begin(115200);
Serial.println(F("emonMbus startup"));
Serial.println(F("mbus:"));
Serial.print(F(" slave address: "));
Serial.println(MBUS_ADDRESS);
Serial.print(F(" baud rate: "));
Serial.println(MBUS_BAUD_RATE);
customSerial = &Serial1;
customSerial->begin(MBUS_BAUD_RATE, SERIAL_8E1); // mbus uses 8E1 encoding
delay(1000); // let the serial initialize, or we get a bad first frame
}
void loop() {
loop_start = millis();
/************************
************************/
if ((loop_start-last_loop)>=9800 || firstrun) { // 9800 = ~10 seconds
last_loop = loop_start; firstrun = false;
}
}
`
So the binary inputs and outputs are not decoded correctly.
The text was updated successfully, but these errors were encountered: