your a full member now, able to PM, but try to put as much as possible on the forum so everybody can enjoypjanssen wrote:I got a PM from pietervanharen but i am not able to replay. Too less posts i guess.
also make a seperate topic for this
your a full member now, able to PM, but try to put as much as possible on the forum so everybody can enjoypjanssen wrote:I got a PM from pietervanharen but i am not able to replay. Too less posts i guess.
Thanks,Bwired wrote: your a full member now, able to PM, but try to put as much as possible on the forum so everybody can enjoy
also make a seperate topic for this
Code: Select all
download FT_Prog and set the RX pin to inverted
Code: Select all
(9600baud, 7 data bits, 1 stop bit, even parity and no flow control)
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(RXpin, TXpin, true);
setup()
{
Serial.begin(9600);
mySerial.begin(9600);
}
loop()
{
if (mySerial.available()) {
char inChar = (char) mySerial.read();
inChar = inChar & B01111111;
Serial.print(inChar);
}
}
Code: Select all
inChar = inChar & B01111111;
I now have the same weird data, what timings did you use?ChrisPW wrote:Problem is solved. I had two problems. Reading 7E1 instead of 8N1 and a timing problem.
The first is solved by a comparison of the byte received. By subsracting 128 if the byte is larget than 128 , you get the same result as 7E1.
The second problem was solved by altering the timing of the arduino by 9600 baud. it's sampeling was to slow. By lowering the timings in SoftwareSerial.ccp the data was comming in correctly.
I now have an Arduino with Ethernet sending some counters to a syslog server in my network.
Now i just need a way to visualise this info.
Code: Select all
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
EthernetServer server(23);
void setup() {
Serial.begin(9600); // set baud to 9600
UCSR0C = (2<<UPM00)|(0<<USBS0)|(2<<UCSZ00)|(0<<UCPOL0); // 7E1
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
pinMode(3, OUTPUT);
Ethernet.begin(mac);
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
}
void loop() {
if (Serial.available() > 0) {
char serialByte = Serial.read();
server.write(serialByte);
digitalWrite(3, HIGH);
} else {
digitalWrite(3, LOW);
}
}
@PietjeNL, do you know the code or where to find it?PietjeNL wrote:IR requires a code to be send to the meter before it releases the telegram.