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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,363
» Latest member: melrose63
» Forum threads: 2,574
» Forum posts: 13,303

Full Statistics

Online Users
There are currently 42 online users.
» 1 Member(s) | 28 Guest(s)
Amazonbot, Applebot, Bytespider, Crawl, Google, Yandex, bot, korl

Latest Threads
Need help with configurat...
Forum: KC868-HxB series Smart Controller
Last Post: admin
1 hour ago
» Replies: 32
» Views: 380
ESP32 S3 set up issue
Forum: Extender module
Last Post: admin
5 hours ago
» Replies: 10
» Views: 57
A32 Pro ESPHome yaml incl...
Forum: KC868-A32/A32 Pro
Last Post: admin
5 hours ago
» Replies: 16
» Views: 175
KC868-A8 Schematic
Forum: KC868-A8
Last Post: admin
6 hours ago
» Replies: 7
» Views: 41
change wake up name
Forum: KinCony AS
Last Post: admin
6 hours ago
» Replies: 11
» Views: 64
"KCS" v2.2.8 firmware BIN...
Forum: "KCS" firmware system
Last Post: admin
6 hours ago
» Replies: 2
» Views: 158
Dimensions/drawings of bo...
Forum: Schematic and diagram
Last Post: admin
6 hours ago
» Replies: 1
» Views: 18
how to use AS ESP32-S3 vo...
Forum: KinCony AS
Last Post: admin
12-16-2024, 10:55 PM
» Replies: 12
» Views: 446
Problem with IFTTT automa...
Forum: "KCS" firmware system
Last Post: admin
12-16-2024, 10:53 PM
» Replies: 5
» Views: 34
M16 SHT31 sensor disconne...
Forum: KC868-M16 / M1 / MB / M30
Last Post: bsarra
12-16-2024, 08:36 PM
» Replies: 4
» Views: 38

  [arduino code examples for G1]-03 Ethernet W5500 chip work with TCP Server mode
Posted by: admin - 12-06-2024, 01:34 AM - Forum: G1 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This Arduino program sets up an ESP32-S3 with a W5500 Ethernet module
* as a TCP server. It listens on port 4196 and echoes back any string
* received from a client.
*
* Hardware connections:
* - CLK: GPIO42
* - MOSI: GPIO43
* - MISO: GPIO44
* - CS: GPIO41
* - RST: GPIO1
* - INT: GPIO2
*
* Static IP address: 192.168.3.55
* Subnet Mask: 255.255.255.0
* Gateway: 192.168.3.1
* DNS: 192.168.3.1
*/

#include <SPI.h>
#include <Ethernet.h>

// Define the W5500 Ethernet module pins
#define W5500_CS_PIN  41
#define W5500_RST_PIN 1
#define W5500_INT_PIN 2
#define W5500_CLK_PIN 42
#define W5500_MOSI_PIN 43
#define W5500_MISO_PIN 44

// MAC address for your Ethernet shield (must be unique on your network)
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

Static IP address configuration
IPAddress ip(192, 168, 3, 55);       // Static IP address
IPAddress subnet(255, 255, 255, 0);   // Subnet mask
IPAddress gateway(192, 168, 3, 1);    // Default gateway
IPAddress dns(192, 168, 3, 1);        // DNS server address

// Create an EthernetServer object to handle TCP connections
EthernetServer server(4196);

void setup() {
  // Initialize serial communication
  Serial.begin(115200);
  while (!Serial) {
    ; // Wait for serial port to connect
  }

  // Initialize the W5500 module
  pinMode(W5500_RST_PIN, OUTPUT);
  pinMode(W5500_INT_PIN, INPUT);
  digitalWrite(W5500_RST_PIN, LOW);  // Reset the W5500 module
  delay(100);                       // Wait for reset to complete
  digitalWrite(W5500_RST_PIN, HIGH); // Release reset

  // Initialize SPI with the correct pin definitions
  SPI.begin(W5500_CLK_PIN, W5500_MISO_PIN, W5500_MOSI_PIN);

  // Set up the Ethernet library with W5500-specific pins
  Ethernet.init(W5500_CS_PIN);

  // Start the Ethernet connection with static IP configuration
  Ethernet.begin(mac, ip, dns, gateway, subnet);

  // Print the IP address to the serial monitor
  Serial.print("IP Address: ");
  Serial.println(Ethernet.localIP());

  // Start listening for incoming TCP connections
  server.begin();
}

