Pool pump man-in-the-middle SDA/SCL with ESP32

stealthrt
Posts: 6
Joined: Sat Aug 28, 2021 1:22 am

Pool pump man-in-the-middle SDA/SCL with ESP32

Postby stealthrt » Fri Apr 28, 2023 8:40 pm

Hey all I have found some code on GitHub that works with my pool pump but it seems my model is a little newer than the one they used on on their GitHub. Most things seem to work but what doesn't is that the buttons on the control board do not seem to call out correctly to the main board.

The code for the buttons look to be this:

Code: Select all

#define BUTTON_BOOST        0x44
#define BUTTON_TIMER        0x46
#define BUTTON_POWER        0x4C
#define BUTTON_LOCK         0x4E
#define BUTTON_SELF_CLEAN   0x74
The bulk of the data seems to be coming from void IRAM_ATTR Core1( void* p) {...

And perhaps within that is the button code?

Code: Select all

if (sendingKeyCode) {                  
   if (totalBitsSent < 8) {                    
       digitalWrite(dataPin, (buttonStatus << totalBitsSent) & 0x80 ? HIGH : LOW);
       totalBitsSent++;
   }
   // FALLING edge 8 while sending keycode
   else if (totalBitsSent == 8) {
       // Receive ACK
       pinMode(dataPin, GPIO_MODE_INPUT);                        
       digitalWrite(dataPin, HIGH);
       totalBitsSent++;                    
   }
   // FALLING edge 9 while sending keycode
   else {
       sendingKeyCode = false;
       totalBitsSent = 0;
   }
}
I did the rest api call (http://192.168.1.173:8080/api/v1/intex/swg/status) and got this:

Code: Select all

{
    "data": {
        "display": {
            "status": "ON",
            "brightness": 3,
            "current_code": "."
        },
        "status": {
            "power": "STANDBY",
            "boost": "OFF",
            "sleep": "OFF",
            "o3_generation": "OFF",
            "pump_low_flow": "OFF",
            "low_salt": "OFF",
            "high_salt": "OFF",
            "service": "OFF"
        },
        "mode": {
            "working": false,
            "programming": false
        }
    }
}
So I know it can communicate with it just fine. And I also did this debug rest api call (http://192.168.1.173:8080/api/v1/intex/swg/debug) and got this back:

Code: Select all

{
    "data": {
        "powerStatus": "0x01",
        "statusDigit1": "0x00",
        "statusDigit2": "0x02",
        "statusDigit3": "0x00",
        "displayingDigit1": "0x00",
        "displayingDigit2": "0x02",
        "current_code": ".",
        "readBuffer": "[0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X48, 0X01], [0X68, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6C, 0X00], [0X49, 0XFF], [0X48, 0X01], [0X6A, 0X02], [0X49, 0XFF], [0X48, 0X01], [0X00, 0X00]",
        "compilation_date": "Apr 27 2023",
        "compilation_time": "16:20:36",
        "otaUpdating": false,
        "removeWifiConfig": false,
        "machineON": true
        "wifiReconnecting": false,
        "readingMaster": true,
        "sendingKeyCode": false
    }
}
Would be great if someone more knowledgeable at binary and SDA/SCL would help me find my buttons binary code so that I can send that code to the pool pumps main controller.

The GitHub> https://github.com/jingsno/intex-swg-iot

Who is online

Users browsing this forum: No registered users and 37 guests