Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,878
» Latest member: lyraellington12
» Forum threads: 3,886
» Forum posts: 19,830

Full Statistics

Online Users
There are currently 38 online users.
» 0 Member(s) | 22 Guest(s)
AhrefsBot, Amazonbot, Baidu, Bing, Google, PetalBot, Sogou web, bot

Latest Threads
kc-868 AK
Forum: "KCS" v3 firmware
Last Post: admin
6 hours ago
» Replies: 10
» Views: 42
HAv2 ESPHome
Forum: KC868-HA /HA v2
Last Post: admin
7 hours ago
» Replies: 1
» Views: 9
KinCony ESP32 Tuya IoT ad...
Forum: KC868-ATC / Tuya adapter V2
Last Post: admin
Today, 05:55 AM
» Replies: 3
» Views: 43
KinCony Z1 Problem
Forum: KC868-AG / AG Pro / AG8 / Z1
Last Post: admin
Yesterday, 11:39 PM
» Replies: 14
» Views: 760
KC868-E16S/E16P demo conf...
Forum: KC868-E16S/E16P
Last Post: admin
Yesterday, 11:37 PM
» Replies: 20
» Views: 11,277
false start with KC868 A1...
Forum: KC868-A16v3
Last Post: admin
Yesterday, 11:36 PM
» Replies: 3
» Views: 28
KC868-A16 v1.6 – relays 9...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Yesterday, 11:34 PM
» Replies: 1
» Views: 14
New TA web interface unav...
Forum: TA
Last Post: admin
Yesterday, 01:10 AM
» Replies: 3
» Views: 23
AIO Hybrid wiring diagram
Forum: AIO Hybrid
Last Post: admin
04-05-2026, 05:45 AM
» Replies: 0
» Views: 7
Interface T16M E/S et AIO
Forum: News
Last Post: admin
04-04-2026, 11:05 PM
» Replies: 7
» Views: 98

  [arduino code examples for A2v3]-04 RS485 communication test
Posted by: admin - 04-20-2025, 05:54 AM - Forum: KC868-A2v3 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* RS485 Communication Test
*
* This program is a simple test for RS485 communication using ESP32-S3.
* It will send a message over RS485 and then read incoming messages.
* The TXD pin is defined as GPIO 18 and RXD pin is defined as GPIO 8.
*/

#include <HardwareSerial.h>

// Define RS485 pins
#define RS485_RXD 15
#define RS485_TXD 7

// Create a hardware serial object
HardwareSerial rs485Serial(1);

void setup() {
  // Start serial communication for debugging
  Serial.begin(115200);
  while (!Serial);

  // Initialize RS485 Serial communication
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);
 
  Serial.println("RS485 Test Start");
}

void loop() {
  // Send a test message
  rs485Serial.println("Hello from KinCony A2v3!");

  // Wait for a short period
  delay(1000);

  // Check if data is available to read
  if (rs485Serial.available()) {
    String receivedMessage = "";
    while (rs485Serial.available()) {
      char c = rs485Serial.read();
      receivedMessage += c;
    }
    // Print the received message
    Serial.print("Received: ");
    Serial.println(receivedMessage);
  }

  // Wait before sending the next message
  delay(2000);
}
arduino ino file download:

.zip   4-RS485-Test.zip (Size: 763 bytes / Downloads: 438)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   4-RS485-Test.ino.merged.zip (Size: 184.35 KB / Downloads: 419)

Print this item

  [arduino code examples for A2v3]-02 Read digital input ports state
Posted by: admin - 04-20-2025, 05:50 AM - Forum: KC868-A2v3 - No Replies

Code:
/**
* @brief Simple example to read two digital inputs using ESP32
* @details This program demonstrates how to read two digital input states
*          from GPIO16 and GPIO17 of an ESP32 development board.
*
* Made by KinCony IoT: https://www.kincony.com
*/

