Yogui79 / IntexPureSpa

Intex® PureSpa remote control for Home Automation
MIT License
61 stars 15 forks source link

Network ID search #40

Open delgigio opened 2 years ago

delgigio commented 2 years ago

Good morning, I have carefully followed the guide you have given me, I have managed to find the channels with which the whirlpool communicates which are 12 and 13. Unfortunately, when I load the program to search for the Network ID, the blue LED does not flash as indicated, it always has the same frequency as all the other channels. The detection of the channels has been done over and over again and the result was always channel 12 and 13. I have also tried inserting channels 9 10 11 12 13 14 15 16 but with very bad results. What can I do? I hope you can help me... Thank you in advance.

HansEhls commented 2 years ago

Could you Upload a screenshot of the Programm when you entered the channel

delgigio commented 2 years ago

This is the channel search program

/*

uint8_t test= 0x00;

if defined (AVR)

include

SoftwareSerial mySerial(2, 4); // RX, TX // Output defines

define DO_SET 6

define DO_CS 5

elif defined (ESP32)

define mySerial Serial2

define DO_SET 19

define DO_CS 18

endif

void setup() { mySerial.begin(9600); Serial.begin(115200);

pinMode(DO_SET, OUTPUT); // SET pinMode(DO_CS, OUTPUT); // CS - можно просто соединить с GND delay(1000);

digitalWrite(DO_CS, LOW); // притягиваем к массе digitalWrite(DO_SET, LOW); delay(100);

// querryversion();

}

void loop() {

SetSettingsChannel(test++); Serial.print("Channel "); Serial.println(test-1, HEX); delay(1000); }

void SetSettingsChannel(uint8_t channelid){ byte Config[20]; char res[5];

Config[1]=0xAA;
Config[2]=0x5A;

//device ID Config[3]=0xB9; Config[4]=0x46;

//Network ID Config[5]=0x00; Config[6]=0X00;

Config[7]=0x00;

//RF Power Config[8]=0x03;

Config[9]=0x00;

// Baudrate Config[10]=0x04;

Config[11]=0x00; //channel Config[12]=channelid;

Config[13]=0x00; Config[14]=0x00; Config[15]=0x00; Config[16]=0x12; Config[17]=0x00; //reset checksum Config[18] =0x0;

//calculate Checsum for(int i=1;i<17;i++){

Config[18] =Config[18] +Config[i];

} / Serial.print (F(" Config ")); for(int i=1;i<19;i++){ sprintf(&res[0],"%02X",Config[i]); Serial.print(res); Serial.print(F(" "));
} Serial.println (F(""));
/ digitalWrite(DO_SET, LOW); delay(500);

for(int i=1;i<19;i++){

mySerial.write(Config[i]);

} delay(1000);

digitalWrite(DO_SET, HIGH);

}

void querryversion(){ byte Config[20]; char res[5];

//byte checksum; Config[1]=0xAA;
Config[2]=0x5D; Config[3]=0x00; Config[4]=0x00; Config[5]=0x00; Config[6]=0x00; Config[7]=0x00; Config[8]=0x00; Config[9]=0x00; Config[10]=0x00; Config[11]=0x00; Config[12]=0x00; Config[13]=0x00; Config[14]=0x00; Config[15]=0x00; Config[16]=0x00; Config[17]=0x00; Config[18] =0x07;

Serial.print (F("Querry version ")); for(int i=1;i<19;i++){ sprintf(&res[0],"%02X",Config[i]); Serial.print(res); Serial.print(" ");
}

Serial.println (F("")); digitalWrite(DO_SET, LOW); delay(500);

for(int i=1;i<19;i++){

mySerial.write(Config[i]);

} delay(1000); digitalWrite(DO_SET, HIGH); }

This is the programme for searching the network ID once the channels have been found.

/*

uint8_t Channel =0x13;

define SEARCH_NETWORK_ID

uint16_t idtosend =0x0000;

if defined (AVR)

include

// Output defines SoftwareSerial mySerial(2, 4); // RX, TX // Output defines

define DO_SET 6

define DO_CS 5

elif defined (ESP32)

define mySerial Serial2

define DO_SET 19

define DO_CS 18

endif

unsigned long LastTimeReciveData; uint16_t SearchNetworkIdDataCount; bool datareceived; bool NetworkIdOk;

void setup() { mySerial.begin(9600); Serial.begin(115200); pinMode(DO_SET, OUTPUT); // SET pinMode(DO_CS, OUTPUT); // CS delay(1000);

digitalWrite(DO_CS, LOW);
digitalWrite(DO_SET, LOW); Serial.println(F("")); Serial.println(F("-----------------------------------------------------------")); Serial.println(F(""));

ifdef SEARCH_NETWORK_ID

Serial.println (F(" Search Network id active"));

else

Serial.println (F(" Check Channel")); Serial.println (F("")); Serial.println (F(" LED on LC12s should blink fast"));

endif

Serial.println(F("")); Serial.println(F("-----------------------------------------------------------"));

ChangeSettings(idtosend++);

//querryversion(); }

void loop() { char res[5];

ifdef AVR

mySerial.listen(); if ( mySerial.overflow() ) { Serial.println("overflow"); while ( mySerial.available() ) mySerial.read(); } else

endif

{
if (mySerial.available()) { uint8_t c =mySerial.read();

  if (!NetworkIdOk){
    sprintf(&res[0],"%02X",c);
    Serial.write(res);
    Serial.print(" ");
    datareceived = true;
    SearchNetworkIdDataCount++;
  }     
 if (SearchNetworkIdDataCount >1500 && !NetworkIdOk){
    NetworkIdOk = true;
    uint16_t YourNetworkId = idtosend-1;
    sprintf(&res[0],"%02X",YourNetworkId);
    Serial.println (F(""));
    Serial.println (F("-----------------------------------------------------------")); 
    Serial.println (F(""));
    Serial.println (F("          Your network id is :"));
    Serial.println (F(""));
    Serial.print (F("                 0x"));
    Serial.write(res);
    Serial.println (F(""));
    Serial.println (F(""));
    Serial.println (F("-----------------------------------------------------------")); 
 }
  LastTimeReciveData =millis(); 
 }

}

ifdef SEARCH_NETWORK_ID

if ((millis()-LastTimeReciveData > 1000 ) && datareceived ){ Serial.println(""); datareceived = false; SearchNetworkIdDataCount = 0; ChangeSettings(idtosend++); }

if (millis()-LastTimeReciveData > 120000 ){ Serial.println(""); Serial.println("Timeout"); SearchNetworkIdDataCount = 0; datareceived = false; ChangeSettings(idtosend++); }

endif

}

void ChangeSettings(uint16_t id){ byte Config[20]; char res[5];

//byte checksum; Config[1]=0xAA;
Config[2]=0x5A; Config[3]=0xB9; Config[4]=0x46; Config[5]=id>>8; Config[6]=id; Config[7]=0x00; Config[8]=0x03; Config[9]=0x00; Config[10]=0x04; Config[11]=0x00; Config[12]=Channel; Config[13]=0x00; Config[14]=0x00; Config[15]=0x00; Config[16]=0x12; Config[17]=0x00; Config[18] =0x0;

//calculate Checksum for(int i=1;i<17;i++){ Config[18] =Config[18] +Config[i]; }

Serial.println (F(""));
Serial.print (F("Config ")); for(int i=1;i<19;i++){ sprintf(&res[0],"%02X",Config[i]); Serial.print(res); Serial.print(F(" "));
} Serial.println (F(""));

digitalWrite(DO_SET, LOW); delay(500);

for(int i=1;i<19;i++){

mySerial.write(Config[i]);

} delay(1000); digitalWrite(DO_SET, HIGH);

}

void querryversion(){ byte Config[20]; char res[5];

//byte checksum; Config[1]=0xAA;
Config[2]=0x5D; Config[3]=0x00; Config[4]=0x00; Config[5]=0x00; Config[6]=0x00; Config[7]=0x00; Config[8]=0x00; Config[9]=0x00; Config[10]=0x00; Config[11]=0x00; Config[12]=0x00; Config[13]=0x00; Config[14]=0x00; Config[15]=0x00; Config[16]=0x00; Config[17]=0x00; Config[18] =0x07;

Serial.print (F("Querry version ")); for(int i=1;i<19;i++){ sprintf(&res[0],"%02X",Config[i]); Serial.print(res); Serial.print(" ");
}

Serial.println (F("")); digitalWrite(DO_SET, LOW); delay(500);

for(int i=1;i<19;i++){

mySerial.write(Config[i]);

} delay(1000); digitalWrite(DO_SET, HIGH);

}

Yogui79 commented 2 years ago

Hello,

1.could you please say me whats append if you comment this line
//#define SEARCH_NETWORK_ID

2.Enable again this line #define SEARCH_NETWORK_ID

3.Use putty an log the serial communication, as mentioned in the description, at lease 36h 0 4.Poste the logged file

delgigio commented 2 years ago

Evening, point one I did not understand what you mean. For point two should I add the two bars? // or what should I write? Point three the Putty I haven't used yet since the led light doesn't have the correct frequency.

Thanks for helping me

Yogui79 commented 2 years ago

for point 1 make a video please from the LC12S with the right chanel

for point 2 write #define SEARCH_NETWORK_ID on line 28 from the SearchNetworkId.ino

Yogui79 commented 2 years ago

otther remarke you need to be close to your pump pump and display should be on without error E81

delgigio commented 2 years ago

To do the signal detection I was close to about 50 centimetres with the display on without any error. In the program loaded on ESP32 I had written as you indicated (#define SEARCH_NETWORK_ID). Thank you