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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,361
» Latest member: tiffinsdelhi
» Forum threads: 4,127
» Forum posts: 20,652

Full Statistics

Online Users
There are currently 32 online users.
» 0 Member(s) | 18 Guest(s)
Amazonbot, Baidu, Bing, Bytespider, PetalBot, Scrapy, bot

Latest Threads
Loxone RS485
Forum: KinCony integrate with Loxone home automation
Last Post: admin
Yesterday, 12:16 PM
» Replies: 16
» Views: 3,221
KinCony MT4 – 4CH ESP32 D...
Forum: News
Last Post: admin
Yesterday, 03:01 AM
» Replies: 0
» Views: 16
[arduino code examples fo...
Forum: MT4
Last Post: admin
Yesterday, 02:21 AM
» Replies: 0
» Views: 4
[arduino code examples fo...
Forum: MT4
Last Post: admin
Yesterday, 02:19 AM
» Replies: 0
» Views: 5
[arduino code examples fo...
Forum: MT4
Last Post: admin
Yesterday, 02:18 AM
» Replies: 0
» Views: 5
[arduino code examples fo...
Forum: MT4
Last Post: admin
Yesterday, 02:16 AM
» Replies: 0
» Views: 5
[arduino code examples fo...
Forum: MT4
Last Post: admin
Yesterday, 02:15 AM
» Replies: 0
» Views: 6
[arduino code examples fo...
Forum: MT4
Last Post: admin
Yesterday, 02:13 AM
» Replies: 0
» Views: 3
MT4 ESPHome yaml for home...
Forum: MT4
Last Post: admin
Yesterday, 02:10 AM
» Replies: 0
» Views: 9
MT4 ESP32-S3 IO pins defi...
Forum: MT4
Last Post: admin
Yesterday, 02:09 AM
» Replies: 0
» Views: 8

Sad AM2120 Temperature Sensor
Posted by: mrteaiot - 06-24-2023, 06:02 AM - Forum: KC868-A8 - Replies (3)

I bought this AM2120 Temperature and Humidity Sensor and I am not able to get it to read input sensor on my ESPHOME.  I have bought AM2301 and it works fine with the same ESPHOME code as below:

  - platform: dht
    pin: 33    
    model: AM2302   ## New Sensor AM2120  NOT WORKING - NA reading
    temperature:
      name: "S4-Temp"
      accuracy_decimals: 1
    humidity:
      name: "S4-Humidity"
      accuracy_decimals: 1
    update_interval: 30s


Do I use the wrong code for my board?   

Thanks..

Print this item

  GSM CALL RELAY
Posted by: Anthonio - 06-24-2023, 12:29 AM - Forum: KC868-A2 - Replies (9)

Hello,

I am having difficulty for coding my script, I would like to make a GSM relay which activates the GPIO 15 relay upon the module receipt a call ! but I cannot do it can you help me?

I think my problem is from the command of call detection.

Thanks


Code:
#include <SoftwareSerial.h>

// Create software serial object to communicate with A6
SoftwareSerial mySerial(13, 34); // A6 Tx & Rx is connected to Arduino #3 & #2

int relayPin = 15; // GPIO 15 connected to the relay

void setup()
{
  // Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(115200);
 
  // Begin serial communication with Arduino and A6
  mySerial.begin(115200);

  Serial.println("Initializing...");

  pinMode(relayPin, OUTPUT); // Set the relay pin as an output
  digitalWrite(relayPin, LOW); // Initialize the relay as OFF
}

void loop()
{
  updateSerial();
  checkCall();
}

void updateSerial()
{
  delay(500);
  while (Serial.available())
  {
    mySerial.write(Serial.read()); // Forward what Serial received to Software Serial Port
  }
  while(mySerial.available())
  {
    Serial.write(mySerial.read()); // Forward what Software Serial received to Serial Port
  }
}

void checkCall()
{
  if (mySerial.available())
  {
    String response = mySerial.readString();
    if (response.indexOf("+CLCC: 1,1,2,4,0") != -1) // Check if "+CLCC: 1,1,2,4,0" is present in the response
    {
      activateRelay();
    }
  }
}

void activateRelay()
{
  digitalWrite(relayPin, HIGH); // Turn ON the relay
  delay(5000); // Keep the relay ON for 5 seconds
  digitalWrite(relayPin, LOW); // Turn OFF the relay
}

Print this item

  Which GND to use for sensors ?
Posted by: primeroz - 06-23-2023, 01:58 PM - Forum: KC868-A2 - Replies (1)

Hi, the only GND i see on the A2 is the one also used for POWER IN


I want to connect a PIR , i can take the `3v3` from the board but i am not sure which GND to use . Should i use the same as the `INPUT power` ?


example diagram of what i want to do



Attached Files Thumbnail(s)
   
Print this item

  Trouble controlling the H100 Inverter using RS485 Protocol
Posted by: shaolink - 06-22-2023, 06:48 PM - Forum: DIY Project - Replies (9)

I was following this video 

how to control VFD (Variable Frequency Drive) inverter by KC868-COLB - YouTube

And wrote this code to control my H100 Inverter ( How to: H100 VFD & 1.5KW Air-Cooled Spindle Setup - Zhong Hua Jiang - How To - Carbide 3D Community Site)

import serial

def calculate_crc(data):
    reg_crc = 0xFFFF
    for byte in data:
        reg_crc ^= byte
        for _ in range(8):
            if reg_crc & 0x0001:
                reg_crc = (reg_crc >> 1) ^ 0xA001
            else:
                reg_crc >>= 1
    return reg_crc

# RS485 port settings
rs485_port = 'COM12'
rs485_baud_rate = 115200
rs485_parity = serial.PARITY_NONE
rs485_stop_bits = serial.STOPBITS_ONE
rs485_data_bits = serial.EIGHTBITS

try:
    # Open the RS485 serial port
    ser = serial.Serial(
        port=rs485_port,
        baudrate=rs485_baud_rate,
        parity=rs485_parity,
        stopbits=rs485_stop_bits,
        bytesize=rs485_data_bits,
        timeout=1
    )

    # Send a command via RS485 in RTU mode
    command = [0x64, 0x01, 0x02, 0x20, 0x00, 0x00, 0x01, 0x43, 0xCA]  # Modify the command in hexadecimal format
    crc = calculate_crc(command)
    command.append(crc & 0xFF)  # Low byte
    command.append((crc >> 8) & 0xFF)  # High byte
    ser.write(bytes(command))

    # Read the RS485 response
    response_rs485 = ser.readline()
    hex_response_rs485 = ' '.join(hex(byte) for byte in response_rs485)
    print("RS485 Response:", hex_response_rs485)

    # Close the RS485 serial port
    ser.close()

except serial.SerialException as e:
    print("Error opening or accessing the serial port:", str(e))

This is the code I wrote. The checksum passes, and everything else is fine. But when I run the code, it doesn't reflect any changes on the Inverter/ Motor. Please help.

The connections on the RS485 can be found in the images attached below.

Please help! Thanks in advance.



Attached Files Thumbnail(s)
       
Print this item

  Request a free sample
Posted by: marekduzi - 06-22-2023, 05:41 AM - Forum: Apply for free sample product - No Replies

Dobrý den,
chtěl bych získat zkušební bezplatný vzorek ovladače KC868-A4. Pracuji jako elektrikář v automobilovém průmyslu nákladních automobilů, kde jsme také prodejci značek TATRA Trucks CZECH a dále speciální nástavby na přání, kde jsme museli požádat o jinou firmu o vývoj hardwaru a pro daný typ zákazníka. Díky Vašemu ovladači bychom tyto věci zvládli sami a určitě bychom dokázali další udělat na nákup více kusů a vašich zařízení. Velmi bych ocenil vzorek zdarma.Heart

Print this item

  KC868-1U ESP32 DIY PCB Board released
Posted by: admin - 06-22-2023, 01:00 AM - Forum: News - No Replies

KC868-1U is a esp32 diy pcb board. it can install to 1U size box, let your relay controller become smart. if you have a power sequencer, KC868-1U will easy connect it, so that smart control your rack power strip. You can DIY one smart power sequencer. It will support arduino IDE, home assistant by ESPHome, also support Tasmota open source home automation platform.
[Image: KC868-1U-1_01.jpg]
[Image: KC868-1U-1_02.jpg]
[Image: KC868-1U-1_03.jpg]

Print this item

  KinCony KC868-AP Modbus using in Esphome not working
Posted by: nikhuge - 06-21-2023, 09:59 PM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

i am trying to configure a Light/humidity/temperature modbus sensor with kincony Ap modbus port in esphome. below is my configuration and sensor data sheet is attached,I am getting this error in the esphome logs



"No response recieved removed from send queue"


Can point what I am doing wrong.


Code:
esphome:
  name: kincony-esp32-dimmer
  friendly_name: Kincony-Esp32-Dimmer

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "7p6IWmIbZjSt7YFWX2bKaCBB1bTmhraTZo+P4cV7BoE="

ota:
  password: "2aa38947ee1ec3376d4e0b941ce919da"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kincony-Esp32-Dimmer"
    password: "uIm62IkfOTJ0"

captive_portal:

web_server:
  port: 80

#Modbus Configuration for Sensors
uart:
  id: mbus
  tx_pin: GPIO33
  rx_pin: GPIO14
  baud_rate: 9600

modbus:
  id: modbus1
  uart_id: mbus
  send_wait_time: 200ms

modbus_controller:
- id: light_sensor1
  address: 1
  modbus_id: modbus1
  update_interval: 1s


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

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

pcf8574:
  - id: 'pcf8574_hub_in_1'  # for input channel 1-8    maybe 0x22  /  0x3A
    address: 0x3A

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




sensor:

  - platform: modbus_controller
    modbus_controller_id: light_sensor1
    id: light_intensity
    name: "Light Intensity"
    address: 0x02
    unit_of_measurement: "Lux" ## for any other unit the value is returned in minutes
    register_type: read
    value_type: U_WORD
    accuracy_decimals: 1


  - platform: modbus_controller
    modbus_controller_id: light_sensor1
    id: temp
    name: "Temperature"
    address: 0x01
    unit_of_measurement: "C" ## for any other unit the value is returned in minutes
    register_type: read
    value_type: U_WORD
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: light_sensor1
    id: humidity
    name: "Humidity"
    address: 0x00
    unit_of_measurement: "%" ## for any other unit the value is returned in minutes
    register_type: read
    value_type: U_WORD
    accuracy_decimals: 1

binary_sensor:
  - platform: gpio
    name: "ap-input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  - platform: gpio
    name: "ap-input17"
    pin:
      number: 34
      inverted: true

  - platform: gpio
    name: "ap-input18"
    pin:
      number: 35
      inverted: true

pca9685:
    id: 'pca9685_hub'
    frequency: 500

output:
  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM0"
    channel: 0

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM1"
    channel: 1

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM2"
    channel: 2

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM3"
    channel: 3

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM4"
    channel: 4

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM5"
    channel: 5

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM6"
    channel: 6

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM7"
    channel: 7

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM8"
    channel: 8

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM9"
    channel: 9

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM10"
    channel: 10

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM11"
    channel: 11

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM12"
    channel: 12

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM13"
    channel: 13

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM14"
    channel: 14

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM15"
    channel: 15

light:
  - platform: monochromatic
    name: "Color-LED-1"
    output: PWM0
  - platform: monochromatic
    name: "Color-LED-2"
    output: PWM1
  - platform: monochromatic
    name: "Color-LED-3"
    output: PWM2
  - platform: monochromatic
    name: "Color-LED-4"
    output: PWM3
  - platform: monochromatic
    name: "Color-LED-5"
    output: PWM4
  - platform: monochromatic
    name: "Color-LED-6"
    output: PWM5
  - platform: monochromatic
    name: "Color-LED-7"
    output: PWM6
  - platform: monochromatic
    name: "Color-LED-8"
    output: PWM7
  - platform: monochromatic
    name: "Color-LED-9"
    output: PWM8
  - platform: monochromatic
    name: "Color-LED-10"
    output: PWM9
  - platform: monochromatic
    name: "Color-LED-11"
    output: PWM10
  - platform: monochromatic
    name: "Color-LED-12"
    output: PWM11
  - platform: monochromatic
    name: "Color-LED-13"
    output: PWM12
  - platform: monochromatic
    name: "Color-LED-14"
    output: PWM13
  - platform: monochromatic
    name: "Color-LED-15"
    output: PWM14
  - platform: monochromatic
    name: "Color-LED-16"
    output: PWM15

  - platform: rgbw
    name: "ap-rgbw"
    red: PWM1
    green: PWM2
    blue: PWM3
    white: PWM4

switch:
  - platform: gpio
    name: "ap-light1"
    pin: 13
    inverted: false

  - platform: gpio
    name: "ap-light2"
    pin: 2
    inverted: false
   



Attached Files
.pdf   CWT-SL Light sensor (RS485 type) Manual.pdf (Size: 458.11 KB / Downloads: 2766)
Print this item

  [Arduino source code for KC868-1U]-07_RS485
Posted by: KinCony Support - 06-21-2023, 05:22 AM - Forum: KC868-1U - No Replies

[Arduino source code for KC868-1U]-07_RS485

Code:
/*KC868-1U  RS485 CODE*/
#define RS485RX  32
#define RS485TX  33
void setup() {
  Serial.begin(115200);
  Serial2.begin(115200,SERIAL_8N1,A2_RS485RX,A2_RS485TX);

   Serial2.println("RS485 SEND is OK!!");
   Serial2.println("******************");
 
}

void loop() {
  /*print the received data of RS485 port*/
  while(Serial2.available()>0)
   {
    Serial2.print((char)Serial2.read());//Read rs485 receive data  and print it
   }
  delay(200);
}

Print this item

  [Arduino source code for KC868-1U]-06_OUTPUT
Posted by: KinCony Support - 06-21-2023, 05:22 AM - Forum: KC868-1U - No Replies

[Arduino source code for KC868-1U]-06_OUTPUT

Code:
/*KC868-1U PCF8574 digital output code*/
#include "Arduino.h"
#include "PCF8574.h"

// Set i2c address
PCF8574 pcf8574_OUT1(0x24,4,16);


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

    // Set pinMode to OUTPUT
    pcf8574_OUT1.pinMode(P0, OUTPUT);
  pcf8574_OUT1.pinMode(P1, OUTPUT);
  pcf8574_OUT1.pinMode(P2, OUTPUT);
  pcf8574_OUT1.pinMode(P3, OUTPUT);
  pcf8574_OUT1.pinMode(P4, OUTPUT);
  pcf8574_OUT1.pinMode(P5, OUTPUT);
  pcf8574_OUT1.pinMode(P6, OUTPUT);
  pcf8574_OUT1.pinMode(P7, OUTPUT);
 
   pcf8574_OUT1.begin();
 
    


}

void loop()
{
  for(int i=0;i<=7;i++){
    pcf8574_OUT1.digitalWrite(i, LOW);
    delay(1000);
  }
  for(int i=0;i<=7;i++){
    pcf8574_OUT1.digitalWrite(i, HIGH);
    delay(1000);
  }
 
}

Print this item

  [Arduino source code for KC868-1U]-05_LAN8720_UDP
Posted by: KinCony Support - 06-21-2023, 05:21 AM - Forum: KC868-1U - No Replies

[Arduino source code for KC868-1U]-05_LAN8720_UDP

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 it based on the IP address of the router
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.");}
 
/* while(!((uint32_t)ETH.localIP())) //wait for IP
  {

  }*/
  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
  }
}

Print this item