Hello im having a bit of trouble getting this to work using a Microstar C2000 Electric meter.
I have both the C2000 and P2000-T meters and i have a fully working code for the P200-T however the protocol changed in the C2000 which is making this a lot harder.
I am using a RS232 to RS485 modbus module (working perfectly) and Arduino Nano.
I have managed to get the Meter response on the C2000 which is displayed as "/BSM5\2C2000-V21"
to get this i am using the following code:
Serial.println("Meter type");
digitalWrite(SSerialTxControl, RS485Transmit);
byte cmd[] = {0xAF,0x3F,0x21,0x8D,0x0A}; // "/?!\r\n"
RS485Serial.write (cmd, 5);
digitalWrite(SSerialTxControl, RS485Receive);
byte a;
while (RS485Serial.available() > 0)
{
a = RS485Serial.read() & 0x7F; // convert 8N1 to 7E1
char b = a;
Serial.print(b);
}
delay(1000);
that gets the meter handshake and the meter sends back the response.
The problem i am having issues with is actually sending the OBIS code in the correct format.
Using the P2000-T i sent it like:
String OBIS = "1-0:0.9.2";
String sendingData;
sendingData = "";
sendingData = char(0x01);
sendingData += char(0x52);
sendingData += char(0x31);
sendingData += char(0x02);
sendingData += OBIS;
sendingData += char(0x28);
sendingData += char(0x29);
sendingData += char(0x0A);
RS485Serial.print(sendingData);
That use to work perfectly, however not with the C2000.
Has anyone else got a working header format that they know might works ?