Some observations on the way:
1) having to flip a jumper over on the shield between programming and run is *very* annoying in a cold garage, so I'm going to rewire it slightly to use SoftwareSerial on a spare input (leave JP1 open and wire from one side of it to a spare pin) - I already have a link since the shield tries to use DIG6 by default which is used by the red LED on a nanode.
2) the arduino IDE doesn't like anything other than 8N! on the serial monitor. close it and use kermit. if you can't read serial with kermit, then it's *very* broken :-)
3q) our usage is going UP not down :-( -- lowest figure I managed to get the baseline to was 340VA
With a very simple logger
Serial.print(char(meter.read()));
I can stream the output to a kermit session log as
^Bnext trick is to try and get the processing organised into blocks and validate the checksum, but my code doesn't seem to detect the stx/etx properly
ADCO 040222048573 <
OPTARIF BASE 0
ISOUSC 30 9
BASE 040912359 ,
PTEC TH.. $
IINST 002 Y
IMAX 029 J
PAPP 00340 (
MOTDETAT 000000 B^C
void loop() {
if(meter.available()>0) {
if((c = meter.read()) == 02) { // start of block
Serial.println("DEBUG: Start Loop");
while((c = meter.read()) != 03) { // Loop until end of block
Serial.print(char(c));
}
digitalWrite(LED, LOW); // Flash LED
delay(50);
digitalWrite(LED, HIGH);
}
}
}
so mode debugging called for. Once thats done, then I'll send the values to an emon style display over rfm12b
No comments:
Post a Comment