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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,405
» Latest member: ll88tvcom
» Forum threads: 4,322
» Forum posts: 21,298

Full Statistics

Online Users
There are currently 37 online users.
» 0 Member(s) | 24 Guest(s)
Amazonbot, Bing, Bytespider, Crawl, PetalBot, bot

Latest Threads
⚡ 40 Buttons, 36 Lighting...
Forum: DIY Project
Last Post: lulu01
24 minutes ago
» Replies: 24
» Views: 2,927
[arduino code examples fo...
Forum: CO16
Last Post: admin
Today, 03:04 AM
» Replies: 0
» Views: 4
[arduino code examples fo...
Forum: CO16
Last Post: admin
Today, 01:34 AM
» Replies: 0
» Views: 7
[arduino code examples fo...
Forum: CO16
Last Post: admin
Today, 12:15 AM
» Replies: 0
» Views: 11
KC868-A4 – Relay 1 clicks...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Yesterday, 09:42 PM
» Replies: 1
» Views: 9
450 Hz allowed on input?
Forum: Development
Last Post: admin
Yesterday, 09:41 PM
» Replies: 3
» Views: 17
How Do You Handle Relay C...
Forum: KC868-A6
Last Post: lulu01
Yesterday, 05:41 PM
» Replies: 2
» Views: 13
"KCS" v3.27.4 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 06:02 AM
» Replies: 0
» Views: 34
how to check i2c extend c...
Forum: T16M
Last Post: admin
Yesterday, 12:38 AM
» Replies: 0
» Views: 7
T16M ESPHome yaml for hom...
Forum: T16M
Last Post: admin
Yesterday, 12:35 AM
» Replies: 0
» Views: 7

  [arduino code examples for A6v3]-05 RS232 communication test
Posted by: admin - 01-15-2025, 03:06 AM - Forum: KC868-A6v3 - No Replies

Code:
#include "Arduino.h"

// Define RS232 pins
#define RS232_TXD 9 // TX pin
#define RS232_RXD 10 // RX pin

// Define RS232 communication
HardwareSerial RS232(1); // Use UART1

void setup() {
  // Initialize RS232 serial communication
  RS232.begin(9600, SERIAL_8N1, RS232_RXD, RS232_TXD); // Baud rate 9600, 8 data bits, no parity, 1 stop bit
  Serial.begin(115200); // Debug serial communication

  Serial.println("RS232 Communication Initialized");
}

void loop() {
  static unsigned long lastSendTime = 0;

  // Send a string to RS232 every 5 seconds
  if (millis() - lastSendTime >= 5000) {
    RS232.println("This is KinCony A6v3");
    Serial.println("Sent: This is KinCony A6v3");
    lastSendTime = millis();
  }

  // Check if data is available from RS232
  while (RS232.available()) {
    String receivedData = RS232.readStringUntil('\n'); // Read data from RS232
    RS232.println(receivedData); // Echo the received data back to RS232
    Serial.println("Received and echoed: " + receivedData); // Print the received data to the debug console
  }
}
arduino ino file download:
.zip   RS232.zip (Size: 659 bytes / Downloads: 809)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   RS232.ino.merged.zip (Size: 184.5 KB / Downloads: 776)

Print this item

  [arduino code examples for A6v3]-04 RS485 communication test
Posted by: admin - 01-15-2025, 03:04 AM - Forum: KC868-A6v3 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* RS485 Communication Test with Echo
*
* This program tests RS485 communication using ESP32-S3.
* It sends a message over RS485, reads incoming messages, and echoes them back.
* The TXD pin is defined as GPIO 9 and RXD pin is defined as GPIO 8.
*/

#include <HardwareSerial.h>

// Define RS485 pins
#define RS485_RXD 18
#define RS485_TXD 17

// Create a hardware serial object
HardwareSerial rs485Serial(1);

void setup() {
  // Start serial communication for debugging
  Serial.begin(115200);
  while (!Serial);

  // Initialize RS485 Serial communication
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);
 
  Serial.println("RS485 Test Start");
}

void loop() {
  // Send a test message periodically
// rs485Serial.println("Hello from KinCony A32 Pro!");

  // Wait for a short period
  delay(100);

  // Check if data is available to read from RS485
  if (rs485Serial.available()) {
    String receivedMessage = "";
    while (rs485Serial.available()) {
      char c = rs485Serial.read();
      receivedMessage += c;
    }
   
    // Print the received message to the serial monitor
    Serial.print("Received: ");
    Serial.println(receivedMessage);
   
    // Echo the received message back over RS485
    rs485Serial.print("Echo: ");
    rs485Serial.println(receivedMessage);
  }

  // Wait before sending the next message
  delay(2000);
}
arduino ino file download:
.zip   RS485.zip (Size: 810 bytes / Downloads: 781)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   RS485.ino.merged.zip (Size: 184.34 KB / Downloads: 751)

Print this item

  [arduino code examples for A6v3]-03 Read analog input ports value
Posted by: admin - 01-15-2025, 03:00 AM - Forum: KC868-A6v3 - No Replies

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

#define ANALOG_A1   4
#define ANALOG_A2   5
#define ANALOG_A3   6
#define ANALOG_A4   7

void setup()
{
    Serial.begin(115200);
  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));
  Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));
  Serial.printf("Current Reading A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));
  Serial.printf("Current Reading A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));
  delay(500);
}
arduino ino file download:
.zip   ADC.zip (Size: 397 bytes / Downloads: 813)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   ADC.ino.merged.zip (Size: 195.06 KB / Downloads: 797)

Print this item

  [arduino code examples for A6v3]-02 Read digital input ports state
Posted by: admin - 01-15-2025, 02:57 AM - Forum: KC868-A6v3 - No Replies

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

// Set i2c address
PCF8574 pcf8574(0x22);
unsigned long timeElapsed;
void setup()
{
Wire.begin(12, 11); // SDA: GPIO12, SCL: GPIO11
Serial.begin(115200);
delay(1000);

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

    Serial.print("Init pcf8574...");
    if (pcf8574.begin()){
        Serial.println("OK");
    }else{
        Serial.println("KO");
    }
}

void loop()
{
uint8_t val1 = pcf8574.digitalRead(P0);
uint8_t val2 = pcf8574.digitalRead(P1);
uint8_t val3 = pcf8574.digitalRead(P2);
uint8_t val4 = pcf8574.digitalRead(P3);
uint8_t val5 = pcf8574.digitalRead(P4);
uint8_t val6 = pcf8574.digitalRead(P5);
uint8_t val7 = pcf8574.digitalRead(P6);
uint8_t val8 = pcf8574.digitalRead(P7);
if (val1==LOW) Serial.println("KEY1 PRESSED");
if (val2==LOW) Serial.println("KEY2 PRESSED");
if (val3==LOW) Serial.println("KEY3 PRESSED");
if (val4==LOW) Serial.println("KEY4 PRESSED");
if (val5==LOW) Serial.println("KEY5 PRESSED");
if (val6==LOW) Serial.println("KEY6 PRESSED");
if (val7==LOW) Serial.println("KEY7 PRESSED");
if (val8==LOW) Serial.println("KEY8 PRESSED");
    delay(300);
}
arduino ino file download:
.zip   8574-DI.zip (Size: 567 bytes / Downloads: 762)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   8574-DI.ino.merged.zip (Size: 191.22 KB / Downloads: 759)

Print this item

  [arduino code examples for A6v3]-01 Turn ON/OFF OUTPUT
Posted by: admin - 01-15-2025, 02:54 AM - Forum: KC868-A6v3 - No Replies

Code:
/*
Blink led on PIN0
by Mischianti Renzo <http://www.mischianti.org>

https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
*/

#include "Arduino.h"
#include "PCF8574.h"

// Set i2c address
PCF8574 pcf8574(0x24);

void setup()
{
  Wire.begin(12, 11); // SDA: GPIO12, SCL: GPIO11
    Serial.begin(115200);
//    delay(1000);

    // Set pinMode to OUTPUT
    pcf8574.pinMode(P0, OUTPUT);
  pcf8574.pinMode(P1, OUTPUT);
  pcf8574.pinMode(P2, OUTPUT);
  pcf8574.pinMode(P3, OUTPUT);
  pcf8574.pinMode(P4, OUTPUT);
  pcf8574.pinMode(P5, OUTPUT);


  pcf8574.digitalWrite(P0, HIGH);
  pcf8574.digitalWrite(P1, HIGH);
  pcf8574.digitalWrite(P2, HIGH);
  pcf8574.digitalWrite(P3, HIGH);
  pcf8574.digitalWrite(P4, HIGH);
  pcf8574.digitalWrite(P5, HIGH);

    Serial.print("Init pcf8574...");
    if (pcf8574.begin()){
        Serial.println("OK");
    }else{
        Serial.println("KO");
    }
}

void loop()
{
    delay(300);
    pcf8574.digitalWrite(P0, LOW);
  delay(300);
  pcf8574.digitalWrite(P1, LOW);
  delay(300);
  pcf8574.digitalWrite(P2, LOW);
  delay(300);
  pcf8574.digitalWrite(P3, LOW);
  delay(300);
  pcf8574.digitalWrite(P4, LOW);
  delay(300);
  pcf8574.digitalWrite(P5, LOW);
  delay(300);
}
arduino ino file download:
.zip   8574-DO.zip (Size: 594 bytes / Downloads: 851)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   8574-DO.ino.merged.zip (Size: 191.2 KB / Downloads: 819)

Print this item

  Modbus CRC mistake
Posted by: jltluc57 - 01-14-2025, 02:54 PM - Forum: Development - Replies (20)

Hello,

I think there is an error in the Modbus document

The CRC is reversed, in the document is FA 3D for me is 3D FA

My tests for this example give me this

Regards
JL



Attached Files Image(s)
   
Print this item

  Problem with names in port monitor - KC868_16A
Posted by: Poczwara13 - 01-14-2025, 01:24 PM - Forum: "KCS" v2 firmware system - Replies (5)

Hello,

I shared the recording with the problem in the link below:


https://drive.google.com/file/d/1NRPJGf5...KmdYB/edit

The problem occurs when the page is refreshed and affects the names of the input and output ports.

Alternatively, can you add a few additional characters to the port descriptions?

Print this item

Photo KC868-A16 Tasmota
Posted by: laimonas.kairiukstis - 01-13-2025, 06:49 PM - Forum: KC868-A16 - Replies (1)

what are the steps to start Tasmota on KC868-A16  rev.1.6 ESP32-Wroom-32E.
I started automatic install from Tasmota site:
Install Tasmota
Finally I got Tasmota installed, but the outputs do not work.

Print this item

  ESPhome homeassistant
Posted by: charmacf - 01-13-2025, 01:24 PM - Forum: KC868-A6 - Replies (17)

i need help on how to control KC868-A6 i tried to install the demo version on the forums but i did something wrong.

Print this item

  S3 V1.0 firmware
Posted by: henkrouwenhorst - 01-13-2025, 09:46 AM - Forum: "KCS" v2 firmware system - Replies (3)

I am new to programming I have 3 x KC868 A16 boards I have successfully loaded firmware on to all of them and all function great. My problem is to load firmware on the Kincony S3 V1.0 in the " how to use online " section it refers to newer ESP32 S3 boards with the aluminium black case with screen and not the S3 Core board that I have.
I assume my problem is I am trying to load the wrong firmware on my board therefore I have no success. Could someone please give some guidance and a link to the correct firmware.
I want to use this to monitor tank level and temperature and link to my Home Assistant.
It seems there is not many people posting about this specific board in your forum.

Print this item