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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,355
» Latest member: jcyu5662
» Forum threads: 3,643
» Forum posts: 18,812

Full Statistics

Online Users
There are currently 14 online users.
» 0 Member(s) | 4 Guest(s)
AhrefsBot, Amazonbot, PetalBot, bot

Latest Threads
KC868-COLB Network Connec...
Forum: Development
Last Post: danielyoud401@gmail.com
1 hour ago
» Replies: 0
» Views: 12
"SmartLife" wifi transmit
Forum: TA
Last Post: hinterland
2 hours ago
» Replies: 2
» Views: 10
KC868-M16v2 configure yam...
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
Yesterday, 10:00 AM
» Replies: 129
» Views: 25,568
sample code to receive ht...
Forum: F16
Last Post: admin
Yesterday, 09:57 AM
» Replies: 12
» Views: 82
Goes Offline
Forum: KC868-E16S/E16P
Last Post: admin
Yesterday, 01:19 AM
» Replies: 5
» Views: 37
KC868-A16 - IP & PORT ?? ...
Forum: KC868-A16
Last Post: admin
01-01-2026, 02:46 AM
» Replies: 7
» Views: 716
Server 16 issues
Forum: KinCony Server-Mini / Server-16 Raspberry Pi4 relay module
Last Post: admin
01-01-2026, 02:44 AM
» Replies: 1
» Views: 18
N20 Problem with Home Ass...
Forum: N20
Last Post: admin
12-31-2025, 06:55 AM
» Replies: 6
» Views: 55
N30 Energy entry not work...
Forum: N30
Last Post: admin
12-31-2025, 06:50 AM
» Replies: 14
» Views: 188
Problems and general Feed...
Forum: N30
Last Post: admin
12-31-2025, 06:49 AM
» Replies: 2
» Views: 29

Lightbulb [Arduino IDE demo source code for KC868-A8S]--#05-KC868-A8S_LAN8720_UDP_code
Posted by: KinCony Support - 06-01-2022, 01:18 AM - Forum: KC868-A8S - No Replies

[Arduino IDE demo source code for KC868-A8S]--#05-KC868-A8S_LAN8720_UDP_code

Code:
/*KC868-A8S LAN8720_UDP communication code*/

#include <ETH.h>
#include <WiFiUdp.h>

#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

WiFiUDP Udp;                      //Create UDP object
unsigned int localUdpPort = 4196; //local port

/*Set the default IP address to 192.168.1.200  */
/*you can change the default IP address*/
IPAddress local_ip(192, 168, 1, 200);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 1, 1);

void setup()
{
  Serial.begin(115200);
  Serial.println();
   
  ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); //start with ETH

  // write confir for static IP, gateway,subnet,dns1,dns2
  if (ETH.config(local_ip, gateway, subnet, dns, dns) == false) {
    Serial.println("LAN8720 Configuration failed.");
  }else{Serial.println("LAN8720 Configuration success.");}
 
  Serial.println("Connected");
  Serial.print("IP Address:");
  Serial.println(ETH.localIP());

  Udp.begin(localUdpPort); //begin UDP listener
}

void loop()
{
  int packetSize = Udp.parsePacket(); //get package size
  if (packetSize)                     //if have received data
  {
    char buf[packetSize];
    Udp.read(buf, packetSize); //read current data

    Serial.println();
    Serial.print("Received: ");
    Serial.println(buf);
    Serial.print("From IP: ");
    Serial.println(Udp.remoteIP());
    Serial.print("From Port: ");
    Serial.println(Udp.remotePort());

    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); //ready to send data
    Udp.print("Received: ");   
    Udp.write((const uint8_t*)buf, packetSize); //copy data to sender buffer
    Udp.endPacket();            //send data
  }
}



Attached Files
.zip   LAN8720_UDP.zip (Size: 1.09 KB / Downloads: 581)
Print this item

Lightbulb [Arduino IDE demo source code for KC868-A8S]--#04-KC868-A8S_DS18B20_code
Posted by: KinCony Support - 06-01-2022, 01:17 AM - Forum: KC868-A8S - No Replies

