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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,633
» Latest member: shirleyhill
» Forum threads: 2,947
» Forum posts: 15,633

Full Statistics

Online Users
There are currently 7 online users.
» 0 Member(s) | 2 Guest(s)
Amazonbot, bot

Latest Threads
Driver recommendation for...
Forum: DIY Project
Last Post: TMaYaD
1 hour ago
» Replies: 4
» Views: 14
all relay controllers sel...
Forum: Schematic and diagram
Last Post: peacemakerv
1 hour ago
» Replies: 4
» Views: 8
M30 configure yaml for ES...
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
1 hour ago
» Replies: 18
» Views: 2,065
A16v3 low voltage inputs
Forum: KC868-A16
Last Post: jaydubnz
3 hours ago
» Replies: 6
» Views: 34
KC868-A16 - Maximum outpu...
Forum: KC868-A16
Last Post: admin
6 hours ago
» Replies: 1
» Views: 5
How to uses sensors with ...
Forum: "KCS" v3 firmware
Last Post: admin
7 hours ago
» Replies: 11
» Views: 51
"KCS" v3.9.1 firmware BIN...
Forum: "KCS" v3 firmware
Last Post: admin
7 hours ago
» Replies: 0
» Views: 15
MB Specs - 8A per channel...
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
11 hours ago
» Replies: 7
» Views: 26
KC868-A4S and meanwell EL...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
11 hours ago
» Replies: 1
» Views: 5
KC868-A6 ESP32 I/O pin de...
Forum: KC868-A6
Last Post: admin
Yesterday, 10:19 PM
» Replies: 7
» Views: 8,845

  relay
Posted by: TurSolution - 01-09-2025, 04:02 PM - Forum: KC868-A16 - Replies (1)

Hi all
I can't use relays no turn on and no turn off.
How can you help me?


my code : 
#include "gpio_i2c.h"
#include "compile_profile.h"
#include "print_log.h"
#include "PCF8574.h"
#include <Wire.h>


#define MODULE_NAME  "gpio_i2c.cpp"

#define Input_IIC_address 0x21
#define Input_IIC_address 0x22

#define Relay_IIC_address 0x24
#define Relay_IIC_address 0x25
GPIO_I2C gpioI2C;

// Set i2c address
PCF8574 pcf8574_input_1(Input_IIC_address,4,5);
PCF8574 pcf8574_input_2(Input_IIC_address,4,5);

PCF8574 pcf8574_relay_1(Relay_IIC_address,4,5);
PCF8574 pcf8574_relay_2(Relay_IIC_address,4,5);



void GPIO_I2C::Init()
{
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)

    PRINT_LOG_API_PrintDebug("Init()..", MODULE_NAME, __LINE__);
    byte count = 0;
    Wire.begin(4, 5);
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);          // Begin I2C transmission Address (i)
    if (Wire.endTransmission () == 0)  // Receive 0 = success (ACK response)
    {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);    // PCF8574 7 bit address
      Serial.println (")");
      break;
    }
  }


    //Wire.begin();  // Initialize I2C communication
  // Wire.setClock(100000); // Set I2C clock to 100kHz (default is 400kHz)

   

   

    pcf8574_relay_1.pinMode(P0, OUTPUT);
    pcf8574_relay_1.pinMode(P1, OUTPUT);
    pcf8574_relay_1.pinMode(P2, OUTPUT);
    pcf8574_relay_1.pinMode(P3, OUTPUT);
    pcf8574_relay_1.pinMode(P4, OUTPUT);
    pcf8574_relay_1.pinMode(P5, OUTPUT);
    pcf8574_relay_1.pinMode(P6, OUTPUT);
    pcf8574_relay_1.pinMode(P7, OUTPUT);

    pcf8574_relay_2.pinMode(P0, OUTPUT);
    pcf8574_relay_2.pinMode(P1, OUTPUT);
    pcf8574_relay_2.pinMode(P2, OUTPUT);
    pcf8574_relay_2.pinMode(P3, OUTPUT);
    pcf8574_relay_2.pinMode(P4, OUTPUT);
    pcf8574_relay_2.pinMode(P5, OUTPUT);
    pcf8574_relay_2.pinMode(P6, OUTPUT);
    pcf8574_relay_2.pinMode(P7, OUTPUT);

   

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

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


    if (pcf8574_relay_1.begin())
    {
        Serial.println("pcf8574_relay_1 OK");
    }
    else
    {
        Serial.println("pcf8574_relay_1 not OK");
    }

    Serial.print("Init pcf8574_2...");
    if (pcf8574_relay_2.begin())
    {
        Serial.println("pcf8574_relay_2 OK");
    }
    else
    {
        Serial.println("pcf8574_relay_2 NOT OK");
    }

    for(int i=0; i< 8; i++)
    {
        pcf8574_relay_1.digitalWrite(i, LOW);
        pcf8574_relay_2.digitalWrite(i, LOW);
    }

    if (pcf8574_input_1.begin())
    {
        Serial.println("pcf8574_input_1 OK");
    }
    else
    {
        Serial.println("pcf8574_input_1 not OK");
    }

    Serial.print("pcf8574_input_2...");
    if (pcf8574_input_2.begin())
    {
        Serial.println("pcf8574_input_2 OK");
    }
    else
    {
        Serial.println("pcf8574_input_2 NOT OK");
    }

  PRINT_LOG_API_PrintDebug("Init()..Finish", MODULE_NAME, __LINE__);
