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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,503
» Latest member: sabrinahaven
» Forum threads: 2,287
» Forum posts: 11,894

Full Statistics

Online Users
There are currently 43 online users.
» 2 Member(s) | 27 Guest(s)
Bing, ChatGLM-Spider, Google, PetalBot, Semrush, Yandex, bot, csacomani, sabrinahaven

Latest Threads
PWM support?
Forum: KC868-A16
Last Post: admin
1 hour ago
» Replies: 5
» Views: 25
KC868 A32 Firmware 2.2.4 ...
Forum: KC868-A32/A32 Pro
Last Post: iozzi_giorgio
3 hours ago
» Replies: 2
» Views: 26
[arduino code examples fo...
Forum: KC868-A32/A32 Pro
Last Post: admin
8 hours ago
» Replies: 0
» Views: 3
USB ports
Forum: KinCony Server-Mini / Server-16 Raspberry Pi4 relay module
Last Post: BaconRanch
10 hours ago
» Replies: 2
» Views: 6
Lesson23- How to connect ...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Yesterday, 10:11 AM
» Replies: 10
» Views: 7,156
KC868-AG RF - sending rep...
Forum: KC868-A series and Uair Smart Controller
Last Post: PhilW
Yesterday, 07:46 AM
» Replies: 3
» Views: 9
Usar entradas y oled i2c ...
Forum: KC868-A6
Last Post: sistemasyusa
Yesterday, 03:16 AM
» Replies: 4
» Views: 17
a16 as basis for a securi...
Forum: KC868-A16
Last Post: admin
09-18-2024, 11:58 PM
» Replies: 8
» Views: 55
GSM CALL RELAY
Forum: KC868-A2
Last Post: admin
09-18-2024, 11:53 PM
» Replies: 9
» Views: 4,109
KC868-A16S or KC868-A8S
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
09-18-2024, 11:51 PM
» Replies: 3
» Views: 39

  [Arduino source code for KC868-A16S]-01 PCF8574-INPUT
Posted by: KinCony Support - 04-14-2023, 02:45 AM - Forum: KC868-A16S - No Replies

Code:
#include "Arduino.h"
#include "PCF8574.h"

// Set i2c address

PCF8574 pcf8574_1(0x24,4,5);
PCF8574 pcf8574_2(0x25,4,5);

PCF8574 pcf8574_IN1(0x22,4,5);
PCF8574 pcf8574_IN2(0x23,4,5);

void setup()
{
  Serial.begin(115200);
//  delay(1000);

  // Set pinMode to OUTPUT
  for(int i=0;i<=7;i++)
  {
    pcf8574_IN1.pinMode(i, INPUT);
  }
  for(int i=0;i<=7;i++)
  {
    pcf8574_IN2.pinMode(i, INPUT);
  }

  for(int i=0;i<=7;i++)
  {
    pcf8574_1.pinMode(i, OUTPUT);
  }

  for(int i=0;i<=7;i++)
  {
    pcf8574_2.pinMode(i,OUTPUT);
  }

    pcf8574_1.begin();
    pcf8574_2.begin();
    pcf8574_IN1.begin();
    pcf8574_IN2.begin();
  /*pcf8574_IN1.pinMode(P0, INPUT);
  pcf8574_IN1.pinMode(P1, INPUT);
  pcf8574_IN1.pinMode(P2, INPUT);
  pcf8574_IN1.pinMode(P3, INPUT);
  pcf8574_IN1.pinMode(P4, INPUT);
  pcf8574_IN1.pinMode(P5, INPUT);
  pcf8574_IN1.pinMode(P6, INPUT);
  pcf8574_IN1.pinMode(P7, INPUT);

  pcf8574_IN2.pinMode(P0, INPUT);
  pcf8574_IN2.pinMode(P1, INPUT);
  pcf8574_IN2.pinMode(P2, INPUT);
  pcf8574_IN2.pinMode(P3, INPUT);
  pcf8574_IN2.pinMode(P4, INPUT);
  pcf8574_IN2.pinMode(P5, INPUT);
  pcf8574_IN2.pinMode(P6, INPUT);
  pcf8574_IN2.pinMode(P7, INPUT);

pcf8574_IN1.begin();
pcf8574_IN2.begin();
  /*Serial.print("Init pcf8574_IN1...");
  if (pcf8574_IN1.begin()){
    Serial.println("pcf8574_IN1_OK");
  }else{
    Serial.println("pcf8574_IN1_KO");
  }

  Serial.print("Init pcf8574_IN2...");
  if (pcf8574_IN2.begin()){
    Serial.println("pcf8574_IN2_OK");
  }else{
    Serial.println("pcf8574_IN2_KO");
  }*/


}

void loop()
{
    for(int i=0;i<=7;i++)
    {
      if(pcf8574_IN1.digitalRead(i)==LOW)
      {
        Serial.printf("KEY  %d PRESSED\n",i+1);
        pcf8574_1.digitalWrite(i,LOW);
      }else pcf8574_1.digitalWrite(i,HIGH);
      delay(10);
    }


for(int i=0;i<=7;i++)
    {
      if(pcf8574_IN2.digitalRead(i)==LOW)
      {
        Serial.printf("KEY %d PRESSED\n",i+9);
        pcf8574_2.digitalWrite(i,LOW);
      }else pcf8574_2.digitalWrite(i,HIGH);
      delay(10);
    }
 
}
[Arduino source code for KC868-A16S]-01 PCF8574-INPUT



Attached Files
.zip   A16S__INPUT.zip (Size: 824 bytes / Downloads: 191)
Print this item

  KC868-A8M configure yaml for ESPhome
Posted by: admin - 04-14-2023, 02:10 AM - Forum: KC868-A8M - Replies (11)

esphome:
  name: a8m
  platform: ESP32
  board: esp32dev
 
 
remote_receiver:
  pin: 16
  dump:
    - rc_switch
  tolerance: 50%
  filter: 250us
  idle: 2ms
  buffer_size: 2kb



# Example configuration entry for ESP32
i2c:
  sda: 5
  scl: 4
  scan: true
  id: bus_a


# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.199
    gateway: 192.168.1.1
    subnet: 255.255.255.0 


# Example configuration entry
pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8
    address: 0x24

  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    address: 0x22

# Individual outputs
switch:
  - platform: gpio
    name: "light1"
    id: light1
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light2"
    id: light2
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light3"
    id: light3
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light4"
    id: light4
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "curtain1-up"
    id: relay5
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
     
     
     
  - platform: gpio
    name: "curtain1-down"
    id: relay6
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
     

  - platform: gpio
    name: "curtain2-up"
    id: relay7
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

     
  - platform: gpio
    name: "curtain2-down"
    id: relay8
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true

     
binary_sensor:
  - platform: gpio
    name: "input1"
    on_press:
      then:
        - switch.toggle: light1
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input2"
    on_press:
      then:
        - switch.toggle: light2
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input3"
    on_press:
      then:
        - switch.toggle: light3
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input4"
    on_press:
      then:
        - switch.toggle: light4
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input5"
    on_press:
      then:
        - switch.toggle: relay5
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input6"
    on_press:
      then:
        - switch.toggle: relay6
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input7"
    on_press:
      then:
        - switch.toggle: relay7
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input8"
    on_press:
      then:
        - switch.toggle: relay8
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: remote_receiver
    name: "remoter1"
    rc_switch_raw:
      code: '000101000101010100000011'
      protocol: 2
    on_press:
      then:
        - switch.toggle: light1
    filters:
      - delayed_off: 200ms

  - platform: remote_receiver
    name: "remoter2"
    rc_switch_raw:
      code: '000101000101010100001100'
      protocol: 2
    on_press:
      then:
        - switch.toggle: light2
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter3"
    rc_switch_raw:
      code: '001111010111001010110100'
      protocol: 2
    on_press:
      then:
        - switch.toggle: light3
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter4"
    rc_switch_raw:
      code: '001111010111001010111001'
      protocol: 2
    on_press:
      then:
        - switch.toggle: light4
    filters:
      - delayed_off: 200ms 
   
  - platform: remote_receiver
    name: "remoter5"
    rc_switch_raw:
      code: '001111010111001010110010'
      protocol: 2
    on_press:
      then:
        - switch.toggle: relay5
    filters:
      - delayed_off: 200ms

  - platform: remote_receiver
    name: "remoter6"
    rc_switch_raw:
      code: '001111010111001010110101'
      protocol: 2
    on_press:
      then:
        - switch.toggle: relay6
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter7"
    rc_switch_raw:
      code: '001111010111001010110001'
      protocol: 2
    on_press:
      then:
        - switch.toggle: relay7
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter8"
    rc_switch_raw:
      code: '001111010111001010110011'
      protocol: 2
    on_press:
      then:
        - switch.toggle: relay8
    filters:
      - delayed_off: 200ms
     

# Enable logging
logger:

# Enable Home Assistant API
api:


.txt   KC868-A8M-ha-config.txt (Size: 5.68 KB / Downloads: 250)

Print this item

  KC868-A8M ESP32 I/O pin define
Posted by: admin - 04-14-2023, 02:09 AM - Forum: KC868-A8M - No Replies

#define ANALOG_A1  34
#define ANALOG_A2  35
#define ANALOG_A3  36
#define ANALOG_A4  39

IIC SDA:5
IIC SCL:4

Relay_IIC_address 0x24

Input_IIC_address 0x22

DS18B20/DHT11/DHT21/LED strip -2: 14

RF433MHz wireless receiver: 16


Ethernet (LAN8720) I/O define:

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN  18
#define ETH_TYPE      ETH_PHY_LAN8720
#define ETH_CLK_MODE  ETH_CLOCK_GPIO17_OUT


GSM/RS485:
RXD:GPIO15
TXD:GPIO13

CAN bus:
TXD:GPIO32
RXD:GPIO33

Print this item

  KC868-A16S configure yaml for ESPhome
Posted by: admin - 04-14-2023, 02:08 AM - Forum: KC868-A16S - Replies (19)

   

esphome:
  name: kc868-a16s
  platform: ESP32
  board: esp32dev
 
 
# Example configuration entry for ESP32
i2c:
  sda: 4
  scl: 5
  scan: true
  id: bus_a


# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

  # Optional manual IP
#  manual_ip:
#    static_ip: 192.168.1.199
#    gateway: 192.168.1.1
#    subnet: 255.255.255.0 


# Example configuration entry
pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8
    address: 0x24

  - id: 'pcf8574_hub_out_2'  # for output channel 9-16
    address: 0x25

  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    address: 0x22

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
    address: 0x23

# Individual outputs
switch:
  - platform: gpio
    name: "a16s-output1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a16s-output2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a16s-output7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output9"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a16s-output10"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a16s-output11"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 2
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output12"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output13"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 4
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output14"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 5
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output15"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 6
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a16s-output16"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 7
      mode: OUTPUT
      inverted: true
     
binary_sensor:
  - platform: gpio
    name: "a16s-input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input2"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input3"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input6"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input7"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input8"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input9"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input10"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input11"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input12"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input13"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input14"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input15"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a16s-input16"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 7
      mode: INPUT
      inverted: true

# Enable logging
logger:

# Enable Home Assistant API
api:


.txt   Made_for_ESPHome_KC868-A16S.txt (Size: 5.63 KB / Downloads: 363)

Print this item

  KC868-A16S ESP32 I/O pin define
Posted by: admin - 04-14-2023, 02:07 AM - Forum: KC868-A16S - Replies (2)

ANALOG_A1  GPIO36
ANALOG_A2  GPIO34
ANALOG_A3  GPIO35
ANALOG_A4  GPIO39

IIC SDA:GPIO4
IIC SCL:GPIO5

1-wire GPIO: GPIO14

PCF8574:U27 (relay1-8): 100 100 = 0x24
PCF8574:U28 (relay9-16): 100 101 = 0x25

PCF8574:U23 (DI1-8): 100 010 = 0x22
PCF8574:U24 (DI9-16): 100 011 = 0x23

RF433MHz wireless receiver: GPIO16

Ethernet (LAN8720) I/O define:

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN  18
#define ETH_TYPE      ETH_PHY_LAN8720
#define ETH_CLK_MODE  ETH_CLOCK_GPIO17_OUT

--------------------
RS485:
RXD:GPIO32
TXD:GPIO33

GSM:
RXD:GPIO15
TXD:GPIO13

Print this item

  kc868-a2 SIM7600
Posted by: petez69 - 04-13-2023, 08:26 AM - Forum: KC868-A series and Uair Smart Controller - Replies (6)

Hi Kincony

I am using Homeassistant and ESPHome.  I am looking to use kc868-a2 and SIM7600SA(Australia) with ESPHOme.  I see there is a SIM800L library for 2G boards.  Do you know if SIM7600 will work with SIM800L ESPhome configuration ?

Thankyou..Peter

Print this item

  kc868-a6 A fatal error occurred: MD5 of file does not match data in flash!
Posted by: Siebje - 04-13-2023, 07:11 AM - Forum: KC868-A6 - Replies (3)

Hi,

currently, I'm working with the kc868-a6, for the last couple of weeks I've used the board with success! 

since the beginning of this week, problems started to reel in, when I was reading out analog inputs from my board. This is my code with the corresponding error code:

Code:
#include "Arduino.h"

#define ANALOG_A1 35

void setup() {

Serial.begin(9600);

pinMode(ANALOG_A1, INPUT);

}

void loop() {

Serial.println(analogRead(ANALOG_A1));

delay(500);

}
Code:
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 16384.2 kbit/s)...
File  md5: e6327541e2dc394ca2c3b3280ac0f39f
Flash md5: 9103c1184bb288ef16b7004acc339e7f
MD5 of 0xFF is 84d04c9d6cc8ef35bf825d51a5277699

A fatal error occurred: MD5 of file does not match data in flash!
Failed uploading: uploading error: exit status 2


I have tried many things to fix it but all without success. hopefully, there is someone who can help me with my problem

Thanks in advance!

Print this item

  KC868-A8 using RF 433mhz with ESPhome
Posted by: deanfourie - 04-12-2023, 08:58 PM - Forum: KC868-A8 - Replies (5)

Hi guys! I need some help and advise getting the RF 433mhz receiver working with my A8 and ESPhome.

Are there any blueprints available for this as Kinkony are not providing any information about this.

Regards

Print this item

  24v input voltage?
Posted by: tatu - 04-12-2023, 06:00 PM - Forum: KC868-A64 - Replies (9)

Hi!

Will this board support 24v input voltage? Item description page says 12V/24V, board marked only 12V? REV: 1.3

Thanks.

Print this item

  KC868-A32 Question
Posted by: miguelflpp - 04-12-2023, 09:47 AM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

Hi.
Can anyone help me with a code for ESPHome? I would like it for 1 digital input to turn off multiple relay outputs (lights) physically, without network.

Thanks.

Print this item