[Arduino IDE demo source code for KC868-A8S]--#04-KC868-A8S_DS18B20_code

Code:
/*KC868-A8S DS18B20 Temperature sensor code*/

#include <DS18B20.h>
DS18B20 ds1(14);  //channel-1-DS18b20  IO14


void setup()
{
  Serial.begin(115200);
}

void loop()
{
  Serial.print("Temperature1:");
  Serial.print(ds1.getTempC());
  Serial.print(" C /");
  delay(500);   
}



Attached Files
.zip   ds18b20.zip (Size: 498 bytes / Downloads: 604)
Print this item

Lightbulb [Arduino IDE demo source code for KC868-A8S]--#03-KC868-A8S_BEEP_code
Posted by: KinCony Support - 06-01-2022, 01:14 AM - Forum: KC868-A8S - No Replies

[Arduino IDE demo source code for KC868-A8S]--#03-KC868-A8S_BEEP_code

Code:
/*KC868-A8S Beep code*/

const int BEEP_Pin = 2; 

void setup() {

  // initialize the BEEP_Pin as an output:
   pinMode(BEEP_Pin, OUTPUT);
}

void loop() {
   
    digitalWrite(BEEP_Pin, LOW);
    delay(2000);
    digitalWrite(BEEP_Pin, HIGH);
    delay(2000);
}



Attached Files
.zip   Beep.zip (Size: 632 bytes / Downloads: 583)
Print this item

Lightbulb [Arduino IDE demo source code for KC868-A8S]--#02-KC868-A8S_ADC_INOUT_code
Posted by: KinCony Support - 06-01-2022, 01:12 AM - Forum: KC868-A8S - No Replies

[Arduino IDE demo source code for KC868-A8S]--#02-KC868-A8S_ADC_INOUT_code

Code:
/*KC868-A8S Analog input code*/
/*When the analog input interface has some Voltage ,it will print to the Serial port */
/*A1 A2   Input---0-5V*/
/*A3 A4   Input---0-20MA*/
#include "Arduino.h"

