Hi, I'm working on communicating with my Pellet oven, that uses a one wire serial. I have made a converter that has worked before, so I suspect my code for the ESP32s
The oven works by me (ESP32) sending two bytes 0x00 for RAM and then 0x03 for RAM adr with water temp.
I then get two bytes back, CRC and the Temp.
The issue is that I'm supposed to get CRC 47 and Temp 44 back (CRC is 3+temp 44 = 47)
First time I get 0 & 3, Next time I get 47 & 44 and this way it continues.
Looks like I'm getting a empty byte first or ?
int askretur1;
int askretur2;
//Oven messages
byte messageon [] = {0x80, 0x21, 0x01, 0xA2};
byte messageoff [] = {0x80, 0x21, 0x06, 0xA7};
byte messageask [] = {0x00, 0x03};
void setup() {
Serial2.begin (1200, SERIAL_8N2);
Serial.begin(115200);
void loop(){
Serial2.write (messageask, sizeof (messageask)); //Sending {0x00, 0x03} to ask for Temp,
if (Serial2.available() >= 2) { //If both bytes recieved
delay(100);
askretur1=Serial2.read(); //Get first byte (expected CRC)
delay(100);
askretur2=Serial2.read(); } //Get second byte (expect Temp value)
Serial.println(" Byte1: "); //Send to serial monitor
Serial.write(askretur1);
Serial.println(" Byte2: ");
Serial.write(askretur2);
delay(5000);
}
Thanks for any help.