void loop() {
  // Check for incoming client connections
  EthernetClient client = server.available();
  if (client) {
    Serial.println("New client connected");

    // Read data from the client and echo it back
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        server.write(c);
      }
    }

    // Close the connection when done
    client.stop();
    Serial.println("Client disconnected");
  }
}
arduino ino file download: 

.zip   3-Ethernet-W5500.zip (Size: 1.23 KB / Downloads: 8)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   3-Ethernet-W5500.ino.merged.zip (Size: 189.2 KB / Downloads: 12)

Print this item

  [arduino code examples for G1]-02 Read free GPIO state
Posted by: admin - 12-06-2024, 01:32 AM - Forum: G1 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* GPIO Status Monitoring with Change Detection
*
* This program monitors the status (high or low) of multiple GPIO pins on the ESP32-S3.
* It prints the status of the pins to the serial monitor whenever a change is detected.
*
* Additional Functionality:
* - The program now monitors 11 GPIO pins, not just the previously listed ones.
* - GPIO pins include: GPIO 15, 16, 17, 40, 13, 14, 21, 4, 5, 6, 7.
* - For each pin, whenever its state changes (from HIGH to LOW or vice versa), the new state is printed to the serial monitor.
*
* GPIO Pins Monitored:
* - GPIO 15
* - GPIO 16
* - GPIO 17
* - GPIO 40
* - GPIO 13
* - GPIO 14
* - GPIO 21
* - GPIO 4
* - GPIO 5
* - GPIO 6
* - GPIO 7
*
* Hardware Requirements:
* - Connect the pins to appropriate devices or pull them to HIGH/LOW for testing.
* - Ensure that the ESP32-S3 is powered and connected to a serial monitor to observe the output.
*
* How it works:
* - The setup function initializes the serial communication and configures the GPIO pins as inputs.
* - The loop function continuously checks the state of each GPIO pin.
* - If a pin's state changes, the new state is printed to the serial monitor, along with the corresponding pin number.
* - The program uses a delay to prevent excessive serial prints, which can be adjusted as necessary.
*/


#define GPIO_PIN_15 15
#define GPIO_PIN_16 16
#define GPIO_PIN_17 17
#define GPIO_PIN_40 40
#define GPIO_PIN_13 13
#define GPIO_PIN_14 14
#define GPIO_PIN_21 21
#define GPIO_PIN_4 4
#define GPIO_PIN_5 5
#define GPIO_PIN_6 6
#define GPIO_PIN_7 7

// Store the previous state of the GPIO pins
bool prevState[11] = {false, false, false, false, false, false, false, false, false, false, false};

void setup() {
  // Initialize serial communication for debugging purposes
  Serial.begin(115200); // Initialize the serial monitor at 115200 baud
  while (!Serial);      // Wait for the serial monitor to open

  // Initialize GPIO pins as inputs
  pinMode(GPIO_PIN_15, INPUT);
  pinMode(GPIO_PIN_16, INPUT);
  pinMode(GPIO_PIN_17, INPUT);
  pinMode(GPIO_PIN_40, INPUT);
  pinMode(GPIO_PIN_13, INPUT);
  pinMode(GPIO_PIN_14, INPUT);
  pinMode(GPIO_PIN_21, INPUT);
  pinMode(GPIO_PIN_4, INPUT);
  pinMode(GPIO_PIN_5, INPUT);
  pinMode(GPIO_PIN_6, INPUT);
  pinMode(GPIO_PIN_7, INPUT);

  Serial.println("GPIO Status Monitoring Started");
}