#define ANALOG_A1   36        // IO36 
#define ANALOG_A2   39        // IO39   
#define ANALOG_A3   34        // IO34  
#define ANALOG_A4   35        // IO35  
void setup()
{
    Serial.begin(115200);
    delay(1000);

  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  if(analogRead(ANALOG_A1)!=0)
    {  Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));delay(500);}
  if(analogRead(ANALOG_A2)!=0)
    {  Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));delay(500);}
  if(analogRead(ANALOG_A3)!=0)
    {  Serial.printf("Current Reading A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));delay(500);}
  if(analogRead(ANALOG_A4)!=0)
    {  Serial.printf("Current Reading A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));delay(500);}

}



Attached Files
.zip   ADC_INOUT.zip (Size: 710 bytes / Downloads: 577)
Print this item

Lightbulb [Arduino IDE demo source code for KC868-A8S]--#01-KC868-A8S_433_receive_code
Posted by: KinCony Support - 06-01-2022, 01:11 AM - Forum: KC868-A8S - No Replies

[Arduino IDE demo source code for KC868-A8S]--#01-KC868-A8S_433_receive_code

Code:
/* RF-receive code for KC868-A8S*/
/*If receive the RF single,the LED will be turn the color to "0xff00ff"*/
/*install library RCSwitch and Adafruit_NeoPixel*/

#include <RCSwitch.h>  //Install library "rcswitch"
#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel rgb_display = Adafruit_NeoPixel(130,12,NEO_GRB + NEO_KHZ800);
//The WS2812 rgb LED is connect to IO12    RGB_LED number is 1
RCSwitch mySwitch = RCSwitch();
void setup() {
  Serial.begin(9600);
  rgb_display.begin();
  mySwitch.enableReceive(digitalPinToInterrupt(16));  //receive PIN IO16
}

void loop() {

if (mySwitch.available()) {
    Serial.print("Received ");
    Serial.println( mySwitch.getReceivedValue() );
    rgb_display.setPixelColor((1)-1,(0xff00ff));
    rgb_display.setBrightness(100);
    rgb_display.show();
  }
    mySwitch.resetAvailable();   
}
   



Attached Files
.zip   433-decode.zip (Size: 777 bytes / Downloads: 601)
Print this item

  KC868-A8 and PCF8574 Interrupt pin
Posted by: andhol - 05-31-2022, 07:53 PM - Forum: KC868-A8 - Replies (14)

Hi!
I am planning to use all 8 digital inputs of the KC868-A8, and it would be nice to be able to use the interrupt pin of the PCF8574 to detect changes. I'm just not sure if the pin is connected or not. When looking at the schematic, it looks like it is connected to GPIO16, but there is also a red X symbol next to it that might suggest otherwise.. Any hints? 

/A

Print this item

  KC868-A8S hotel room demo configure for ESPhome
Posted by: admin - 05-31-2022, 12:45 AM - Forum: KC868-A8S - Replies (16)

esphome:
  name: a8s
  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: 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_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
    interlock: [relay6]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
     
     
     
  - platform: gpio
    name: "curtain1-down"
    id: relay6
    interlock: [relay5]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
     

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

     
  - platform: gpio
    name: "curtain2-down"
    id: relay8
    interlock: [relay7]
    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: '001111010111001010111000'
      protocol: 1
    on_press:
      then:
        - switch.toggle: light1
    filters:
      - delayed_off: 200ms

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

  - platform: remote_receiver
    name: "remoter6"
    rc_switch_raw:
      code: '001111010111001010110101'
      protocol: 1
    on_press:
      then:
        - switch.toggle: relay6
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter7"
    rc_switch_raw:
      code: '001111010111001010110001'
      protocol: 1
    on_press:
      then:
        - switch.toggle: relay7
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter8"
    rc_switch_raw:
      code: '001111010111001010110011'
      protocol: 1
    on_press:
      then:
        - switch.toggle: relay8
    filters:
      - delayed_off: 200ms
     
  - platform: gpio
    name: "PIR1"
    pin: 14
    device_class: motion
    on_release:
      - script.execute: motion_timer

script:
  - id: motion_timer
    mode: restart
    then:
      - delay: 10s
      - switch.turn_off: light1
      - switch.turn_off: light2
      - switch.turn_off: light3
      - switch.turn_off: light4


# Enable logging
logger:

# Enable Home Assistant API
api:



Attached Files
.txt   KC868-A8S-ha-config.txt (Size: 6.11 KB / Downloads: 843)
Print this item

  KC868-A8S ESP32 I/O pin define
Posted by: admin - 05-31-2022, 12:43 AM - Forum: KC868-A8S - Replies (5)

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

IIC SDA:4
IIC SCL:5

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


RS485:
RXD:GPIO32
TXD:GPIO33

GSM:
RXD:GPIO13
TXD:GPIO15

Buzzer:GPIO2

WS2812B RGBW LED:GPIO12

Print this item

  KC868 A4 - Help In Program
Posted by: mfjunior96 - 05-29-2022, 09:52 PM - Forum: KC868-A4 - Replies (3)

Good night sir,

I'm having a problem and I wanted some help, I have a KC868 A4, I'm using the 4 outputs and 3 digital inputs, but now I want a device (led drivers) connected to alexa to change its state, when I change the state of the digital input , I created a new device "F6" but I can't make "When F6 on > Led Driver ON" the alexa app doesn't let me put a lamp with imput, what can I do? Is there another app that I can do this interaction?


Thanks in Advance

Print this item

  COLB RS485 BAUD RATE
Posted by: Dm81 - 05-27-2022, 01:40 PM - Forum: KC868-HxB series Smart Controller - Replies (15)

Hello
please, which is the baud rate of RS485 on COLB?
Is it possible to choose it?
thank you
Diego

Print this item