// Define the GPIO pins for digital inputs
#define INPUT1_PIN 16  // GPIO16 for Digital Input 1
#define INPUT2_PIN 17  // GPIO17 for Digital Input 2

void setup() {
    // Initialize the serial communication for debugging
    Serial.begin(115200);
    Serial.println("ESP32 Digital Input Read Example");

    // Set the input pins as INPUT
    pinMode(INPUT1_PIN, INPUT);
    pinMode(INPUT2_PIN, INPUT);
}

void loop() {
    // Read the state of the digital inputs
    int state1 = digitalRead(INPUT1_PIN);
    int state2 = digitalRead(INPUT2_PIN);

    // Print the states to the Serial Monitor
    Serial.print("Digital Input 1 State: ");
    Serial.println(state1);
    Serial.print("Digital Input 2 State: ");
    Serial.println(state2);

    // Wait for 500 milliseconds before reading again
    delay(500);
}
arduino ino file download:

.zip   2-digital-input.zip (Size: 667 bytes / Downloads: 393)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   2-digital-input.ino.merged.zip (Size: 179.35 KB / Downloads: 387)

Print this item

  [arduino code examples for A2v3]-01 Turn ON/OFF OUTPUT
Posted by: admin - 04-20-2025, 05:48 AM - Forum: KC868-A2v3 - No Replies

Code:
/**
* @brief Simple example to control two relays using ESP32
* @details This program demonstrates how to control two relays connected to GPIO40 and GPIO39
*          of an ESP32 development board.
*
* Made by KinCony IoT: https://www.kincony.com
*/

// Define the GPIO pins for the relays
#define RELAY1_PIN 40  // GPIO40 for Relay 1
#define RELAY2_PIN 39  // GPIO39 for Relay 2

void setup() {
    // Initialize the serial communication for debugging
    Serial.begin(115200);
    Serial.println("ESP32 Relay Control Example");

    // Set the relay pins as output
    pinMode(RELAY1_PIN, OUTPUT);
    pinMode(RELAY2_PIN, OUTPUT);

    // Turn off both relays at startup (assuming active LOW relays)
    digitalWrite(RELAY1_PIN, HIGH);
    digitalWrite(RELAY2_PIN, HIGH);
}

void loop() {
    Serial.println("Turning ON Relay 1");
    digitalWrite(RELAY1_PIN, LOW); // Activate relay 1
    delay(1000); // Wait for 1 second
   
    Serial.println("Turning OFF Relay 1");
    digitalWrite(RELAY1_PIN, HIGH); // Deactivate relay 1
    delay(1000);
   
    Serial.println("Turning ON Relay 2");
    digitalWrite(RELAY2_PIN, LOW); // Activate relay 2
    delay(1000);
   
    Serial.println("Turning OFF Relay 2");
    digitalWrite(RELAY2_PIN, HIGH); // Deactivate relay 2
    delay(1000);
}
arduino ino file download:

.zip   1-output.zip (Size: 683 bytes / Downloads: 394)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   1-output.ino.merged.zip (Size: 179.19 KB / Downloads: 428)

Print this item

  KC868-A2v3 ESPHome yaml for home assistant
Posted by: admin - 04-20-2025, 05:46 AM - Forum: KC868-A2v3 - Replies (2)

   

Code:
esphome:
  name: a2v3
  friendly_name: a2v3

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ethernet:
  type: W5500
  clk_pin: GPIO42
  mosi_pin: GPIO43
  miso_pin: GPIO44
  cs_pin: GPIO41
  interrupt_pin: GPIO2
  reset_pin: GPIO1

i2c:
   - id: bus_a
     sda: 48
     scl: 47
     scan: true
     frequency: 400kHz

uart:
  - id: uart_1
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
    tx_pin: 7
    rx_pin: 15

  - id: uart_sim7600
    baud_rate: 115200
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
      sequence:
        - lambda: UARTDebug::log_string(direction, bytes);
    tx_pin: 10
    rx_pin: 9

