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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,099
» Latest member: nirupamobesityclinic
» Forum threads: 4,006
» Forum posts: 20,317

Full Statistics

Online Users
There are currently 37 online users.
» 0 Member(s) | 17 Guest(s)
AhrefsBot, Amazonbot, Baidu, Bytespider, PetalBot, Semrush, bot

Latest Threads
Weak wifi signal/range
Forum: KC868-A16v3
Last Post: admin
9 hours ago
» Replies: 1
» Views: 12
KC868-A16v3 PCB layout CA...
Forum: Schematic & diagram & Dimensions of KinCony PCB layout CAD file
Last Post: admin
Yesterday, 12:59 PM
» Replies: 0
» Views: 14
[arduino code examples fo...
Forum: F24
Last Post: admin
05-26-2026, 10:55 PM
» Replies: 2
» Views: 875
Cant flash esphom
Forum: B16M
Last Post: lulu01
05-26-2026, 04:58 PM
» Replies: 23
» Views: 836
Request for firmware H32
Forum: KC868-HxB series Smart Controller
Last Post: admin
05-26-2026, 11:22 AM
» Replies: 1
» Views: 23
how to use KC868-A8 with ...
Forum: KC868-A8
Last Post: admin
05-26-2026, 11:20 AM
» Replies: 0
» Views: 23
MODBUS
Forum: KC868-A2v3
Last Post: admin
05-26-2026, 10:05 AM
» Replies: 5
» Views: 58
problem with kc868 has v2
Forum: News
Last Post: admin
05-26-2026, 08:08 AM
» Replies: 13
» Views: 211
KC868-HA v2 firmware V200...
Forum: KC868-HA /HA v2
Last Post: admin
05-26-2026, 12:37 AM
» Replies: 8
» Views: 1,977
KC868-HA RS485 INPUT & OU...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
05-26-2026, 12:36 AM
» Replies: 55
» Views: 27,793

  PLC Modbus communication
Posted by: huntleight - 10-04-2024, 10:08 PM - Forum: KC868-A6 - Replies (7)

How can i communicate with plc (Plc as a master)? How plc can change my parameter ? For example plc wants to change or read my maxhumidity parameter, how can plc know maxhumidity modbus adress(for example 4x2002) ? Can you explain all phase communication, i dont know maybe assign modbus address, if plc change my parameter how can i catch and change parameter, ..? I hope it was understandable.

Print this item

  ESPHome Modbus config for KC868-A6
Posted by: aucirc - 10-04-2024, 06:06 PM - Forum: KC868-A6 - Replies (4)

Is this the correct ESPHome configuration for RS-485 Modbus on KC-868 A6?

Code:
uart:
  id: mbus
  tx_pin: GPIO12
  rx_pin: GPIO13
  baud_rate: 9600

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

modbus_controller:
- id: wp3082adam1
  address: 1
  modbus_id: modbus1
  update_interval: 5s

I'm trying to use this with WellPro WP3082ADAM:

Code:
text_sensor:
- name: "analoginputs"
  platform: modbus_controller
  modbus_controller_id: wp3082adam1
  id: test
  # internal: true
  register_type: holding
  address: 0x0000
  register_count: 8
  raw_encode: HEXBYTES
  response_size: 10

This is sending correct command to the wp3082adam, but ESPHome it never receives a response:
Code:
Modbus command to device=1 register=0x00 no response received - removed from send queue

The frustrating this is I can see the holding register request from the A6 and the response from the WP3082ADAM when monitoring the wire, everything seems to be working perfectly, but A6 can't "hear" the modbus response.

sent from A6:
{01}{03}{00}{00}{00}{08}{44}{0C}
response from wp3082adam:
{01}{03}{10}{00}{00}{00}{00}{00}{00}{00}{00}{03}{34}{00}{00}{00}{00}{00}{00}{D1}{8F}

I would appreciate any suggestions

Print this item

  Digital inputs not reacting on +24VDC
Posted by: xxpeta - 10-04-2024, 06:32 AM - Forum: KC868-AI - Replies (7)

Hi all,
my KC868-AI is not reacting (change from logical 0 to logical 1) on sending +24VDC to any of digital inputs.
Firmware version: 2.2.4
Thanks for your reaction.

   

Print this item

  Kcs output off after x seconds
Posted by: stanchiam - 10-03-2024, 12:14 AM - Forum: "KCS" v2 firmware system - Replies (1)

Hi, 

How can we let kcs automatically off the output, example output 1, 10 seconds after it is triggered on through api (http://192.168.1.99/ctrl.cgi?secret=&set...=1&value=1)

Print this item

  M30 - Jumpers for CT inputs (voltage/mA)
Posted by: raphaelcno - 10-02-2024, 03:52 PM - Forum: KC868-M16 / M1 / MB / M30 - Replies (6)

Hello Smile

I'm reading the description of the M30 board (https://www.kincony.com/esp32-energy-monitor-board.html). 
I see that it's possible to use CT clamps with voltage or mA signal. 
Can you tell me if the CT inputs on the M30 board are equipped with jumpers in order to choose between voltage and mA signal? 

Thank you in advance for your help Smile
Raphaël

Print this item

  NodeRed MQTT and Single output State
Posted by: charlesrg - 10-02-2024, 01:59 PM - Forum: "KCS" v2 firmware system - Replies (1)

I've a few KC868_A32M  and A16

I'm trying to subscribe to the state of a single output instead of the whole board.

On NodeREd I wanted to subscribe to a topiic like:    

KC868_A32M/E05A1B5BE4C8/STATE/output1


So only changes to output1 would trigger an action. Is it possible or is this something for a future firmware update ?

Print this item

  KinCony B16M ESP32-S3 Smart Controller released
Posted by: admin - 10-01-2024, 06:56 AM - Forum: News - No Replies

KinCony B16M ESP32 smart controller based on ESP32-S3-WROOM-1U (N16R8) wifi chip. Support 16 channel MOSFET output, 4 channel 1-wire GPIOs, 3 free GPIOs, 4 channel ADS1115 16bit analog input ports. One SD card using SPI bus. B16M include DS3231 high precision RTC clock chip. LCD display will show wifi and ethernet IP address and Tuya connection state. B16M have I2C bus extender and RS485 port. You can write any code by Arduino IDE / MicroPython / ESP-IDF development tool to ESP32 module. We will supply Arduino / ESP-IDF demo code for different samples. Everyone can modify and change the code for your own smart home automation system project. it support use by ESPHome for home assistant or tasmota firmware for smart home automation DIY.
[Image: ESP32-B16M-2.jpg]
Model No. KinCony B16M
Description: KinCony 16 Channel ESP32-S3 Smart Controller – B16M
Power supply: 12-24V DC
Processor: ESP32-S3-WROOM-1U (N16R8)
Size: 160mm*83mm*56mm
interfaces: Ethernet(RJ45)-LAN 100Mbps IPv4/IPv6,WiFi,RS485,Bluetooth,USB-C,LCD,I2C,Tuya Module
RTC: DS3231 high precision chip (battery socket on PCB)
SD Card: SPI bus
Installation method: DIN RAIL
LCD: SSD1306 I2C display
Outputs:
16CH MOSFET Outputs, every channel use MAX 10A driver IC
Inputs:
ADS1115 16bit ADC: 2CH analog input DC0-5V (A1,A2) 2CH analog input 4-20mA (A3,A4)
16CH dry contact inputs (optocoupler isolation, long distance circuit for MAX 500 meters cable)
3 buttons: 1:ESP32 Reset 2:ESP32 Download 3:Tuya config
1-Wire GPIO: 4CH (with pull-up resistance on PCB)
free GPIO: 3CH (without pull-up resistance on PCB, connect with ESP32 pin directly)
[Image: ESP32-B16M-1.jpg]
software solution:
1. download firmware by ESPHome, integrate to home assistant or use by web service.
2. download tasmota firmware.
3. write your own arudino code for your own requirements.
4. It is recommended to use home assistant and Tuya mobile phone app at the same time. So that remote control by internet using Tuya app, local control by LAN using home assistant app.
Related technical information
———————————
ESP32 I/O pin define: https://www.kincony.com/forum/showthread.php?tid=6781
config yaml file for ESPHome: https://www.kincony.com/forum/showthread.php?tid=6782
arduino demo source code: https://www.kincony.com/forum/forumdisplay.php?fid=61
Different views of the B16M:
[Image: B16M-view.jpg]
[Image: B16M-size.jpg]
Here are the hardware design details:
[Image: ESP32-B16M-2.jpg]
[Image: ESP32-B16M-3.jpg]
[Image: ESP32-B16M-4.jpg]
[Image: ESP32-B16M-5.jpg]
[Image: ESP32-B16M-6.jpg]
B16M support install on DIN RAIL
[Image: ESP32-B16M-7.jpg]
As a standard size, it looks like it is installed in a distribution box.
[Image: ESP32-B16M-8.jpg]
[Image: ESP32-B16M-9.jpg]

Print this item

  [arduino code examples for F16]-10 Print TEXT on SSD1306 OLED displayer
Posted by: admin - 10-01-2024, 04:55 AM - Forum: F16 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This Arduino program demonstrates how to display text on an SSD1306 128x64 OLED display using the U8g2 library.
* The program draws two lines of text on the display:
* - The first line is "KINCONY" in a larger font.
* - The second line is "www.kincony.com" in a smaller font.
*
* The display is connected via I2C (software implementation) with:
* - SCL (clock) on pin IO18
* - SDA (data) on pin IO8
*
* The display's I2C address is set to 0x3C.
*/

#include <U8g2lib.h>  // Include the U8g2 library for controlling the OLED display
#include <Wire.h>     // Include the Wire library for I2C communication

// Initialize the display using the software I2C method (SCL = IO18, SDA = IO8)
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  18, 8, U8X8_PIN_NONE);  // Screen rotation: U8G2_R0

// Function to display page 1 content
void page1() {
  // Set font size 18 for the larger "KINCONY" text
  u8g2.setFont(u8g2_font_timR18_tf);  // Use the Times Roman font, size 18
  u8g2.setFontPosTop();               // Set the text position at the top of the display
  u8g2.setCursor(5, 0);               // Position the cursor at coordinates (5, 0)
  u8g2.print("KINCONY");              // Display the text "KINCONY" on the screen

  // Set font size 12 for the smaller "www.kincony.com" text
  u8g2.setFont(u8g2_font_timR12_tf);  // Use the Times Roman font, size 12
  u8g2.setCursor(0, 40);              // Position the cursor at coordinates (0, 40)
  u8g2.print("www.kincony.com");      // Display the text "www.kincony.com"
}

// Setup function, runs once when the program starts
void setup() {
  // Set the I2C address for the display to 0x3C
  u8g2.setI2CAddress(0x3C*2);  // I2C address shift for 8-bit format
 
  // Initialize the display
  u8g2.begin();
 
  // Enable UTF-8 character printing for the display
  u8g2.enableUTF8Print();  // Allow UTF-8 encoded text to be printed
}

// Main loop function, continuously runs after setup()
void loop() {
  // Begin the display drawing process
  u8g2.firstPage();  // Prepare the first page for drawing
  do {
    // Call the page1() function to draw content on the display
    page1();
  } while (u8g2.nextPage());  // Continue to the next page until all pages are drawn
}
arduino ino file download: 
.zip   10-oled-ssd1306.zip (Size: 1.11 KB / Downloads: 580)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   10-oled-ssd1306.ino.merged.zip (Size: 198.96 KB / Downloads: 598)

Print this item

  [arduino code examples for F4]-10 Print TEXT on SSD1306 OLED displayer
Posted by: admin - 10-01-2024, 04:55 AM - Forum: F4 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This Arduino program demonstrates how to display text on an SSD1306 128x64 OLED display using the U8g2 library.
* The program draws two lines of text on the display:
* - The first line is "KINCONY" in a larger font.
* - The second line is "www.kincony.com" in a smaller font.
*
* The display is connected via I2C (software implementation) with:
* - SCL (clock) on pin IO18
* - SDA (data) on pin IO8
*
* The display's I2C address is set to 0x3C.
*/

#include <U8g2lib.h>  // Include the U8g2 library for controlling the OLED display
#include <Wire.h>     // Include the Wire library for I2C communication

// Initialize the display using the software I2C method (SCL = IO18, SDA = IO8)
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  18, 8, U8X8_PIN_NONE);  // Screen rotation: U8G2_R0