#endif

}
void GPIO_I2C:TongueinMode(uint8_t pinNum, bool mode)
{
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)
if (pinNum > 8)
    {
        if(mode)
        {
            pcf8574_relay_1.pinMode((pinNum - 1), OUTPUT);
        }       
    }
    else
    {
        if(mode)
        {
            pcf8574_relay_2.pinMode((pinNum - 1 - 8), OUTPUT);           
        }
    }
#endif
}


void GPIO_I2C::SetPinMode(bool mode, uint8_t pinNum)
{
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)
    if (pinNum > 8)
    {
        if(mode)
        {
            pcf8574_relay_1.pinMode((pinNum - 1), OUTPUT);
        }
       
    }
    else
    {
        if(mode)
        {
            pcf8574_relay_2.pinMode((pinNum - 1 - 8), OUTPUT);
           
        }
    }

#endif
}

void GPIO_I2C:Big GrinigitalWrite(uint8_t pinNum, bool mode)
{
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)
   
    if (pinNum > 8)
    {
        pcf8574_relay_1.digitalWrite(pinNum - 1, mode);
    }
    else
    {
        pcf8574_relay_2.digitalWrite(pinNum - 8 - 1, mode);
    }

#endif
}
void GPIO_I2C::SetOutputMode(bool mode, uint8_t pinNum)
{
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)
   
    if (pinNum > 8)
    {
        pcf8574_relay_1.digitalWrite(pinNum - 1, mode);
    }
    else
    {
        pcf8574_relay_2.digitalWrite(pinNum - 8 - 1, mode);
    }

#endif
}

bool GPIO_I2C::ReadInput(uint8_t pinNum)
{
    bool retVal = false;


#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)


    if (pinNum > 8)
    {
        retVal = pcf8574_input_1.digitalRead(pinNum - 1);
    }
    else
    {
        retVal = pcf8574_input_2.digitalRead(pinNum - 8 - 1);
    }

#endif

    return retVal;

}


int GPIO_I2C:Big GrinigitalRead(uint8_t pinNum)
{
    int retVal = -1;
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)
   
    if (pinNum > 8)
    {
        retVal = pcf8574_input_1.digitalRead(pinNum - 1);
    }
    else
    {
        retVal = pcf8574_input_2.digitalRead(pinNum - 8 - 1);
    }

#endif

return retVal;
}