switch:

  - platform: gpio
    pin: 40
    name: "A2v3-Relay1"

  - platform: gpio
    pin: 39
    name: "A2v3-Relay2"

  - platform: uart
    uart_id: uart_1
    name: "RS485 Button"
    data: [0x11, 0x22, 0x33, 0x44, 0x55]

  - platform: uart
    uart_id: uart_sim7600
    name: "UART 4G"
    data: "AT+CGSN\r\n" # read 4G SIM7600 ID

binary_sensor:
  - platform: gpio
    name: "A2v3-input1"
    pin:
      number: 16
      inverted: true

  - platform: gpio
    name: "A2v3-input2"
    pin:
      number: 17
      inverted: true

  - platform: gpio
    name: "IO18"
    pin:
      number: 18
      inverted: true

  - platform: gpio
    name: "IO8"
    pin:
      number: 8
      inverted: true

  - platform: gpio
    name: "IO4"
    pin:
      number: 4
      mode:
        input: true
        pullup: true
      inverted: true

  - platform: gpio
    name: "IO5"
    pin:
      number: 5
      mode:
        input: true
        pullup: true
      inverted: true

  - platform: gpio
    name: "IO6"
    pin:
      number: 6
      mode:
        input: true
        pullup: true
      inverted: true

  - platform: gpio
    name: "IO38"
    pin:
      number: 38
      mode:
        input: true
        pullup: true
      inverted: true

web_server:
  port: 80

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

display:
  - platform: ssd1306_i2c
    i2c_id: bus_a
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 0, id(roboto), "A2v3");
esphome yaml file download:

.txt   A2v3-HA.txt (Size: 2.39 KB / Downloads: 347)

Print this item

  KC868-A2v3 ESP32-S3 IO pins define
Posted by: admin - 04-20-2025, 05:44 AM - Forum: KC868-A2v3 - No Replies

IIC Bus:

SDA:GPIO48
SCL:GPIO47

24C02 EPROM i2c address: 0x50
DS3231 RTC i2c address: 0x68
SSD1306 display: i2c address:0x3c
-----------------

1-wire (pull-up resistance on PCB):
1-wire(TMP1):GPIO18
1-wire(TMP2):GPIO8


free GPIOs (without pull-up resistance on PCB):
free gpio-1:GPIO4
free gpio-2:GPIO5
free gpio-3:GPIO6
free gpio-4:GPIO38
-----------------

Ethernet (W5500) I/O define:

clk_pin: GPIO42
mosi_pin: GPIO43
miso_pin: GPIO44
cs_pin: GPIO41

interrupt_pin: GPIO2
reset_pin: GPIO1

--------------------
RS485:
RXD:GPIO15
TXD:GPIO7

4G module:
RXD:GPIO9
TXD:GPIO10

--------------------
SD Card:
SPI-MOSI:GPIO12
SPI-SCK:GPIO13
SPI-MISO:GPIO14
SPI-CS:GPIO11
SPI-CD:GPIO21

--------------------
Relay1:GPIO40
Relay2:GPIO39

--------------------
digital input-1:GPIO16
digital input-2:GPIO17

Print this item

  KC868-A16 IR Input
Posted by: cyberrailpete - 04-20-2025, 05:33 AM - Forum: KC868-A16 - Replies (11)

Hello.

I have a KC868-A16 - Great board. I have a number of IR sensors that need to send back state via MQTT to different topics so have had to write custom sketch in Aurdino IDE.

Problem is the sensor never goes inactive. I have tested the IR with a meter and voltage drop on digital out when active and high when inactive.

KC868-A16 seems to be 12v on the input which is weird. Help please!

Print this item

  RF Transmitter not working in ESPHome
Posted by: johnsmith8439 - 04-19-2025, 04:20 PM - Forum: KC868-AG / AG Pro / AG8 / Z1 - Replies (4)