// Function to display page 1 content
void page1() {
  // Set font size 18 for the larger "KINCONY" text
  u8g2.setFont(u8g2_font_timR18_tf);  // Use the Times Roman font, size 18
  u8g2.setFontPosTop();               // Set the text position at the top of the display
  u8g2.setCursor(5, 0);               // Position the cursor at coordinates (5, 0)
  u8g2.print("KINCONY");              // Display the text "KINCONY" on the screen

  // Set font size 12 for the smaller "www.kincony.com" text
  u8g2.setFont(u8g2_font_timR12_tf);  // Use the Times Roman font, size 12
  u8g2.setCursor(0, 40);              // Position the cursor at coordinates (0, 40)
  u8g2.print("www.kincony.com");      // Display the text "www.kincony.com"
}

// Setup function, runs once when the program starts
void setup() {
  // Set the I2C address for the display to 0x3C
  u8g2.setI2CAddress(0x3C*2);  // I2C address shift for 8-bit format
 
  // Initialize the display
  u8g2.begin();
 
  // Enable UTF-8 character printing for the display
  u8g2.enableUTF8Print();  // Allow UTF-8 encoded text to be printed
}

// Main loop function, continuously runs after setup()
void loop() {
  // Begin the display drawing process
  u8g2.firstPage();  // Prepare the first page for drawing
  do {
    // Call the page1() function to draw content on the display
    page1();
  } while (u8g2.nextPage());  // Continue to the next page until all pages are drawn
}
arduino ino file download: 
.zip   10-oled-ssd1306.zip (Size: 1.11 KB / Downloads: 561)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   10-oled-ssd1306.ino.merged.zip (Size: 198.96 KB / Downloads: 557)

