jantenhove / P1-Meter-ESP8266

Software for the ESP8266 that sends P1 smart meter data to Domoticz (with CRC checking)
GNU General Public License v3.0
80 stars 38 forks source link

No serial output, yet meter sends data #4

Open WeeJeWel opened 7 years ago

WeeJeWel commented 7 years ago

Hi @jantenhove,

I have tried this project and it seems great, because no extra components such as resistors seem needed.

Unfortunately, my ESP (Wemos D1 Mini) does not receive any data from the smart meter. I suspect the bug is somewhere in SoftwareSerial, because when I connect the RxD pin to the TX pin, the Arduino serial console shows garbage every 10s, so the meter seems to send data.

My wiring is the same as your example. I've created simpler code to troubleshoot further:

#include <SoftwareSerial.h>

#define MAXLINELENGTH 64
#define PIN_RX D5

#define BAUDRATE 115200

SoftwareSerial softSerial(PIN_RX, -1, true, MAXLINELENGTH);

void setup() {

  Serial.begin(BAUDRATE);
  softSerial.begin(BAUDRATE);

  Serial.println("Running at baudrate " + (String)BAUDRATE + " and RX pin " + (String)PIN_RX + "...");
}

void loop() {
  if (softSerial.available()) {
    Serial.write("Available");
    Serial.write(softSerial.read());
  }
}

Apart from the Running at baudrate 115200 and RX pin 14... message, nothing happens. When I manually disconnect GND, Available can be read so the SoftSerial interrupts seem to be handled correctly.

I'm at a loss here! Is there anything I'm doing wrong?

jantenhove commented 7 years ago

Hi @WeeJeWel ,

Sorry for my late response. Which meter are you using? I've used this sketch on multiple meters. Some meters use 9600n8, some 9600e7, some are inverted, and some are not.

pvhpsb commented 6 years ago

Hi, I get the error TimeLib.h: no such file or directory can you help me? Regards, Patrick

Bolukan commented 4 years ago

Can be found: TimeLib

frans76 commented 4 years ago

Hi @WeeJeWel ,

Sorry for my late response. Which meter are you using? I've used this sketch on multiple meters. Some meters use 9600n8, some 9600e7, some are inverted, and some are not.

@jantenhove Dear jan, I have the same trouble with getting readable output. my meter(Iskra | MT 382) uses 9600 7E1 protocol. do i need to change something in code ? I am struggling to get the 7 bit part right. attached the output I am getting. Thank you for your reply in advance!

BR Frans

output p1 output.txt

marsman007 commented 1 year ago

Hi @WeeJeWel ,

Rather a late response but I thought perhaps it can help others with the same issue... I was struggling with the same problems as you described. Placing a 1K resistor between RTS and RxD resolved the issue for me.

matthijsisproh commented 1 year ago

What Smart Meter do you have at your home? Is it by coincidence a Landis+Gyr ZCF110/ZMF110? What did you use for SerialConfig? SWSERIAL_8E1? and what baudrate? @marsman007

marsman007 commented 1 year ago

I have a Landis+Gyr ZMF110CCtFs2 I pretty much used the code from: http://domoticx.com/p1-poort-slimme-meter-data-naar-domoticz-esp8266/