Smart Home Automation Forum
[arduino code examples for AIO Hybrid]-09 how to communication with Tuya Zigbee modul - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=93)
+--- Forum: AIO Hybrid (https://www.kincony.com/forum/forumdisplay.php?fid=94)
+--- Thread: [arduino code examples for AIO Hybrid]-09 how to communication with Tuya Zigbee modul (/showthread.php?tid=8543)



[arduino code examples for AIO Hybrid]-09 how to communication with Tuya Zigbee modul - admin - 09-15-2025

Code:
#define TUYA_RXD 15
#define TUYA_TXD 48

void setup() {
  Serial0.begin(115200);  // Serial0
  while (!Serial0);

  Serial2.begin(115200, SERIAL_8N1, TUYA_RXD, TUYA_TXD);
  delay(100);

  byte tuya_cmd[] = {0x55, 0xAA, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04};
  Serial0.println("send data to Tuya module:");
  for (int i = 0; i < sizeof(tuya_cmd); i++) {
    Serial0.printf("%02X ", tuya_cmd[i]);
    Serial2.write(tuya_cmd[i]);
  }
  Serial0.println();
}

void loop() {
  if (Serial2.available()) {
    Serial0.print("received from tuya: ");
    while (Serial2.available()) {
      byte b = Serial2.read();
      Serial0.printf("%02X ", b);
    }
    Serial0.println();
  }

  delay(100);
}
arduino ino file download:

.zip   9-Zigbee-ZSU.zip (Size: 496 bytes / Downloads: 193)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   9-Zigbee-ZSU.ino.merged.zip (Size: 190.24 KB / Downloads: 180)