Print this item

  [arduino code examples for F16]-09 how to communication with Tuya WiFi module
Posted by: admin - 10-01-2024, 04:53 AM - Forum: F16 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This Arduino program implements communication between ESP32 and the Tuya module
* via UART (serial communication). It listens for specific packets from the Tuya module
* and responds according to the predefined commands.
*
* Functionality:
* 1. When the ESP32 receives a heartbeat packet (55 AA 00 00 00 00 FF),
*    it sends a heartbeat response (55 AA 03 00 00 01 00 03).
* 2. When the ESP32 receives a product information request (55 AA 00 01 00 00 00),
*    it sends a product information response (55 AA 03 01 ...).
* 3. When the ESP32 receives a work mode request (55 AA 00 02 00 00 01),
*    it sends a work mode response (55 AA 03 02 00 03 10 1C 14 47).
* 4. When the ESP32 receives a network status request (55 AA 00 03 00 01 00 03),
*    it sends a network status response (55 AA 03 03 00 00 05).
* 5. Subsequent heartbeat packets (55 AA 00 00 00 00 FF) are responded to with
*    (55 AA 03 00 00 01 01 04).
*/

#include <HardwareSerial.h>

// Create a HardwareSerial object for UART communication on ESP32
HardwareSerial tuyaSerial(1);