void loop() {
  // Read the current state of each GPIO pin
  bool currentState[11];
  currentState[0] = digitalRead(GPIO_PIN_15);
  currentState[1] = digitalRead(GPIO_PIN_16);
  currentState[2] = digitalRead(GPIO_PIN_17);
  currentState[3] = digitalRead(GPIO_PIN_40);
  currentState[4] = digitalRead(GPIO_PIN_13);
  currentState[5] = digitalRead(GPIO_PIN_14);
  currentState[6] = digitalRead(GPIO_PIN_21);
  currentState[7] = digitalRead(GPIO_PIN_4);
  currentState[8] = digitalRead(GPIO_PIN_5);
  currentState[9] = digitalRead(GPIO_PIN_6);
  currentState[10] = digitalRead(GPIO_PIN_7); 

  // Check for changes in GPIO pin states
  for (int i = 0; i < 11; i++) {
    if (currentState[i] != prevState[i]) {
      // Print the pin number and its new state if it has changed
      Serial.print("GPIO ");
      Serial.print(i == 0 ? GPIO_PIN_15 :
                   i == 1 ? GPIO_PIN_16 :
                   i == 2 ? GPIO_PIN_17 :
                   i == 3 ? GPIO_PIN_40 :
                   i == 4 ? GPIO_PIN_13 :
                   i == 5 ? GPIO_PIN_14 :
                   i == 6 ? GPIO_PIN_21 :
                   i == 7 ? GPIO_PIN_4 :
                   i == 8 ? GPIO_PIN_5 :                                                           
                   i == 9 ? GPIO_PIN_6 : GPIO_PIN_7);
      Serial.print(" changed to ");
      Serial.println(currentState[i] ? "HIGH" : "LOW");
      // Update the previous state
      prevState[i] = currentState[i];
    }
  }

  // Delay to avoid flooding the serial monitor
  delay(100); // Adjust the delay as needed
}
arduino ino file download: 

.zip   2-free-gpio-state.zip (Size: 1.42 KB / Downloads: 11)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   2-free-gpio-state.ino.merged.zip (Size: 179.82 KB / Downloads: 13)

Print this item

  [arduino code examples for G1]-01 Read digital input ports state
Posted by: admin - 12-06-2024, 01:29 AM - Forum: G1 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads the state of a 16-channel PCF8575 I/O expander
* and prints the state of all input pins to the Serial Monitor. The state of
* each pin is represented as a bit in a 16-bit value, where each bit corresponds
* to an input pin. The program prints the input state in binary format.
*
* Pin Definitions:
* - SDA: GPIO 12
* - SCL: GPIO 11
* - PCF8575 I2C Address: 0x24
*/

#include "Arduino.h"
#include "PCF8575.h"

// Define I2C pins
#define I2C_SDA 12  // Define SDA pin
#define I2C_SCL 11  // Define SCL pin

// Set I2C address
PCF8575 pcf8575_IN1(0x24); // The I2C address of the PCF8575

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

    // Initialize I2C communication
    Wire.begin(I2C_SDA, I2C_SCL); // Initialize I2C with defined SDA and SCL pins

    pcf8575_IN1.begin(); // Initialize the PCF8575

    Serial.println("KinCony G1 16CH input state 0:ON  1:OFF"); //actually PCB used 12 buttons, reset 4CH digital input free
}

void loop() {
    uint16_t state = 0;

    // Read the state of each pin (assuming 16 pins)
    for (int pin = 0; pin < 16; pin++) {
        if (pcf8575_IN1.read(pin)) {
            state |= (1 << pin); // Set the bit for the active pin
        }
    }

    Serial.print("Input state: ");
    Serial.println(state, BIN); // Print the state of inputs in binary

    delay(500); // Delay 500ms
}
arduino ino file download:

.zip   1-digital-input.zip (Size: 875 bytes / Downloads: 11)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   1-digital-input.ino.merged.zip (Size: 189.81 KB / Downloads: 12)

Print this item

  SIM7600E AT command transparently transmitted to ESP32 Arduino code and BIN firmware
Posted by: admin - 12-06-2024, 01:27 AM - Forum: G1 - No Replies

function: Use KinCony G1 module to transparently transmit AT commands of SIM7600 4G module to gpio13 and gpio14 of esp23-s3. So that KinCony Controller can connect with extend G1 4G module by KCS v3 firmware.
   
   
   

Code:
#include <HardwareSerial.h>

// Define hardware serial ports
HardwareSerial SimSerial(1);     // Use hardware serial port 1 (GPIO9 and GPIO10)
HardwareSerial ExtendSerial(2);  // Use hardware serial port 2 (GPIO13 and GPIO14)