Hello,
I installed ESPHome on the KC868-AG. RF receiver works, I can receive RF signals from the smart plug's remote:

[23:17:05][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='10010010001010100110110110010011'
[23:17:05][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='10010010001010100110110110010011'
[23:17:05][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='10010010001010100110110110010011'
[23:17:05][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='1001001000101010011011011001001'

But transmitter doesn't work, I cannot control the smart plug with RF using the transmitter.

The log after using transmitter:
[23:29:02][D][button:010]: 'Smart Plug On' Pressed.
[23:29:02][W][component:239]: Component api took a long time for an operation (287 ms).
[23:29:02][W][component:240]: Components should block for at most 30 ms.
[23:29:02][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='10010010001010100110110110010011'
[23:29:02][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='10010010001010100110110110010011'
[23:29:02][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='10010010001010100110110110010011'
[23:29:02][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=2 data='1001001000101010011011011001001'

Here is my ESPHome code:

Code:
remote_transmitter:
  - id: transmitter_ir
    pin: GPIO2
    carrier_duty_percent: 50%
  - id: transmitter_rf
    pin: GPIO22
    carrier_duty_percent: 50%
remote_receiver:
  # see https://esphome.io/components/remote_transmitter.html#setting-up-infrared-devices
  # for details on discovering the correct codes for your devices
  - id: receiver_ir
    pin:
      number: GPIO23
      inverted: True
    dump: rc_switch
  # see https://esphome.io/components/remote_transmitter.html#setting-up-rf-devices
  # for details on discovering the correct codes for your devices
  - id: receiver_rf
    pin:
      number: GPIO13
    dump: rc_switch
    # Settings to optimize recognition of RF devices
    tolerance: 50%
    filter: 250us
    idle: 4ms
    buffer_size: 2kb   
button:
  - platform: template
    name: "Door Chime"
    on_press:
      - remote_transmitter.transmit_rc_switch_raw:
          transmitter_id: transmitter_rf
          protocol: 5
          code: "001010100010100000"
          repeat:
            times: 10
            wait_time: 0s
  - platform: template
    name: "Smart Plug On"
    on_press:
      - remote_transmitter.transmit_rc_switch_raw:
          transmitter_id: transmitter_rf
          protocol: 2
          code: "10010010001010100110110110010011"
          repeat:
            times: 10
            wait_time: 0s
  - platform: template
    name: "Smart Plug Off"
    on_press:
      - remote_transmitter.transmit_rc_switch_raw:
          transmitter_id: transmitter_rf
          protocol: 2
          code: "01000100101011010110100011010011"
          repeat:
            times: 10
            wait_time: 0s

Print this item

  Input protection
Posted by: wchpikus - 04-19-2025, 02:51 PM - Forum: Development - Replies (5)

Hello
One of binary input stop working..
I checked and translator was damage.
I do not know-how how, but it could be protect emc or overload. 
I just replace them, but I wojny about induction when I will connect them to 20m ftp.

Print this item

  Kc-868-a32 uart
Posted by: wchpikus - 04-18-2025, 06:51 PM - Forum: KC868-A32/A32 Pro - Replies (3)

Hello
What ping are used to rs485?
Failed config

uart: [source /config/esphome/rolety-kc868-a32.yaml:27]
  - id: uart_modbus
    baud_rate: 9600
    tx_pin: 9
    
    This pin cannot be used on ESP32s and is already used by the flash interface (function: Flash Data 1).
    rx_pin: 8

Regards

Print this item

  Soil moisture sensors
Posted by: xarouli5 - 04-18-2025, 06:03 PM - Forum: KC868-AIO - Replies (10)

I bought the next sensor to experiment:

Soil Moisture Sensor 
https://a.aliexpress.com/_ExqUPDK

Powered 3.3v, gnd and tried AO on AI (9-16) & DO on DI (1-8). No change seen on inputs of AIO when I dipped sensor in water and out.

Any ideas?

Print this item