void GPIO_I2C::TestOutput()
{
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)

    PRINT_LOG_API_PrintDebug("TestOutput()..", MODULE_NAME, __LINE__);

    for(int i=0; i< 8; i++)
    {
        PRINT_LOG_API_PrintDebug("TestOutput() HIGH", MODULE_NAME, __LINE__);
        pcf8574_relay_1.digitalWrite(i, HIGH);
        pcf8574_relay_2.digitalWrite(i, HIGH);
        delay(2500);
        PRINT_LOG_API_PrintDebug("TestOutput() LOW", MODULE_NAME, __LINE__);
        pcf8574_relay_1.digitalWrite(i, LOW);
        pcf8574_relay_2.digitalWrite(i, LOW);
    }
    PRINT_LOG_API_PrintDebug("TestOutput()..Finish", MODULE_NAME, __LINE__);
    #endif
}

void GPIO_I2C::TestOutputP1()
{
#if ( PROFILE_COMPILE & GPIO_I2C_MODULE)

        PRINT_LOG_API_PrintDebug("TestOutputP1() HIGH", MODULE_NAME, __LINE__);
        //pcf8574_relay_1.digitalWriteAll(0xff);
        //pcf8574_relay_2.digitalWriteAll(0xff);
        //pcf8574_1.digitalWrite(0, HIGH);
        for (size_t i = 0; i < 8; i++)
        {
            pcf8574_relay_1.digitalWrite(i, HIGH);
            pcf8574_relay_2.digitalWrite(i, HIGH);
        }
       
     
        delay(1000);
        PRINT_LOG_API_PrintDebug("TestOutputP2() LOW", MODULE_NAME, __LINE__);
        for (size_t i = 0; i < 8; i++)
        {
            pcf8574_relay_1.digitalWrite(i, LOW);
            pcf8574_relay_2.digitalWrite(i, LOW);
        }
        delay(1000);
    #endif
}

Print this item

  KC868-A16S multiple DS18B20 possible ?
Posted by: land88 - 01-09-2025, 10:13 AM - Forum: KC868-A16S - Replies (1)

Hi,

I have connected on KC868-a16S a DS18B20 on 1-Wire input, it's ok with KCS.
Is it possible to put an other DS18B20 in parallel ? I have try, but not possible to see an other sensor temperature.
If not possible with an other DS18B20, is it possible with other sensor type ? by exemple thermistance NTC b3950-10K on Analogic ADC input ? (I think there is two positions analogic for voltage)

Thanks.

Print this item

  K868-a32 plastic case
Posted by: mitzuuu89 - 01-09-2025, 08:54 AM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

Coundn't find a plastic case for the K868-a32 in the kincony store, there's a shell for kc868-ai but i'm not sure if it fits the K868-a32. 
Anyone have a 3d print file? Or does anyone know if the AI shell fits the A32?

https://shop.kincony.com/products/green-...put-module

Print this item

  Advice for a board
Posted by: Bergoglio - 01-08-2025, 11:50 PM - Forum: KC868-A series and Uair Smart Controller - Replies (3)

Good morning,

I'm searching a simple ESP32 board with these connections :
- 1 LAN rj45 port
- 2 dry contacts for two different switches
- 2 GPIO pins to pilot one DFRobot DFPlayer Mini MP3 Player
- 1 GPIO pin to pilot a RGB led strip (probably a WS2812 chip)

Because I'm quite a noob in electronic, I'm not able to choose between Your products and I need Your help / advice.

Best regards

Print this item

  Better documentation?
Posted by: riz94107 - 01-08-2025, 09:40 PM - Forum: KC868-A6 - Replies (7)

I've just got a KC868-A6 purchased via Aliexpress - I was expecting things to "just work", but since they're not, is there better documentation anywhere?

Here's what I've tried:

- the unit boots (and cycles the relays) when 12V is applied
- What little documentation I've seen says it should be in AP mode - but no APs show up in my local wifi at all (even after pressing buttons for >10s as indicated)
- the USB-C port does not seem to work, or at least it's not detected when I plug it into my computer (neither MacOS nor Linux).  I would expect to be able to load ESP32 code via USB, but... no
- plugging in an s1306 display doesn't yield any info (the display remains dark, probably not supported in the loaded firmware)
- the RS232 port does have some activity.  I see this:

Code:
**********
T1: -0.06
         T2: -0.06
                  2022/11/28 (Monday) 11:30:52

