Hi pylon,
thanks for your help.
pylon:
What kind of hardware do you use for the communication (link)? Is it the TTL-IR-Read-Write head? Please post the sketch you use for the tests. Is it possible to use the hardware serial for the communication to the smartmeter?
Yes, it is the TTL-version of the reader.
#define irRxPin 3
#define irTxPin 2
SoftwareSerial ir = SoftwareSerial(irRxPin,irTxPin); // RX, TX
const unsigned int _requestIrData = 5000;
unsigned long _lastRequestIrData = 0;
void RequestMeterData(unsigned long currentMillis){
if (currentMillis - _lastRequestIrData > _requestIrData){
// save the last time you requested ir data
_lastRequestIrData = currentMillis;
Serial.println("Requesting IR-data...");
//ir.print("/?3461124! \r\n"); // hex 2F 3F 21 0D 0A
ir.print("/?!\r\n");
}
}
void ReceiveMeterData(){
if (ir.available()){
Serial.print("Response: ");
char response = ir.read();
// convert 8N1 to 7E1
response &= 0x7F;
Serial.println(response);
}
}
void setup()
{
ir.begin(300);
ir.listen();
}
void loop()
{
unsigned long timeMillis = millis();
RequestMeterData(timeMillis);
ReceiveMeterData();
}
This is an extract of the code.
pylon:
According to the specification for the A1500, the data format is 7N1, are you sure it has to be 7E1? Some of the devices seem to insist on the device address, did you try that too?
My neighbor has the same Smartmeter and the USB-version of the reader. He is successfully getting data from it with an Raspberry Pi and the mentioned settings.