// Define the GPIO pins for TXD and RXD used for serial communication
#define TXD_PIN 39
#define RXD_PIN 38

// Set the baud rate for Tuya module communication to 9600
#define BAUD_RATE 9600

// Define the response packets for different commands from the Tuya module

// Heartbeat response: 55 AA 03 00 00 01 00 03
uint8_t heartBeatResponse[] = {0x55, 0xAA, 0x03, 0x00, 0x00, 0x01, 0x00, 0x03};

// Product info response with a detailed payload (e.g., firmware version, product name, etc.)
uint8_t productInfoResponse[] = {
  0x55, 0xAA, 0x03, 0x01, 0x00, 0x2A, 0x7B, 0x22, 0x70, 0x22, 0x3A, 0x22,
  0x63, 0x68, 0x6D, 0x7A, 0x6C, 0x67, 0x6A, 0x70, 0x61, 0x64, 0x70, 0x71,
  0x78, 0x64, 0x6B, 0x6F, 0x22, 0x2C, 0x22, 0x76, 0x22, 0x3A, 0x22, 0x31,
  0x2E, 0x30, 0x2E, 0x30, 0x22, 0x2C, 0x22, 0x6D, 0x22, 0x3A, 0x30, 0x7D, 0xAA
};

// Work mode response: 55 AA 03 02 00 03 10 1C 14 47
uint8_t workModeResponse[] = {0x55, 0xAA, 0x03, 0x02, 0x00, 0x03, 0x10, 0x1C, 0x14, 0x47};

// Network status response: 55 AA 03 03 00 00 05
uint8_t netStatusResponse[] = {0x55, 0xAA, 0x03, 0x03, 0x00, 0x00, 0x05};

// Subsequent heartbeat response: 55 AA 03 00 00 01 01 04
uint8_t secondHeartBeatResponse[] = {0x55, 0xAA, 0x03, 0x00, 0x00, 0x01, 0x01, 0x04};

