I bought an HD-D16 controller by Huidu company and the panel worked with it. I used HDPlayer software to set it up. Driver CNS7263, Decoding 138.
after that I tried to reverse engineer and look at the Latch and Clock pins on ESP32 serial monitor.
#include <Arduino.h>
#include "driver/pcnt.h"
#define LAT_PIN 4
#define CLK_PIN 16
// Buffer to hold the secret sequence
#define MAX_SEQS 300
volatile int16_t recorded_pulses[MAX_SEQS];
volatile int seq_index = 0;
// Interrupt triggers ONLY when Latch drops to LOW (End of a command)
void IRAM_ATTR lat_isr() {
int16_t count = 0;
// 1. Instantly pull the hardware count
pcnt_get_counter_value(PCNT_UNIT_0, &count);
// 2. Clear the hardware counter for the next latch
pcnt_counter_clear(PCNT_UNIT_0);
// 3. Filter out normal row data (1 clock) and huge VSYNC overloads (1000+ clocks)
if (count > 2 && count < 1000) {
if (seq_index < MAX_SEQS) {
recorded_pulses[seq_index] = count;
seq_index++;
}
}
}
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("\n--- ESP32 HARDWARE (PCNT) WIRETAP ACTIVE ---");
Serial.println("Waiting for HD-D16 boot sequence...");
pinMode(LAT_PIN, INPUT_PULLDOWN);
pinMode(CLK_PIN, INPUT_PULLDOWN);
// =========================================================
// ESP32 HARDWARE PULSE COUNTER CONFIGURATION
// This counts 20MHz signals natively without crashing the CPU
// =========================================================
pcnt_config_t pcnt_config = {
.pulse_gpio_num = CLK_PIN,
.ctrl_gpio_num = LAT_PIN,
.lctrl_mode = PCNT_MODE_DISABLE, // Disable counting when LAT is LOW
.hctrl_mode = PCNT_MODE_KEEP, // Keep counting when LAT is HIGH
.pos_mode = PCNT_COUNT_INC, // Increment on CLK rising edge
.neg_mode = PCNT_COUNT_DIS, // Ignore CLK falling edge
.counter_h_lim = 32767,
.counter_l_lim = -1,
.unit = PCNT_UNIT_0,
.channel = PCNT_CHANNEL_0,
};
pcnt_unit_config(&pcnt_config);
pcnt_counter_pause(PCNT_UNIT_0);
pcnt_counter_clear(PCNT_UNIT_0);
pcnt_counter_resume(PCNT_UNIT_0);
// Attach a lightweight interrupt to read the hardware counter when Latch falls
attachInterrupt(digitalPinToInterrupt(LAT_PIN), lat_isr, FALLING);
}
// Variables to detect when the burst of commands is finished
int last_seq_index = 0;
uint32_t last_change_time = 0;
void loop() {
int current_index = seq_index;
if (current_index != last_seq_index) {
last_seq_index = current_index;
last_change_time = millis();
}
// If we collected data and 1 FULL SECOND has passed with no new commands...
if (current_index > 0 && (millis() - last_change_time > 1000)) {
noInterrupts(); // Pause briefly to copy data safely
int count = seq_index;
int16_t temp_array[MAX_SEQS];
for(int i = 0; i < count; i++) temp_array[i] = recorded_pulses[i];
// Reset trackers for next time
seq_index = 0;
last_seq_index = 0;
interrupts();
Serial.println("\n[!] INTERCEPTED CONFIGURATION BURST [!]");
Serial.print("LAT HIGH + CLK Pulses: ");
for (int i = 0; i < count; i++) {
Serial.print(temp_array[i]);
Serial.print(", ");
}
Serial.println("\n-------------------------------------------");
}
}
this is the sequence I get. not only during booting, but even after that.
12:47:02.441 -> [!] INTERCEPTED CONFIGURATION BURST [!]
12:47:02.441 -> LAT HIGH + CLK Pulses: 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 11, 26, 14, 4, 26, 14, 6, 26, 12, 9, 30, 10, 26, 14, 4, 26, 14, 6, 26, 14, 9, 26, 14, 10, 26, 14, 4, 36, 8, 37, 8, 26, 14, 10, 34, 29, 14, 26, 14, 8, 35, 10, 28, 10, 4, 26, 14, 6, 33, 8, 29, 19, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 13, 10, 26, 14, 4, 39, 6, 29, 15, 26, 14, 10, 36, 4, 29, 10, 29, 9, 26, 14, 10, 26, 14, 4, 27, 12, 6, 26, 14, 8, 28, 11, 10, 28, 11, 4, 26, 14, 7, 26, 14, 8, 37, 10, 26, 14, 4, 31, 7, 26, 13, 8, 26, 13, 10, 31, 4, 29, 13, 26, 14, 8, 26, 14, 10, 33, 4, 26, 14, 6, 41, 8, 29, 11, 32, 4, 38, 6, 29, 10, 27, 12, 10, 29, 5, 34, 6, 29, 14, 26, 12, 10, 29, 10, 4, 29, 13, 26, 14, 8, 37, 10, 29, 6, 26, 14, 6, 39, 8, 26, 14, 10, 26, 12, 4, 26, 14, 6, 29, 10, 28, 10, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 27, 11, 10, 36, 4, 26, 14, 6, 26, 14, 9, 37, 10, 29, 7, 26, 14, 7, 30, 9, 26, 12, 10, 26, 14, 4, 27, 11, 7, 29, 13, 26, 14, 10, 29, 10, 4, 40, 6, 29, 12, 26, 14, 10, 30, 5, 29, 11, 29, 11, 29, 13, 29, 10, 26, 14, 6, 26, 14, 8, 26, 14, 10, 29, 9, 4, 26, 14, 6, 26, 14, 9, 26, 14, 10, 26, 14, 4, 35, 7, 43, 9, 26, 14, 10, 32, 4, 26, 14, 7, 27, 12,
12:47:02.542 -> -------------------------------------------
12:47:05.361 ->
12:47:05.361 -> [!] INTERCEPTED CONFIGURATION BURST [!]
12:47:05.361 -> LAT HIGH + CLK Pulses: 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 30, 9, 29, 15, 26, 14, 4, 26, 14, 6, 33, 8, 26, 14, 11, 36, 4, 35, 6, 33, 9, 34, 11, 29, 12, 26, 13, 6, 30, 9, 29, 16, 26, 12, 4, 26, 14, 8, 38, 9, 26, 14, 10, 26, 14, 4, 33, 7, 30, 8, 30, 10, 26, 14, 4, 29, 14, 26, 14, 8, 26, 14, 10, 29, 11, 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 13, 4, 26, 14, 6, 26, 13, 8, 29, 16, 26, 13, 4, 38, 6, 26, 12, 8, 26, 14, 10, 29, 8, 26, 14, 6, 26, 14, 8, 26, 14, 10, 29, 10, 4, 26, 14, 6, 26, 14, 8, 35, 10, 29, 7, 26, 14, 6, 26, 14, 8, 22, 24, 26, 12, 4, 29, 13, 26, 14, 8, 26, 14, 10, 26, 12, 4, 26, 14, 7, 26, 14, 8, 26, 13, 10, 29, 13, 29, 11, 26, 14, 8, 29, 16, 26, 14, 4, 37, 6, 29, 11, 29, 14, 26, 14, 4, 33, 6, 29, 15, 26, 14, 10, 39, 4, 38, 6, 26, 14, 8, 34, 10, 29, 11, 30, 6, 35, 8, 29, 19, 26, 12, 4, 26, 14, 6, 27, 12, 8, 29, 15, 26, 14, 4, 26, 14, 6, 28, 10, 8, 26, 14, 10, 26, 14, 4, 29, 15, 26, 13, 8, 29, 13, 28, 11, 4, 26, 13, 7, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 12, 4, 33, 6, 26, 14, 8, 26, 14, 10, 31, 4, 29, 10, 6, 26, 14, 8, 29, 17, 29, 8,
12:47:05.466 -> -------------------------------------------
12:47:08.276 ->
12:47:08.276 -> [!] INTERCEPTED CONFIGURATION BURST [!]
12:47:08.276 -> LAT HIGH + CLK Pulses: 26, 14, 4, 26, 14, 7, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 29, 10, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 39, 4, 29, 8, 38, 8, 26, 14, 10, 29, 5, 27, 11, 6, 32, 8, 29, 10, 10, 26, 12, 4, 26, 14, 6, 29, 13, 28, 10, 10, 26, 14, 4, 26, 14, 6, 31, 8, 26, 14, 10, 31, 4, 29, 9, 6, 26, 14, 8, 26, 14, 10, 29, 8, 27, 11, 7, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 13, 7, 34, 8, 26, 14, 10, 41, 4, 31, 6, 29, 14, 35, 10, 39, 4, 29, 14, 26, 14, 8, 29, 9, 10, 26, 12, 4, 26, 12, 6, 26, 13, 8, 36, 10, 29, 9, 4, 26, 14, 6, 29, 11, 29, 14, 26, 14, 4, 29, 9, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 7, 26, 14, 8, 40, 10, 27, 11, 4, 26, 14, 7, 26, 14, 8, 26, 14, 10, 43, 4, 26, 14, 7, 29, 15, 29, 17, 28, 10, 4, 29, 9, 7, 29, 15, 26, 14, 10, 26, 14, 4, 31, 7, 26, 13, 8, 26, 13, 10, 40, 4, 32, 6, 33, 8, 37, 10, 26, 14, 4, 34, 6, 29, 9, 8, 26, 12, 10, 26, 14, 4, 30, 6, 29, 16, 26, 13, 11, 26, 14, 4, 29, 26, 13, 8, 26, 14, 10, 29, 9, 29, 11, 26, 13, 9, 26, 12, 10, 26, 14, 4, 26, 14, 6, 26, 13, 8, 26, 14, 10, 26, 14, 4, 34, 7, 26, 14, 8, 26, 14, 10, 32, 4, 29, 13, 26, 12, 8, 32, 10, 26, 14, 4, 26, 14, 7,
12:47:08.346 -> -------------------------------------------
12:47:11.148 ->
12:47:11.148 -> [!] INTERCEPTED CONFIGURATION BURST [!]
12:47:11.148 -> LAT HIGH + CLK Pulses: 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 12, 26, 14, 8, 29, 18, 26, 14, 4, 26, 14, 6, 26, 12, 8, 26, 14, 11, 39, 4, 37, 6, 29, 10, 9, 26, 14, 10, 30, 4, 43, 7, 26, 14, 9, 29, 14, 29, 9, 26, 12, 8, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 14, 4, 31, 6, 26, 14, 8, 35, 10, 28, 11, 4, 29, 11, 26, 14, 8, 31, 10, 28, 10, 4, 26, 14, 6, 38, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 29, 14, 32, 10, 33, 4, 29, 12, 26, 14, 8, 28, 11, 10, 26, 14, 4, 26, 14, 7, 26, 14, 8, 36, 10, 26, 14, 4, 26, 13, 7, 31, 8, 29, 16, 26, 14, 4, 29, 7, 29, 16, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 31, 10, 26, 14, 4, 36, 6, 29, 12, 29, 17, 26, 14, 4, 29, 13, 29, 16, 26, 14, 10, 26, 14, 4, 26, 14, 7, 26, 14, 8, 37, 10, 29, 6, 26, 14, 7, 26, 14, 8, 29, 17, 26, 14, 4, 27, 11, 7, 29, 16, 26, 14, 10, 26, 14, 4, 27, 11, 6, 26, 14, 8, 26, 14, 10, 26, 14, 4, 29, 8, 26, 14, 8, 26, 13, 10, 29, 10, 26, 14, 6, 32, 8, 29, 15, 29, 9, 26, 13, 6, 41, 8, 26, 14, 10, 26, 14, 4, 34, 6, 32, 8, 26, 14, 11, 26, 14, 4, 29, 10, 6, 26, 14, 9, 29, 11, 26, 14, 4, 26, 12, 6, 26, 11,
12:47:11.262 -> -------------------------------------------
12:47:14.075 ->
12:47:14.075 -> [!] INTERCEPTED CONFIGURATION BURST [!]
12:47:14.075 -> LAT HIGH + CLK Pulses: 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 29, 12, 26, 14, 10, 26, 14, 4, 32, 6, 26, 14, 8, 26, 14, 10, 29, 9, 29, 14, 26, 14, 8, 29, 13, 29, 9, 26, 14, 6, 36, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 40, 4, 31, 6, 43, 8, 26, 14, 10, 29, 9, 4, 26, 14, 6, 26, 14, 8, 29, 14, 26, 14, 4, 26, 14, 7, 38, 8, 32, 10, 26, 14, 4, 37, 6, 31, 8, 29, 18, 31, 4, 29, 11, 26, 14, 8, 26, 14, 10, 29, 7, 26, 14, 7, 26, 14, 8, 29, 15, 26, 14, 4, 26, 14, 6, 26, 14, 8, 29, 14, 26, 14, 4, 26, 14, 6, 26, 14, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 29, 9, 8, 26, 14, 10, 26, 14, 4, 26, 14, 6, 40, 8, 29, 12, 26, 14, 4, 26, 14, 6, 29, 13, 27, 11, 10, 26, 14, 4, 29, 8, 26, 14, 8, 26, 14, 10, 26, 13, 4, 26,ets Jul 29 2019 12:21:46
12:47:14.725 ->
Though not prominent, there is a pattern like
26, 14, 4
26, 14, 6
26, 14, 8
26, 14, 10