... and when I press the S2 button, I get this:
Code:
Download key is ok !

How am I supposed to be able to get ESPHome on this thing? Smile  (I am pretty familiar with ESP32 and ESPHome - it's not clear which serial port is supposed to work for this).

Thanks.

Print this item

  KC868_16S System Menu : exit to login
Posted by: land88 - 01-08-2025, 08:41 PM - Forum: KC868-A16S - Replies (2)

Hi,

I have a new KC868_A16S, firmware V2.2.10.
When I want to set ntp in system menu, the menu exit to login and it's impossible to go inside the system Menu.

How to do ?
Thanks.

Print this item

  What is the expected relay behaviour?
Posted by: Sheep - 01-08-2025, 06:50 PM - Forum: F16 - Replies (1)

Hello,

I have an F16 as a test unit because I would like to install two F32s as smart home controllers, mainly for lights, in a house build working with home assistant (HA).  I hope they offer a good option by being able to sense low power wired wall switched and feed in to HA and output power to smart LED lighting in each room, with the ability to physically toggle the lights should some catastrophic HA / F16 controller / network event occur.  This also offers safety if work needs to be carried out.

I'm trying to understand what the behaviour is supposed to be for the output relays when controlled in software and the physical switch.  I've found the same happens with ESPhome and the KCS v3 software.  It is not connected to the internet (ie the Tuya module is offline).

I would expect that the circuit allows for feedback between software and physical switch control, meaning that turning on the physical switch will register as being 'on' on the software side.  Similarly, I would expect that the software switch could toggle the state of the physical switch in either state, and change the red 'on,' light.

I find that there appears to be no feedback between the physical switching of the relay and the software.
The software switching alone works flawlessly and the physical toggle alone works flawlessly.
The problem is that if the software has turned the output on, the physical switch will not turn it off.  If the physical switch has turned the output on this is not fed back in software and, although the software button can still be toggled, this has no effect on the relay and it remains on despite being toggled in software.  This persists even if the F16 then loses internet connection.  I've not found any hint in the YAML files that there is any form of sensor for the physical toggle switches, nor can I find a schematic to figure it out.

So, am I being rather daft and missing an obvious setting somewhere or is this an intended behaviour (which would be a shame and can it be changed?)?

Any help much appreciated and hope it's just me doing something wrong, as this seems like a really high quality product.

Yours,

S,

Print this item

  KC868-H32 Relay Controller REV:2.4 Problem after firmware update
Posted by: bvelinov - 01-08-2025, 07:26 AM - Forum: KC868-HxB series Smart Controller - Replies (5)

Hello, today I ordered from your controller for control through the Tuya application, and in this regard I decided to change the firmware version with a new one downloaded from your site following all the steps as described. After the procedure is completed, my kc868-h32 is no longer the same. outputs 2 and 3 flash and the response time of the buttons is unstable. Please give me feedback and if there is the original version of my device, could you provide it to me?


I installed the firmware H32B_V508_230921

   

Print this item

  KC868-H32 Relay Controller REV:2.4 Problem after firmware update
Posted by: bvelinov - 01-08-2025, 05:21 AM - Forum: News - Replies (3)

Hello, today I ordered from your controller for control through the Tuya application, and in this regard I decided to change the firmware version with a new one downloaded from your site following all the steps as described. After the procedure is completed, my kc868-h32 is no longer the same. outputs 2 and 3 flash and the response time of the buttons is unstable. Please give me feedback and if there is the original version of my device, could you provide it to me?

I installed the firmware H32B_V508_230921



Attached Files Thumbnail(s)
   
Print this item

  KC868-a6 Relay switches
Posted by: icemannz - 01-08-2025, 04:21 AM - Forum: DIY Project - Replies (3)

Hi, I have a KC868-a6 board and it is up and running with ESPHome.
I can control all the relays via Home Assistant without issue.

What I would like to do is also have manual switches mounted on the box so I can switch a relay on or off.
I thought that grounding the DI-1 through 6 pins were for this but they don't appear to work that way.

Is there a way to connect up 6 small switches to the board to allow for manual switching if the relays ?

Print this item