void setup() {
  // Initialize the extended serial port (hardware serial port 2)
  ExtendSerial.begin(115200, SERIAL_8N1, 13, 14); // RX=GPIO13, TX=GPIO14
  while (!ExtendSerial) {
    ; // Wait for the extended serial port to connect
  }

  // Initialize the SIM7600 serial port (hardware serial port 1)
  SimSerial.begin(115200, SERIAL_8N1, 9, 10); // RX=GPIO9, TX=GPIO10
}

void loop() {
  // If data is received from the extended serial port, forward it to the SIM7600 module
  if (ExtendSerial.available()) {
    while (ExtendSerial.available()) {
      char data = ExtendSerial.read();
      SimSerial.write(data);
    }
  }

  // If data is received from the SIM7600 module, forward it to the extended serial port
  if (SimSerial.available()) {
    while (SimSerial.available()) {
      char data = SimSerial.read();
      ExtendSerial.write(data);
    }
  }
}
BIN file download to ESP32-S3 directly:

.zip   7-GSM-Test-extend-pins.ino.merged.zip (Size: 184.13 KB / Downloads: 16)

Print this item

Question How can I power multiple devices simultaneously using KC868-A16?
Posted by: ingersoj - 12-06-2024, 12:04 AM - Forum: KC868-A series and Uair Smart Controller - Replies (8)

I bought the KC868-A16 recently and I worked with it for a few days to set it up with Home Assistant; now I finally have it set up so I can connect my devices to the outputs and switch them on/off (one at a time) using home assistant.

The problem I am now having is that when I try to switch on more than one device at a time (each connected to a different output on the KC868-A16), the devices will not get enough power and they will switch off automatically through the KC868-A16 after a second or so. 

Each of my devices requires 12 Volts and 3 Amps of power. I currently have 12 devices in total. What do I need to do in order to give adequate power to all devices at the same time, assuming I have connected them each to a different output, and without them losing power? I have only tried two devices at once and that didn't even work - only one device at a time can receive enough power to stay on.

Print this item

  Raspberry pi + KC868-a16 + HA
Posted by: plachowicz - 12-05-2024, 09:24 PM - Forum: DIY Project - Replies (1)

Witam,

Zaczynam swoją przygodę z home assistant. Zakupiłem KC868-a16. System bedzie zainstalowany na raspberry pi. 
Czy moze ktos podesłac jakis tutorial pokazujacy konfiguracje KC868-a16 z HA?

Z gory bardzo dziekuje.

Pozdrawiam
Przemek

Print this item

  a16 feedback
Posted by: mutaz - 12-05-2024, 06:41 PM - Forum: KC868-A series and Uair Smart Controller - Replies (7)

hi

when connecting switch to the controller where would i connect feedback light to the switch?

Print this item

  KC868-A8
Posted by: DarthWeber - 12-05-2024, 06:53 AM - Forum: Development - Replies (1)

Hi,

any suggestions how i can detect 24VAC with the inputs? I do not need to know the oszillating, i only want to have it if it is on or off.

regards,
Tom

Print this item

  can't connected to lan at first switch on brand new card
Posted by: kerdalle - 12-04-2024, 05:26 PM - Forum: KC868-A16 - Replies (10)

Good morning all,
I have just received brand new K868-A16 Rev:1.6 and connected to routeur 
scan ip give address at 192.168.1.200. with mac: ec:c9:ff:b5:f3:6f
I ping this address:
ping 192.168.1.200
PING 192.168.1.200 (192.168.1.200): 56 data bytes
64 bytes from 192.168.1.200: icmp_seq=0 ttl=255 time=6.079 ms
My problem : web ui 192.168.1.200:80 reply This site is inaccessible
192.168.1.200 does not allow connection.
I have scan this address with UDP Scan from 0 to 65535 without nothing open
So I can't go any further. I have check on forum but without any success
How i can first connect to my new K868-A16 or the first time which is so far a nice useless brick
Your help will be appreciated

Print this item

  Request for a free sample
Posted by: Radoslaw - 12-04-2024, 12:48 PM - Forum: Apply for free sample product - No Replies

Hello @ administrators and users,
I am an engineering student specializing in reducing energy consumption costs - electrical and thermal. I would like to learn about Kincona products for further development in the field of study (A). Can I apply for a sample of KC868-A4?

Print this item