void setup() {
  // Initialize the serial communication for debugging at 115200 baud rate
  Serial.begin(115200);

  // Initialize the serial communication with Tuya module at 9600 baud rate
  tuyaSerial.begin(BAUD_RATE, SERIAL_8N1, RXD_PIN, TXD_PIN);

  // Debug message to indicate that the serial communication has been initialized
  Serial.println("ESP32-Tuya serial communication initialized.");
}

void loop() {
  // Check if data is available from the Tuya module
  if (tuyaSerial.available()) {
    uint8_t incomingPacket[7];  // Array to store the received packet
    size_t bytesRead = tuyaSerial.readBytes(incomingPacket, 7); // Read 7 bytes from Tuya

    // Check if the packet has a valid header (0x55, 0xAA)
    if (bytesRead >= 2 && incomingPacket[0] == 0x55 && incomingPacket[1] == 0xAA) {
      // If less than 7 bytes were received, wait for more data
      if (bytesRead < 7) {
        Serial.println("Incomplete packet received. Waiting for remaining bytes...");
        delay(50); // Delay to allow more data to be received
        while (tuyaSerial.available()) {
          incomingPacket[bytesRead++] = tuyaSerial.read(); // Continue reading remaining bytes
          if (bytesRead >= 7) break;
        }
      }

      // If still less than 7 bytes, discard the incomplete packet
      if (bytesRead < 7) {
        Serial.println("Error: Incomplete packet discarded.");
        return;
      }

      // Debug: Print the received packet for logging
      Serial.print("Received packet: ");
      for (size_t i = 0; i < 7; i++) {
        Serial.print(incomingPacket[i], HEX);
        Serial.print(" ");
      }
      Serial.println();

      // Call the function to process the received packet
      processTuyaPacket(incomingPacket, 7);

    } else {
      // If the header is invalid, discard the packet and flush the buffer
      Serial.print("Error: Invalid packet header. Data received: ");
      for (size_t i = 0; i < bytesRead; i++) {
        Serial.print(incomingPacket[i], HEX);
        Serial.print(" ");
      }
      Serial.println();
      tuyaSerial.flush(); // Clear the serial buffer
    }
  }

  // Delay to avoid CPU overuse
  delay(100);
}

// Function to process the received packet and send the appropriate response
void processTuyaPacket(uint8_t* packet, size_t size) {
  // Ensure the packet size is 7 and the header is valid
  if (size == 7 && packet[0] == 0x55 && packet[1] == 0xAA) {
    // Determine the command in the packet (packet[2])
    switch(packet[2]) {
      case 0x00:
        if (packet[3] == 0x00 && packet[4] == 0x00 && packet[5] == 0x00 && packet[6] == 0xFF) {
          Serial.println("Heartbeat received.");
          sendPacket(heartBeatResponse, sizeof(heartBeatResponse));
        } else if (packet[3] == 0x01 && packet[4] == 0x00 && packet[5] == 0x00 && packet[6] == 0x00) {
          Serial.println("Product info request received.");
          sendPacket(productInfoResponse, sizeof(productInfoResponse));
        } else if (packet[3] == 0x02 && packet[4] == 0x00 && packet[5] == 0x00 && packet[6] == 0x01) {
          Serial.println("Work mode request received.");
          sendPacket(workModeResponse, sizeof(workModeResponse));
        } else if (packet[3] == 0x03 && packet[4] == 0x00 && packet[5] == 0x01 && packet[6] == 0x00) {
          Serial.println("Network status request received.");
          sendPacket(netStatusResponse, sizeof(netStatusResponse));
        }
        break;

      default:
        Serial.println("Error: Unhandled command received.");
        break;
    }
  }
}

// Function to send the response packet to the Tuya module
void sendPacket(uint8_t* packet, size_t size) {
  // Send the packet via UART to Tuya module
  tuyaSerial.write(packet, size);

  // Debug: Print the sent packet for logging
  Serial.print("Sent packet: ");
  for (size_t i = 0; i < size; i++) {
    Serial.print(packet[i], HEX);
    Serial.print(" ");
  }
  Serial.println();
}
arduino ino file download: 
.zip   9-tuya-wifi-config.zip (Size: 2 KB / Downloads: 589)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   9-tuya-wifi-config.ino.merged.zip (Size: 182.83 KB / Downloads: 605)

Print this item