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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,424
» Latest member: pvc patches canada
» Forum threads: 3,666
» Forum posts: 18,981

Full Statistics

Online Users
There are currently 73 online users.
» 1 Member(s) | 60 Guest(s)
AhrefsBot, Amazonbot, Google, PetalBot, Yandex, bot, Lupi84

Latest Threads
KC868-A2 SIM7600 with Tuy...
Forum: KC868-A2
Last Post: WestfieldGhost
7 hours ago
» Replies: 34
» Views: 3,979
KC868-A16 v1 with KCS v2....
Forum: "KCS" v2 firmware system
Last Post: admin
8 hours ago
» Replies: 9
» Views: 68
B24M output mosfet relay ...
Forum: B24M
Last Post: admin
8 hours ago
» Replies: 1
» Views: 6
Feedback: Product line di...
Forum: Suggestions and feedback on KinCony's products
Last Post: admin
11 hours ago
» Replies: 1
» Views: 15
Not able to connect
Forum: KC868-E16S/E16P
Last Post: admin
Today, 06:54 AM
» Replies: 1
» Views: 10
"KCS" v3.19.0 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
Today, 01:17 AM
» Replies: 0
» Views: 27
flash Kincony software to...
Forum: DIY Project
Last Post: admin
Today, 12:14 AM
» Replies: 14
» Views: 84
KC868-A6 - how to connect...
Forum: KC868-A6
Last Post: admin
Yesterday, 10:06 PM
» Replies: 10
» Views: 148
F8 physical on device swi...
Forum: F8
Last Post: admin
Yesterday, 10:05 PM
» Replies: 3
» Views: 18
flash kc868-a4
Forum: KC868-A series and Uair Smart Controller
Last Post: Sten
Yesterday, 01:09 PM
» Replies: 14
» Views: 576

  [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: 328)
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: 306)

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: 317)
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: 339)

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: 251)

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

  24V Support
Posted by: yawniek - 04-18-2025, 05:06 PM - Forum: Suggestions and feedback on KinCony's products - Replies (2)

Hi, 

It would be good to be able to see more prominently which products support 24V input voltage and which products do not support it. 
Sometimes the board notes 12V but they work with 24V and sometimes not. 

Could you clarify which products support 24V and maybe put input voltage more clearly into descriptions?

Thank You
Y

Print this item