<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Smart Home Automation Forum - KC868-A2v3]]></title>
		<link>https://www.kincony.com/forum/</link>
		<description><![CDATA[Smart Home Automation Forum - https://www.kincony.com/forum]]></description>
		<pubDate>Mon, 11 May 2026 20:43:52 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[KC868-A2v3 FILES]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9192</link>
			<pubDate>Tue, 31 Mar 2026 18:28:36 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=10663">ridouane.othman@gmail.com</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9192</guid>
			<description><![CDATA[Hi,<br />
I am planning to design a custom case for the KC868-A2v3 board and would like to ensure accurate fitting.<br />
Could you please provide the mechanical drawings (including dimensions and mounting holes) and, if available, the 3D CAD files (STEP/STP format) for this board?]]></description>
			<content:encoded><![CDATA[Hi,<br />
I am planning to design a custom case for the KC868-A2v3 board and would like to ensure accurate fitting.<br />
Could you please provide the mechanical drawings (including dimensions and mounting holes) and, if available, the 3D CAD files (STEP/STP format) for this board?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-a8v3 IFTTT for Aircon use]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9115</link>
			<pubDate>Thu, 12 Mar 2026 18:59:17 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=10216">beegeenz</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9115</guid>
			<description><![CDATA[I have KC868-a8v3.1 board loaded with the current firmware V3.23.2<br />
<br />
It is used for switching 24VAC to control AC ducts in conjunction with Home Assistant.<br />
<br />
My challenge is that the Rumpus room duct (controlled by DO8 on KC868) is fed from a master upstairs duct (controller by DO2 on KC868) so both ducts need to be open for AC to reach the Rumpus room.<br />
For ease of user operation I would like to setup the a IFTTT rule so that;<br />
1. when a user turns on the Rumpus duct (D08) the upstairs duct will also activate (D02) (turn on could by by HA or RF on the KC868)<br />
2. if the user subsequently turns off the Rumpus duct, the Upstairs duct will remain open.<br />
<br />
Also, if the Upstairs duct is turned off, there should be a rule to turn on the Rumpus room duct, this is necessary to reflect through to the HA dashboard.<br />
<br />
Using IFTTT I setup an IF condition on the DO8 which performs an action on D02.<br />
<br />
I found that this doesn't work properly and the KC web page status indicator for D02 and D08 are not linked corectly by the rule.  At one stage the KC868 crashed and I had to relead the formward with the formward loader tool.<br />
<br />
Can you please advise if IFTTT can be used for this sort of rules or is there another way on the KC868 to achieve this.<br />
<br />
Regards]]></description>
			<content:encoded><![CDATA[I have KC868-a8v3.1 board loaded with the current firmware V3.23.2<br />
<br />
It is used for switching 24VAC to control AC ducts in conjunction with Home Assistant.<br />
<br />
My challenge is that the Rumpus room duct (controlled by DO8 on KC868) is fed from a master upstairs duct (controller by DO2 on KC868) so both ducts need to be open for AC to reach the Rumpus room.<br />
For ease of user operation I would like to setup the a IFTTT rule so that;<br />
1. when a user turns on the Rumpus duct (D08) the upstairs duct will also activate (D02) (turn on could by by HA or RF on the KC868)<br />
2. if the user subsequently turns off the Rumpus duct, the Upstairs duct will remain open.<br />
<br />
Also, if the Upstairs duct is turned off, there should be a rule to turn on the Rumpus room duct, this is necessary to reflect through to the HA dashboard.<br />
<br />
Using IFTTT I setup an IF condition on the DO8 which performs an action on D02.<br />
<br />
I found that this doesn't work properly and the KC web page status indicator for D02 and D08 are not linked corectly by the rule.  At one stage the KC868 crashed and I had to relead the formward with the formward loader tool.<br />
<br />
Can you please advise if IFTTT can be used for this sort of rules or is there another way on the KC868 to achieve this.<br />
<br />
Regards]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Error Flashing new KCS firmware using ESP32 Download Tool]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8316</link>
			<pubDate>Sat, 12 Jul 2025 15:36:36 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=9067">steven22</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8316</guid>
			<description><![CDATA[Hi everyone, I'm new to Kincony products and this forum. I recently bought a Kincony A2V3.1 board to test these products and their integration with Home Assistant.<br />
Once the board arrived, I connected it to my router via LAN cable, but I cannot see any IP address on the A2V3 screen, nor can I find it on my network.<br />
<br />
For this reason, I tried to reflash the KCS v3 firmware using ESP32 Download Tool V3.9.2 and entering download mode (turn off → press S2 button → turn on power → release S2).<br />
However, when I press "start" on the ESP32 Download Tool, I get this error:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>1 kill<br />
test offset :  0 0x0<br />
case ok<br />
test offset :  0 0x0<br />
case ok<br />
<br />
Uploading stub...<br />
Running stub...<br />
[2025-07-12 09:22:45,885][ESP8266Loader_spi[1]][espDownloader.py][line:586][ERROR]: ESP32 Chip stub error esp_stub_and_set_baud.<br />
no log file output ...</code></div></div><br />
I already tested it with different USB cable, different PC and different power supply. But getting always same error.<br />
<br />
Here a screenshot from ESP32 Download Tool V3.9.2:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7971" target="_blank" title="">Screenshot 2025-07-12 092304.png</a> (Size: 63.1 KB / Downloads: 670)
<!-- end: postbit_attachments_attachment --> <br />
<br />
<br />
Can you please help me debugging this issue?<br />
<br />
regards,<br />
Stefano]]></description>
			<content:encoded><![CDATA[Hi everyone, I'm new to Kincony products and this forum. I recently bought a Kincony A2V3.1 board to test these products and their integration with Home Assistant.<br />
Once the board arrived, I connected it to my router via LAN cable, but I cannot see any IP address on the A2V3 screen, nor can I find it on my network.<br />
<br />
For this reason, I tried to reflash the KCS v3 firmware using ESP32 Download Tool V3.9.2 and entering download mode (turn off → press S2 button → turn on power → release S2).<br />
However, when I press "start" on the ESP32 Download Tool, I get this error:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>1 kill<br />
test offset :  0 0x0<br />
case ok<br />
test offset :  0 0x0<br />
case ok<br />
<br />
Uploading stub...<br />
Running stub...<br />
[2025-07-12 09:22:45,885][ESP8266Loader_spi[1]][espDownloader.py][line:586][ERROR]: ESP32 Chip stub error esp_stub_and_set_baud.<br />
no log file output ...</code></div></div><br />
I already tested it with different USB cable, different PC and different power supply. But getting always same error.<br />
<br />
Here a screenshot from ESP32 Download Tool V3.9.2:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7971" target="_blank" title="">Screenshot 2025-07-12 092304.png</a> (Size: 63.1 KB / Downloads: 670)
<!-- end: postbit_attachments_attachment --> <br />
<br />
<br />
Can you please help me debugging this issue?<br />
<br />
regards,<br />
Stefano]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-11 Digital input trigger relay output]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7969</link>
			<pubDate>Sun, 20 Apr 2025 14:07:04 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7969</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Example to control relays based on digital input states using ESP32<br />
 * @details This program reads the states of two digital inputs (GPIO16, GPIO17)<br />
 *          and controls two relays (GPIO40, GPIO39) accordingly.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for digital inputs<br />
#define INPUT1_PIN 16  // GPIO16 for Digital Input 1<br />
#define INPUT2_PIN 17  // GPIO17 for Digital Input 2<br />
<br />
// Define the GPIO pins for relays<br />
#define RELAY1_PIN 40  // GPIO40 for Relay 1<br />
#define RELAY2_PIN 39  // GPIO39 for Relay 2<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Input-Controlled Relay Example");<br />
<br />
    // Set the input pins as INPUT<br />
    pinMode(INPUT1_PIN, INPUT);<br />
    pinMode(INPUT2_PIN, INPUT);<br />
<br />
    // Set the relay pins as OUTPUT<br />
    pinMode(RELAY1_PIN, OUTPUT);<br />
    pinMode(RELAY2_PIN, OUTPUT);<br />
<br />
    // Turn off both relays at startup (assuming active LOW relays)<br />
    digitalWrite(RELAY1_PIN, HIGH);<br />
    digitalWrite(RELAY2_PIN, HIGH);<br />
}<br />
<br />
void loop() {<br />
    // Read the state of the digital inputs<br />
    int state1 = digitalRead(INPUT1_PIN);<br />
    int state2 = digitalRead(INPUT2_PIN);<br />
<br />
    // Control the relays based on input states<br />
    digitalWrite(RELAY1_PIN, state1 == HIGH ? LOW : HIGH); // Activate relay if input is HIGH<br />
    digitalWrite(RELAY2_PIN, state2 == HIGH ? LOW : HIGH); // Activate relay if input is HIGH<br />
<br />
    // Print the states to the Serial Monitor<br />
    Serial.print("Digital Input 1 State: ");<br />
    Serial.println(state1);<br />
    Serial.print("Digital Input 2 State: ");<br />
    Serial.println(state2);<br />
<br />
    // Wait for 100 milliseconds before reading again<br />
    delay(100);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7470" target="_blank" title="">11-input-trigger-output.zip</a> (Size: 866 bytes / Downloads: 484)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7471" target="_blank" title="">11-input-trigger-output.ino.merged.zip</a> (Size: 179.47 KB / Downloads: 447)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Example to control relays based on digital input states using ESP32<br />
 * @details This program reads the states of two digital inputs (GPIO16, GPIO17)<br />
 *          and controls two relays (GPIO40, GPIO39) accordingly.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for digital inputs<br />
#define INPUT1_PIN 16  // GPIO16 for Digital Input 1<br />
#define INPUT2_PIN 17  // GPIO17 for Digital Input 2<br />
<br />
// Define the GPIO pins for relays<br />
#define RELAY1_PIN 40  // GPIO40 for Relay 1<br />
#define RELAY2_PIN 39  // GPIO39 for Relay 2<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Input-Controlled Relay Example");<br />
<br />
    // Set the input pins as INPUT<br />
    pinMode(INPUT1_PIN, INPUT);<br />
    pinMode(INPUT2_PIN, INPUT);<br />
<br />
    // Set the relay pins as OUTPUT<br />
    pinMode(RELAY1_PIN, OUTPUT);<br />
    pinMode(RELAY2_PIN, OUTPUT);<br />
<br />
    // Turn off both relays at startup (assuming active LOW relays)<br />
    digitalWrite(RELAY1_PIN, HIGH);<br />
    digitalWrite(RELAY2_PIN, HIGH);<br />
}<br />
<br />
void loop() {<br />
    // Read the state of the digital inputs<br />
    int state1 = digitalRead(INPUT1_PIN);<br />
    int state2 = digitalRead(INPUT2_PIN);<br />
<br />
    // Control the relays based on input states<br />
    digitalWrite(RELAY1_PIN, state1 == HIGH ? LOW : HIGH); // Activate relay if input is HIGH<br />
    digitalWrite(RELAY2_PIN, state2 == HIGH ? LOW : HIGH); // Activate relay if input is HIGH<br />
<br />
    // Print the states to the Serial Monitor<br />
    Serial.print("Digital Input 1 State: ");<br />
    Serial.println(state1);<br />
    Serial.print("Digital Input 2 State: ");<br />
    Serial.println(state2);<br />
<br />
    // Wait for 100 milliseconds before reading again<br />
    delay(100);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7470" target="_blank" title="">11-input-trigger-output.zip</a> (Size: 866 bytes / Downloads: 484)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7471" target="_blank" title="">11-input-trigger-output.ino.merged.zip</a> (Size: 179.47 KB / Downloads: 447)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-10 Print TEXT on SSD1306 OLED displayer]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7968</link>
			<pubDate>Sun, 20 Apr 2025 14:04:08 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7968</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 * <br />
 * This Arduino program demonstrates how to display text on an SSD1306 128x64 OLED display using the U8g2 library.<br />
 * The program draws two lines of text on the display:<br />
 * - The first line is "KINCONY" in a larger font.<br />
 * - The second line is "www.kincony.com" in a smaller font.<br />
 * <br />
 * The display is connected via I2C (software implementation) with:<br />
 * - SCL (clock) on pin IO47<br />
 * - SDA (data) on pin IO48<br />
 * <br />
 * The display's I2C address is set to 0x3C.<br />
 */<br />
<br />
#include &lt;U8g2lib.h&gt;  // Include the U8g2 library for controlling the OLED display<br />
#include &lt;Wire.h&gt;   &nbsp;&nbsp;// Include the Wire library for I2C communication<br />
<br />
// Initialize the display using the software I2C method (SCL = IO47, SDA = IO48)<br />
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  47, 48, U8X8_PIN_NONE);  // Screen rotation: U8G2_R0<br />
<br />
// Function to display page 1 content<br />
void page1() {<br />
  // Set font size 18 for the larger "KINCONY" text<br />
  u8g2.setFont(u8g2_font_timR18_tf);  // Use the Times Roman font, size 18<br />
  u8g2.setFontPosTop();             &nbsp;&nbsp;// Set the text position at the top of the display<br />
  u8g2.setCursor(5, 0);             &nbsp;&nbsp;// Position the cursor at coordinates (5, 0)<br />
  u8g2.print("KINCONY");              // Display the text "KINCONY" on the screen<br />
<br />
  // Set font size 12 for the smaller "www.kincony.com" text<br />
  u8g2.setFont(u8g2_font_timR12_tf);  // Use the Times Roman font, size 12<br />
  u8g2.setCursor(0, 40);              // Position the cursor at coordinates (0, 40)<br />
  u8g2.print("www.kincony.com");      // Display the text "www.kincony.com"<br />
}<br />
<br />
// Setup function, runs once when the program starts<br />
void setup() {<br />
  // Set the I2C address for the display to 0x3C<br />
  u8g2.setI2CAddress(0x3C*2);  // I2C address shift for 8-bit format<br />
  <br />
  // Initialize the display<br />
  u8g2.begin();<br />
  <br />
  // Enable UTF-8 character printing for the display<br />
  u8g2.enableUTF8Print();  // Allow UTF-8 encoded text to be printed<br />
}<br />
<br />
// Main loop function, continuously runs after setup()<br />
void loop() {<br />
  // Begin the display drawing process<br />
  u8g2.firstPage();  // Prepare the first page for drawing<br />
  do {<br />
    // Call the page1() function to draw content on the display<br />
    page1();<br />
  } while (u8g2.nextPage());  // Continue to the next page until all pages are drawn<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7468" target="_blank" title="">10-oled-ssd1306.zip</a> (Size: 1.12 KB / Downloads: 463)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7469" target="_blank" title="">10-oled-ssd1306.ino.merged.zip</a> (Size: 201.24 KB / Downloads: 447)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 * <br />
 * This Arduino program demonstrates how to display text on an SSD1306 128x64 OLED display using the U8g2 library.<br />
 * The program draws two lines of text on the display:<br />
 * - The first line is "KINCONY" in a larger font.<br />
 * - The second line is "www.kincony.com" in a smaller font.<br />
 * <br />
 * The display is connected via I2C (software implementation) with:<br />
 * - SCL (clock) on pin IO47<br />
 * - SDA (data) on pin IO48<br />
 * <br />
 * The display's I2C address is set to 0x3C.<br />
 */<br />
<br />
#include &lt;U8g2lib.h&gt;  // Include the U8g2 library for controlling the OLED display<br />
#include &lt;Wire.h&gt;   &nbsp;&nbsp;// Include the Wire library for I2C communication<br />
<br />
// Initialize the display using the software I2C method (SCL = IO47, SDA = IO48)<br />
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  47, 48, U8X8_PIN_NONE);  // Screen rotation: U8G2_R0<br />
<br />
// Function to display page 1 content<br />
void page1() {<br />
  // Set font size 18 for the larger "KINCONY" text<br />
  u8g2.setFont(u8g2_font_timR18_tf);  // Use the Times Roman font, size 18<br />
  u8g2.setFontPosTop();             &nbsp;&nbsp;// Set the text position at the top of the display<br />
  u8g2.setCursor(5, 0);             &nbsp;&nbsp;// Position the cursor at coordinates (5, 0)<br />
  u8g2.print("KINCONY");              // Display the text "KINCONY" on the screen<br />
<br />
  // Set font size 12 for the smaller "www.kincony.com" text<br />
  u8g2.setFont(u8g2_font_timR12_tf);  // Use the Times Roman font, size 12<br />
  u8g2.setCursor(0, 40);              // Position the cursor at coordinates (0, 40)<br />
  u8g2.print("www.kincony.com");      // Display the text "www.kincony.com"<br />
}<br />
<br />
// Setup function, runs once when the program starts<br />
void setup() {<br />
  // Set the I2C address for the display to 0x3C<br />
  u8g2.setI2CAddress(0x3C*2);  // I2C address shift for 8-bit format<br />
  <br />
  // Initialize the display<br />
  u8g2.begin();<br />
  <br />
  // Enable UTF-8 character printing for the display<br />
  u8g2.enableUTF8Print();  // Allow UTF-8 encoded text to be printed<br />
}<br />
<br />
// Main loop function, continuously runs after setup()<br />
void loop() {<br />
  // Begin the display drawing process<br />
  u8g2.firstPage();  // Prepare the first page for drawing<br />
  do {<br />
    // Call the page1() function to draw content on the display<br />
    page1();<br />
  } while (u8g2.nextPage());  // Continue to the next page until all pages are drawn<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7468" target="_blank" title="">10-oled-ssd1306.zip</a> (Size: 1.12 KB / Downloads: 463)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7469" target="_blank" title="">10-oled-ssd1306.ino.merged.zip</a> (Size: 201.24 KB / Downloads: 447)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-08 Ethernet W5500 chip work with TCP Server mode]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7966</link>
			<pubDate>Sun, 20 Apr 2025 14:01:46 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7966</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This Arduino program sets up an ESP32-S3 with a W5500 Ethernet module<br />
 * as a TCP server. It listens on port 4196 and echoes back any string <br />
 * received from a client.<br />
 *<br />
 * Hardware connections:<br />
 * - CLK: GPIO42<br />
 * - MOSI: GPIO43<br />
 * - MISO: GPIO44<br />
 * - CS: GPIO41<br />
 * - RST: GPIO1<br />
 * - INT: GPIO2<br />
 *<br />
 * Static IP address: 192.168.3.55<br />
 * Subnet Mask: 255.255.255.0<br />
 * Gateway: 192.168.3.1<br />
 * DNS: 192.168.3.1<br />
 */<br />
<br />
#include &lt;SPI.h&gt;<br />
#include &lt;Ethernet.h&gt;<br />
<br />
// Define the W5500 Ethernet module pins<br />
#define W5500_CS_PIN  41<br />
#define W5500_RST_PIN 1<br />
#define W5500_INT_PIN 2<br />
#define W5500_CLK_PIN 42<br />
#define W5500_MOSI_PIN 43<br />
#define W5500_MISO_PIN 44<br />
<br />
// MAC address for your Ethernet shield (must be unique on your network)<br />
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };<br />
<br />
// Static IP address configuration<br />
IPAddress ip(192, 168, 3, 55);     &nbsp;&nbsp;// Static IP address<br />
IPAddress subnet(255, 255, 255, 0); &nbsp;&nbsp;// Subnet mask<br />
IPAddress gateway(192, 168, 3, 1);    // Default gateway<br />
IPAddress dns(192, 168, 3, 1);        // DNS server address<br />
<br />
// Create an EthernetServer object to handle TCP connections<br />
EthernetServer server(4196);<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  while (!Serial) {<br />
    ; // Wait for serial port to connect<br />
  }<br />
<br />
  // Initialize the W5500 module<br />
  pinMode(W5500_RST_PIN, OUTPUT);<br />
  pinMode(W5500_INT_PIN, INPUT);<br />
  digitalWrite(W5500_RST_PIN, LOW);  // Reset the W5500 module<br />
  delay(100);                     &nbsp;&nbsp;// Wait for reset to complete<br />
  digitalWrite(W5500_RST_PIN, HIGH); // Release reset<br />
<br />
  // Initialize SPI with the correct pin definitions<br />
  SPI.begin(W5500_CLK_PIN, W5500_MISO_PIN, W5500_MOSI_PIN);<br />
<br />
  // Set up the Ethernet library with W5500-specific pins<br />
  Ethernet.init(W5500_CS_PIN);<br />
<br />
  // Start the Ethernet connection with static IP configuration<br />
  Ethernet.begin(mac, ip, dns, gateway, subnet);<br />
<br />
  // Print the IP address to the serial monitor<br />
  Serial.print("IP Address: ");<br />
  Serial.println(Ethernet.localIP());<br />
<br />
  // Start listening for incoming TCP connections<br />
  server.begin();<br />
}<br />
<br />
void loop() {<br />
  // Check for incoming client connections<br />
  EthernetClient client = server.available();<br />
  if (client) {<br />
    Serial.println("New client connected");<br />
<br />
    // Read data from the client and echo it back<br />
    while (client.connected()) {<br />
      if (client.available()) {<br />
        char c = client.read();<br />
        server.write(c);<br />
      }<br />
    }<br />
<br />
    // Close the connection when done<br />
    client.stop();<br />
    Serial.println("Client disconnected");<br />
  }<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7466" target="_blank" title="">8-Ethernet-W5500.zip</a> (Size: 1.23 KB / Downloads: 470)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7467" target="_blank" title="">8-Ethernet-W5500.ino.merged.zip</a> (Size: 188.93 KB / Downloads: 451)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This Arduino program sets up an ESP32-S3 with a W5500 Ethernet module<br />
 * as a TCP server. It listens on port 4196 and echoes back any string <br />
 * received from a client.<br />
 *<br />
 * Hardware connections:<br />
 * - CLK: GPIO42<br />
 * - MOSI: GPIO43<br />
 * - MISO: GPIO44<br />
 * - CS: GPIO41<br />
 * - RST: GPIO1<br />
 * - INT: GPIO2<br />
 *<br />
 * Static IP address: 192.168.3.55<br />
 * Subnet Mask: 255.255.255.0<br />
 * Gateway: 192.168.3.1<br />
 * DNS: 192.168.3.1<br />
 */<br />
<br />
#include &lt;SPI.h&gt;<br />
#include &lt;Ethernet.h&gt;<br />
<br />
// Define the W5500 Ethernet module pins<br />
#define W5500_CS_PIN  41<br />
#define W5500_RST_PIN 1<br />
#define W5500_INT_PIN 2<br />
#define W5500_CLK_PIN 42<br />
#define W5500_MOSI_PIN 43<br />
#define W5500_MISO_PIN 44<br />
<br />
// MAC address for your Ethernet shield (must be unique on your network)<br />
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };<br />
<br />
// Static IP address configuration<br />
IPAddress ip(192, 168, 3, 55);     &nbsp;&nbsp;// Static IP address<br />
IPAddress subnet(255, 255, 255, 0); &nbsp;&nbsp;// Subnet mask<br />
IPAddress gateway(192, 168, 3, 1);    // Default gateway<br />
IPAddress dns(192, 168, 3, 1);        // DNS server address<br />
<br />
// Create an EthernetServer object to handle TCP connections<br />
EthernetServer server(4196);<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  while (!Serial) {<br />
    ; // Wait for serial port to connect<br />
  }<br />
<br />
  // Initialize the W5500 module<br />
  pinMode(W5500_RST_PIN, OUTPUT);<br />
  pinMode(W5500_INT_PIN, INPUT);<br />
  digitalWrite(W5500_RST_PIN, LOW);  // Reset the W5500 module<br />
  delay(100);                     &nbsp;&nbsp;// Wait for reset to complete<br />
  digitalWrite(W5500_RST_PIN, HIGH); // Release reset<br />
<br />
  // Initialize SPI with the correct pin definitions<br />
  SPI.begin(W5500_CLK_PIN, W5500_MISO_PIN, W5500_MOSI_PIN);<br />
<br />
  // Set up the Ethernet library with W5500-specific pins<br />
  Ethernet.init(W5500_CS_PIN);<br />
<br />
  // Start the Ethernet connection with static IP configuration<br />
  Ethernet.begin(mac, ip, dns, gateway, subnet);<br />
<br />
  // Print the IP address to the serial monitor<br />
  Serial.print("IP Address: ");<br />
  Serial.println(Ethernet.localIP());<br />
<br />
  // Start listening for incoming TCP connections<br />
  server.begin();<br />
}<br />
<br />
void loop() {<br />
  // Check for incoming client connections<br />
  EthernetClient client = server.available();<br />
  if (client) {<br />
    Serial.println("New client connected");<br />
<br />
    // Read data from the client and echo it back<br />
    while (client.connected()) {<br />
      if (client.available()) {<br />
        char c = client.read();<br />
        server.write(c);<br />
      }<br />
    }<br />
<br />
    // Close the connection when done<br />
    client.stop();<br />
    Serial.println("Client disconnected");<br />
  }<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7466" target="_blank" title="">8-Ethernet-W5500.zip</a> (Size: 1.23 KB / Downloads: 470)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7467" target="_blank" title="">8-Ethernet-W5500.ino.merged.zip</a> (Size: 188.93 KB / Downloads: 451)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-07 how to DS3231 RTC clock]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7965</link>
			<pubDate>Sun, 20 Apr 2025 14:00:17 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7965</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * DS3231 RTC with Arduino<br />
 *<br />
 * This program demonstrates how to use the DS3231 RTC (Real-Time Clock) module with the Arduino.<br />
 * It includes functionality to:<br />
 * - Initialize the DS3231 RTC module<br />
 * - Read the current date and time from the RTC<br />
 * - Set the RTC time based on a serial command:Command format: DYYYY-MM-DDTHH:MM:SS<br />
*    Set date and time command example: D2024-09-19T11:50:22<br />
*    print current date and time command: current time<br />
*<br />
 *<br />
 * Hardware Connections:<br />
 * - SDA: GPIO 48<br />
 * - SCL: GPIO 47<br />
 */<br />
<br />
#include &lt;DS3231.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
String serial_cmd_rcv = ""; // Serial port receiver<br />
<br />
typedef struct<br />
{<br />
  byte year;    // Last two digits of the year, library adds 2000.<br />
  byte month;<br />
  byte day;<br />
  byte hour;<br />
  byte minute;<br />
  byte second;<br />
} MY_DATE_STR;<br />
<br />
MY_DATE_STR my_date_str = {0};<br />
<br />
// Define constants for relay control<br />
#define OPEN_RLY_DATA    26<br />
#define OPEN_RLY_MONTH &nbsp;&nbsp;4<br />
#define CLOSE_RLY_DATA &nbsp;&nbsp;2<br />
#define CLOSE_RLY_MONTH  5<br />
<br />
// Define pin connections<br />
#define SDA_PIN &nbsp;&nbsp;48<br />
#define SCL_PIN &nbsp;&nbsp;47<br />
<br />
DS3231 rtc; // Create an instance of the DS3231 RTC<br />
bool h12Flag;<br />
bool pmFlag;<br />
static bool bCentury = false;<br />
static bool old_level_high = false;<br />
static bool old_level_low = false;<br />
<br />
<br />
/**<br />
 * @brief Print the current time from the RTC to the Serial Monitor.<br />
 */<br />
static void PrintfCurTime()<br />
{<br />
  Serial.print("Current time is: ");<br />
  int year = rtc.getYear() + 2000;<br />
  Serial.print(year);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getMonth(bCentury), DEC);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getDate(), DEC);<br />
  Serial.print(" ");<br />
<br />
  Serial.print(rtc.getHour(h12Flag, pmFlag), DEC);<br />
  Serial.print(":");<br />
  Serial.print(rtc.getMinute(), DEC);<br />
  Serial.print(":");<br />
  Serial.println(rtc.getSecond(), DEC);<br />
}<br />
<br />
/**<br />
 * @brief Process serial commands to set the RTC time.<br />
 * Command format: DYYYY-MM-DDTHH:MM:SS<br />
 */<br />
static void GetSerialCmd()<br />
{<br />
  if (Serial.available() &gt; 0)<br />
  {<br />
    delay(100);<br />
    int num_read = Serial.available();<br />
    while (num_read--)<br />
      serial_cmd_rcv += char(Serial.read());<br />
  }<br />
  else return;<br />
<br />
  serial_cmd_rcv.trim();<br />
<br />
  if (serial_cmd_rcv == "current time")<br />
  {<br />
    PrintfCurTime();<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.print("Received length: ");<br />
  Serial.println(serial_cmd_rcv.length());<br />
<br />
  int indexof_d = serial_cmd_rcv.indexOf('D');<br />
  int indexof_t = serial_cmd_rcv.indexOf('T');<br />
<br />
  Serial.print("D index: ");<br />
  Serial.print(indexof_d);<br />
  Serial.print(" T index: ");<br />
  Serial.println(indexof_t);<br />
<br />
  if (serial_cmd_rcv.length() != 20 || <br />
      serial_cmd_rcv.substring(0, 1) != "D" ||<br />
      serial_cmd_rcv.substring(11, 12) != "T")  <br />
  {<br />
    Serial.println(serial_cmd_rcv);<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.println("Setting time...");<br />
<br />
  my_date_str.year = (byte)serial_cmd_rcv.substring(3, 5).toInt();<br />
  my_date_str.month = (byte)serial_cmd_rcv.substring(6, 8).toInt();<br />
  my_date_str.day = (byte)serial_cmd_rcv.substring(9, 11).toInt();<br />
  my_date_str.hour = (byte)serial_cmd_rcv.substring(12, 14).toInt();<br />
  my_date_str.minute = (byte)serial_cmd_rcv.substring(15, 17).toInt();<br />
  my_date_str.second = (byte)serial_cmd_rcv.substring(18).toInt();<br />
<br />
  rtc.setYear(my_date_str.year);<br />
  rtc.setMonth(my_date_str.month);<br />
  rtc.setDate(my_date_str.day);<br />
  rtc.setHour(my_date_str.hour);<br />
  rtc.setMinute(my_date_str.minute);<br />
  rtc.setSecond(my_date_str.second);<br />
<br />
  serial_cmd_rcv = "";<br />
<br />
  Serial.println("Time set.");<br />
}<br />
<br />
void setup() {<br />
  // Initialize the I2C interface<br />
  Wire.begin(SDA_PIN, SCL_PIN, 40000);<br />
  <br />
  // Initialize Serial communication<br />
  Serial.begin(115200);<br />
  // Set the RTC to 24-hour mode<br />
  rtc.setClockMode(false); // 24-hour format<br />
<br />
  // Print current time to Serial Monitor<br />
  PrintfCurTime();<br />
<br />
  // Clear any remaining serial data<br />
  while (Serial.read() &gt;= 0) {}<br />
}<br />
<br />
void loop() {<br />
  // Process incoming serial commands<br />
  GetSerialCmd(); <br />
  delay(1000); // Delay for 1 second<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7464" target="_blank" title="">7-DS3231-RTC.zip</a> (Size: 1.56 KB / Downloads: 465)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7465" target="_blank" title="">7-DS3231-RTC.ino.merged.zip</a> (Size: 191.09 KB / Downloads: 454)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * DS3231 RTC with Arduino<br />
 *<br />
 * This program demonstrates how to use the DS3231 RTC (Real-Time Clock) module with the Arduino.<br />
 * It includes functionality to:<br />
 * - Initialize the DS3231 RTC module<br />
 * - Read the current date and time from the RTC<br />
 * - Set the RTC time based on a serial command:Command format: DYYYY-MM-DDTHH:MM:SS<br />
*    Set date and time command example: D2024-09-19T11:50:22<br />
*    print current date and time command: current time<br />
*<br />
 *<br />
 * Hardware Connections:<br />
 * - SDA: GPIO 48<br />
 * - SCL: GPIO 47<br />
 */<br />
<br />
#include &lt;DS3231.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
String serial_cmd_rcv = ""; // Serial port receiver<br />
<br />
typedef struct<br />
{<br />
  byte year;    // Last two digits of the year, library adds 2000.<br />
  byte month;<br />
  byte day;<br />
  byte hour;<br />
  byte minute;<br />
  byte second;<br />
} MY_DATE_STR;<br />
<br />
MY_DATE_STR my_date_str = {0};<br />
<br />
// Define constants for relay control<br />
#define OPEN_RLY_DATA    26<br />
#define OPEN_RLY_MONTH &nbsp;&nbsp;4<br />
#define CLOSE_RLY_DATA &nbsp;&nbsp;2<br />
#define CLOSE_RLY_MONTH  5<br />
<br />
// Define pin connections<br />
#define SDA_PIN &nbsp;&nbsp;48<br />
#define SCL_PIN &nbsp;&nbsp;47<br />
<br />
DS3231 rtc; // Create an instance of the DS3231 RTC<br />
bool h12Flag;<br />
bool pmFlag;<br />
static bool bCentury = false;<br />
static bool old_level_high = false;<br />
static bool old_level_low = false;<br />
<br />
<br />
/**<br />
 * @brief Print the current time from the RTC to the Serial Monitor.<br />
 */<br />
static void PrintfCurTime()<br />
{<br />
  Serial.print("Current time is: ");<br />
  int year = rtc.getYear() + 2000;<br />
  Serial.print(year);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getMonth(bCentury), DEC);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getDate(), DEC);<br />
  Serial.print(" ");<br />
<br />
  Serial.print(rtc.getHour(h12Flag, pmFlag), DEC);<br />
  Serial.print(":");<br />
  Serial.print(rtc.getMinute(), DEC);<br />
  Serial.print(":");<br />
  Serial.println(rtc.getSecond(), DEC);<br />
}<br />
<br />
/**<br />
 * @brief Process serial commands to set the RTC time.<br />
 * Command format: DYYYY-MM-DDTHH:MM:SS<br />
 */<br />
static void GetSerialCmd()<br />
{<br />
  if (Serial.available() &gt; 0)<br />
  {<br />
    delay(100);<br />
    int num_read = Serial.available();<br />
    while (num_read--)<br />
      serial_cmd_rcv += char(Serial.read());<br />
  }<br />
  else return;<br />
<br />
  serial_cmd_rcv.trim();<br />
<br />
  if (serial_cmd_rcv == "current time")<br />
  {<br />
    PrintfCurTime();<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.print("Received length: ");<br />
  Serial.println(serial_cmd_rcv.length());<br />
<br />
  int indexof_d = serial_cmd_rcv.indexOf('D');<br />
  int indexof_t = serial_cmd_rcv.indexOf('T');<br />
<br />
  Serial.print("D index: ");<br />
  Serial.print(indexof_d);<br />
  Serial.print(" T index: ");<br />
  Serial.println(indexof_t);<br />
<br />
  if (serial_cmd_rcv.length() != 20 || <br />
      serial_cmd_rcv.substring(0, 1) != "D" ||<br />
      serial_cmd_rcv.substring(11, 12) != "T")  <br />
  {<br />
    Serial.println(serial_cmd_rcv);<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.println("Setting time...");<br />
<br />
  my_date_str.year = (byte)serial_cmd_rcv.substring(3, 5).toInt();<br />
  my_date_str.month = (byte)serial_cmd_rcv.substring(6, 8).toInt();<br />
  my_date_str.day = (byte)serial_cmd_rcv.substring(9, 11).toInt();<br />
  my_date_str.hour = (byte)serial_cmd_rcv.substring(12, 14).toInt();<br />
  my_date_str.minute = (byte)serial_cmd_rcv.substring(15, 17).toInt();<br />
  my_date_str.second = (byte)serial_cmd_rcv.substring(18).toInt();<br />
<br />
  rtc.setYear(my_date_str.year);<br />
  rtc.setMonth(my_date_str.month);<br />
  rtc.setDate(my_date_str.day);<br />
  rtc.setHour(my_date_str.hour);<br />
  rtc.setMinute(my_date_str.minute);<br />
  rtc.setSecond(my_date_str.second);<br />
<br />
  serial_cmd_rcv = "";<br />
<br />
  Serial.println("Time set.");<br />
}<br />
<br />
void setup() {<br />
  // Initialize the I2C interface<br />
  Wire.begin(SDA_PIN, SCL_PIN, 40000);<br />
  <br />
  // Initialize Serial communication<br />
  Serial.begin(115200);<br />
  // Set the RTC to 24-hour mode<br />
  rtc.setClockMode(false); // 24-hour format<br />
<br />
  // Print current time to Serial Monitor<br />
  PrintfCurTime();<br />
<br />
  // Clear any remaining serial data<br />
  while (Serial.read() &gt;= 0) {}<br />
}<br />
<br />
void loop() {<br />
  // Process incoming serial commands<br />
  GetSerialCmd(); <br />
  delay(1000); // Delay for 1 second<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7464" target="_blank" title="">7-DS3231-RTC.zip</a> (Size: 1.56 KB / Downloads: 465)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7465" target="_blank" title="">7-DS3231-RTC.ino.merged.zip</a> (Size: 191.09 KB / Downloads: 454)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-06 How to use SD Card]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7964</link>
			<pubDate>Sun, 20 Apr 2025 13:58:47 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7964</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * SD Card File Operations<br />
 *<br />
 * This program demonstrates basic file operations on an SD card using the ESP32.<br />
 * It includes functionality to:<br />
 * - Initialize and test the SD card<br />
 * - Read from, write to, append to, and delete files on the SD card<br />
 * - Measure file read and write performance<br />
 *<br />
 * Hardware Connections:<br />
 * - SCK: GPIO 13<br />
 * - MISO: GPIO 14<br />
 * - MOSI: GPIO 12<br />
 * - CS: GPIO 11<br />
 */<br />
<br />
#include "FS.h"<br />
#include "SD.h"<br />
#include "SPI.h"<br />
<br />
// Pin definitions for SD card<br />
#define SCK  13<br />
#define MISO 14<br />
#define MOSI 12<br />
#define CS &nbsp;&nbsp;11<br />
<br />
/**<br />
 * @brief Reads the contents of a file from the SD card and prints it to the serial monitor.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to read.<br />
 */<br />
void readFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Reading file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for reading");<br />
    return;<br />
  }<br />
<br />
  Serial.print("Read from file: ");<br />
  while (file.available()) {<br />
    Serial.print((char)file.read());<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Writes a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to write.<br />
 * @param message Message to write to the file.<br />
 */<br />
void writeFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Writing file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("File written");<br />
  } else {<br />
    Serial.println("Write failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Appends a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to append.<br />
 * @param message Message to append to the file.<br />
 */<br />
void appendFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Appending to file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_APPEND);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for appending");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("Message appended");<br />
  } else {<br />
    Serial.println("Append failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Deletes a file from the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to delete.<br />
 */<br />
void deleteFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Deleting file: %s&#92;n", path);<br />
  if (fs.remove(path)) {<br />
    Serial.println("File deleted");<br />
  } else {<br />
    Serial.println("Delete failed");<br />
  }<br />
}<br />
<br />
/**<br />
 * @brief Tests file read and write performance.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to test.<br />
 */<br />
void testFileIO(fs::FS &amp;fs, const char * path) {<br />
  File file = fs.open(path);<br />
  static uint8_t buf[512];<br />
  size_t len = 0;<br />
  uint32_t start = millis();<br />
  uint32_t end = start;<br />
<br />
  if (file) {<br />
    len = file.size();<br />
    size_t flen = len;<br />
    start = millis();<br />
    while (len) {<br />
      size_t toRead = len;<br />
      if (toRead &gt; 512) {<br />
        toRead = 512;<br />
      }<br />
      file.read(buf, toRead);<br />
      len -= toRead;<br />
    }<br />
    end = millis() - start;<br />
    Serial.printf("%u bytes read for %u ms&#92;n", flen, end);<br />
    file.close();<br />
  } else {<br />
    Serial.println("Failed to open file for reading");<br />
  }<br />
<br />
  file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
<br />
  size_t i;<br />
  start = millis();<br />
  for (i = 0; i &lt; 2048; i++) {<br />
    file.write(buf, 512);<br />
  }<br />
  end = millis() - start;<br />
  Serial.printf("%u bytes written for %u ms&#92;n", 2048 * 512, end);<br />
  file.close();<br />
}<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  <br />
  // Initialize SPI and SD card<br />
  SPIClass spi = SPIClass(HSPI);<br />
  spi.begin(SCK, MISO, MOSI, CS);<br />
<br />
  if (!SD.begin(CS, spi, 80000000)) {<br />
    Serial.println("Card Mount Failed");<br />
    return;<br />
  }<br />
<br />
  uint8_t cardType = SD.cardType();<br />
<br />
  if (cardType == CARD_NONE) {<br />
    Serial.println("No SD card attached");<br />
    return;<br />
  }<br />
<br />
  Serial.print("SD Card Type: ");<br />
  if (cardType == CARD_MMC) {<br />
    Serial.println("MMC");<br />
  } else if (cardType == CARD_SD) {<br />
    Serial.println("SDSC");<br />
  } else if (cardType == CARD_SDHC) {<br />
    Serial.println("SDHC");<br />
  } else {<br />
    Serial.println("UNKNOWN");<br />
  }<br />
<br />
  uint64_t cardSize = SD.cardSize() / (1024 * 1024);<br />
  Serial.printf("SD Card Size: %lluMB&#92;n", cardSize);<br />
  delay(2000);<br />
<br />
  // Perform file operations<br />
  deleteFile(SD, "/hello.txt");<br />
  writeFile(SD, "/hello.txt", "Hello ");<br />
  appendFile(SD, "/hello.txt", "World!&#92;n");<br />
  readFile(SD, "/hello.txt");<br />
  testFileIO(SD, "/test.txt");<br />
  Serial.printf("Total space: %lluMB&#92;n", SD.totalBytes() / (1024 * 1024));<br />
  Serial.printf("Used space: %lluMB&#92;n", SD.usedBytes() / (1024 * 1024));<br />
}<br />
<br />
void loop() {<br />
  // No operation in loop<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7462" target="_blank" title="">6-SD.zip</a> (Size: 1.53 KB / Downloads: 446)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7463" target="_blank" title="">6-SD.ino.merged.zip</a> (Size: 221.25 KB / Downloads: 413)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * SD Card File Operations<br />
 *<br />
 * This program demonstrates basic file operations on an SD card using the ESP32.<br />
 * It includes functionality to:<br />
 * - Initialize and test the SD card<br />
 * - Read from, write to, append to, and delete files on the SD card<br />
 * - Measure file read and write performance<br />
 *<br />
 * Hardware Connections:<br />
 * - SCK: GPIO 13<br />
 * - MISO: GPIO 14<br />
 * - MOSI: GPIO 12<br />
 * - CS: GPIO 11<br />
 */<br />
<br />
#include "FS.h"<br />
#include "SD.h"<br />
#include "SPI.h"<br />
<br />
// Pin definitions for SD card<br />
#define SCK  13<br />
#define MISO 14<br />
#define MOSI 12<br />
#define CS &nbsp;&nbsp;11<br />
<br />
/**<br />
 * @brief Reads the contents of a file from the SD card and prints it to the serial monitor.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to read.<br />
 */<br />
void readFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Reading file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for reading");<br />
    return;<br />
  }<br />
<br />
  Serial.print("Read from file: ");<br />
  while (file.available()) {<br />
    Serial.print((char)file.read());<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Writes a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to write.<br />
 * @param message Message to write to the file.<br />
 */<br />
void writeFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Writing file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("File written");<br />
  } else {<br />
    Serial.println("Write failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Appends a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to append.<br />
 * @param message Message to append to the file.<br />
 */<br />
void appendFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Appending to file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_APPEND);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for appending");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("Message appended");<br />
  } else {<br />
    Serial.println("Append failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Deletes a file from the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to delete.<br />
 */<br />
void deleteFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Deleting file: %s&#92;n", path);<br />
  if (fs.remove(path)) {<br />
    Serial.println("File deleted");<br />
  } else {<br />
    Serial.println("Delete failed");<br />
  }<br />
}<br />
<br />
/**<br />
 * @brief Tests file read and write performance.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to test.<br />
 */<br />
void testFileIO(fs::FS &amp;fs, const char * path) {<br />
  File file = fs.open(path);<br />
  static uint8_t buf[512];<br />
  size_t len = 0;<br />
  uint32_t start = millis();<br />
  uint32_t end = start;<br />
<br />
  if (file) {<br />
    len = file.size();<br />
    size_t flen = len;<br />
    start = millis();<br />
    while (len) {<br />
      size_t toRead = len;<br />
      if (toRead &gt; 512) {<br />
        toRead = 512;<br />
      }<br />
      file.read(buf, toRead);<br />
      len -= toRead;<br />
    }<br />
    end = millis() - start;<br />
    Serial.printf("%u bytes read for %u ms&#92;n", flen, end);<br />
    file.close();<br />
  } else {<br />
    Serial.println("Failed to open file for reading");<br />
  }<br />
<br />
  file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
<br />
  size_t i;<br />
  start = millis();<br />
  for (i = 0; i &lt; 2048; i++) {<br />
    file.write(buf, 512);<br />
  }<br />
  end = millis() - start;<br />
  Serial.printf("%u bytes written for %u ms&#92;n", 2048 * 512, end);<br />
  file.close();<br />
}<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  <br />
  // Initialize SPI and SD card<br />
  SPIClass spi = SPIClass(HSPI);<br />
  spi.begin(SCK, MISO, MOSI, CS);<br />
<br />
  if (!SD.begin(CS, spi, 80000000)) {<br />
    Serial.println("Card Mount Failed");<br />
    return;<br />
  }<br />
<br />
  uint8_t cardType = SD.cardType();<br />
<br />
  if (cardType == CARD_NONE) {<br />
    Serial.println("No SD card attached");<br />
    return;<br />
  }<br />
<br />
  Serial.print("SD Card Type: ");<br />
  if (cardType == CARD_MMC) {<br />
    Serial.println("MMC");<br />
  } else if (cardType == CARD_SD) {<br />
    Serial.println("SDSC");<br />
  } else if (cardType == CARD_SDHC) {<br />
    Serial.println("SDHC");<br />
  } else {<br />
    Serial.println("UNKNOWN");<br />
  }<br />
<br />
  uint64_t cardSize = SD.cardSize() / (1024 * 1024);<br />
  Serial.printf("SD Card Size: %lluMB&#92;n", cardSize);<br />
  delay(2000);<br />
<br />
  // Perform file operations<br />
  deleteFile(SD, "/hello.txt");<br />
  writeFile(SD, "/hello.txt", "Hello ");<br />
  appendFile(SD, "/hello.txt", "World!&#92;n");<br />
  readFile(SD, "/hello.txt");<br />
  testFileIO(SD, "/test.txt");<br />
  Serial.printf("Total space: %lluMB&#92;n", SD.totalBytes() / (1024 * 1024));<br />
  Serial.printf("Used space: %lluMB&#92;n", SD.usedBytes() / (1024 * 1024));<br />
}<br />
<br />
void loop() {<br />
  // No operation in loop<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7462" target="_blank" title="">6-SD.zip</a> (Size: 1.53 KB / Downloads: 446)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7463" target="_blank" title="">6-SD.ino.merged.zip</a> (Size: 221.25 KB / Downloads: 413)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-05 Read free GPIO state]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7963</link>
			<pubDate>Sun, 20 Apr 2025 13:57:11 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7963</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Simple example to read multiple digital inputs using ESP32<br />
 * @details This program demonstrates how to read digital input states<br />
 *          from GPIO18, GPIO8, GPIO4, GPIO5, GPIO6, and GPIO38 of an ESP32 development board.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for digital inputs<br />
#define INPUT1_PIN 18  // GPIO18<br />
#define INPUT2_PIN 8 &nbsp;&nbsp;// GPIO8<br />
#define INPUT3_PIN 4 &nbsp;&nbsp;// GPIO4<br />
#define INPUT4_PIN 5 &nbsp;&nbsp;// GPIO5<br />
#define INPUT5_PIN 6 &nbsp;&nbsp;// GPIO6<br />
#define INPUT6_PIN 38  // GPIO38<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Digital Input Read Example");<br />
<br />
    // Set the input pins as INPUT<br />
    pinMode(INPUT1_PIN, INPUT);<br />
    pinMode(INPUT2_PIN, INPUT);<br />
    pinMode(INPUT3_PIN, INPUT);<br />
    pinMode(INPUT4_PIN, INPUT);<br />
    pinMode(INPUT5_PIN, INPUT);<br />
    pinMode(INPUT6_PIN, INPUT);<br />
}<br />
<br />
void loop() {<br />
    // Read the state of the digital inputs<br />
    int state1 = digitalRead(INPUT1_PIN);<br />
    int state2 = digitalRead(INPUT2_PIN);<br />
    int state3 = digitalRead(INPUT3_PIN);<br />
    int state4 = digitalRead(INPUT4_PIN);<br />
    int state5 = digitalRead(INPUT5_PIN);<br />
    int state6 = digitalRead(INPUT6_PIN);<br />
<br />
    // Print the states to the Serial Monitor<br />
    Serial.print("GPIO18 State: ");<br />
    Serial.println(state1);<br />
    Serial.print("GPIO8 State: ");<br />
    Serial.println(state2);<br />
    Serial.print("GPIO4 State: ");<br />
    Serial.println(state3);<br />
    Serial.print("GPIO5 State: ");<br />
    Serial.println(state4);<br />
    Serial.print("GPIO6 State: ");<br />
    Serial.println(state5);<br />
    Serial.print("GPIO38 State: ");<br />
    Serial.println(state6);<br />
<br />
    // Wait for 500 milliseconds before reading again<br />
    delay(500);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7458" target="_blank" title="">5-free-gpio-state.zip</a> (Size: 773 bytes / Downloads: 430)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7459" target="_blank" title="">5-free-gpio-state.ino.merged.zip</a> (Size: 179.48 KB / Downloads: 449)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Simple example to read multiple digital inputs using ESP32<br />
 * @details This program demonstrates how to read digital input states<br />
 *          from GPIO18, GPIO8, GPIO4, GPIO5, GPIO6, and GPIO38 of an ESP32 development board.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for digital inputs<br />
#define INPUT1_PIN 18  // GPIO18<br />
#define INPUT2_PIN 8 &nbsp;&nbsp;// GPIO8<br />
#define INPUT3_PIN 4 &nbsp;&nbsp;// GPIO4<br />
#define INPUT4_PIN 5 &nbsp;&nbsp;// GPIO5<br />
#define INPUT5_PIN 6 &nbsp;&nbsp;// GPIO6<br />
#define INPUT6_PIN 38  // GPIO38<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Digital Input Read Example");<br />
<br />
    // Set the input pins as INPUT<br />
    pinMode(INPUT1_PIN, INPUT);<br />
    pinMode(INPUT2_PIN, INPUT);<br />
    pinMode(INPUT3_PIN, INPUT);<br />
    pinMode(INPUT4_PIN, INPUT);<br />
    pinMode(INPUT5_PIN, INPUT);<br />
    pinMode(INPUT6_PIN, INPUT);<br />
}<br />
<br />
void loop() {<br />
    // Read the state of the digital inputs<br />
    int state1 = digitalRead(INPUT1_PIN);<br />
    int state2 = digitalRead(INPUT2_PIN);<br />
    int state3 = digitalRead(INPUT3_PIN);<br />
    int state4 = digitalRead(INPUT4_PIN);<br />
    int state5 = digitalRead(INPUT5_PIN);<br />
    int state6 = digitalRead(INPUT6_PIN);<br />
<br />
    // Print the states to the Serial Monitor<br />
    Serial.print("GPIO18 State: ");<br />
    Serial.println(state1);<br />
    Serial.print("GPIO8 State: ");<br />
    Serial.println(state2);<br />
    Serial.print("GPIO4 State: ");<br />
    Serial.println(state3);<br />
    Serial.print("GPIO5 State: ");<br />
    Serial.println(state4);<br />
    Serial.print("GPIO6 State: ");<br />
    Serial.println(state5);<br />
    Serial.print("GPIO38 State: ");<br />
    Serial.println(state6);<br />
<br />
    // Wait for 500 milliseconds before reading again<br />
    delay(500);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7458" target="_blank" title="">5-free-gpio-state.zip</a> (Size: 773 bytes / Downloads: 430)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7459" target="_blank" title="">5-free-gpio-state.ino.merged.zip</a> (Size: 179.48 KB / Downloads: 449)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-04 RS485 communication test]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7962</link>
			<pubDate>Sun, 20 Apr 2025 13:54:17 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7962</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * RS485 Communication Test<br />
 *<br />
 * This program is a simple test for RS485 communication using ESP32-S3.<br />
 * It will send a message over RS485 and then read incoming messages.<br />
 * The TXD pin is defined as GPIO 18 and RXD pin is defined as GPIO 8.<br />
 */<br />
<br />
#include &lt;HardwareSerial.h&gt;<br />
<br />
// Define RS485 pins<br />
#define RS485_RXD 15<br />
#define RS485_TXD 7<br />
<br />
// Create a hardware serial object<br />
HardwareSerial rs485Serial(1);<br />
<br />
void setup() {<br />
  // Start serial communication for debugging<br />
  Serial.begin(115200);<br />
  while (!Serial);<br />
<br />
  // Initialize RS485 Serial communication<br />
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);<br />
  <br />
  Serial.println("RS485 Test Start");<br />
}<br />
<br />
void loop() {<br />
  // Send a test message<br />
  rs485Serial.println("Hello from KinCony A2v3!");<br />
<br />
  // Wait for a short period<br />
  delay(1000);<br />
<br />
  // Check if data is available to read<br />
  if (rs485Serial.available()) {<br />
    String receivedMessage = "";<br />
    while (rs485Serial.available()) {<br />
      char c = rs485Serial.read();<br />
      receivedMessage += c;<br />
    }<br />
    // Print the received message<br />
    Serial.print("Received: ");<br />
    Serial.println(receivedMessage);<br />
  }<br />
<br />
  // Wait before sending the next message<br />
  delay(2000);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7456" target="_blank" title="">4-RS485-Test.zip</a> (Size: 763 bytes / Downloads: 471)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7457" target="_blank" title="">4-RS485-Test.ino.merged.zip</a> (Size: 184.35 KB / Downloads: 450)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * RS485 Communication Test<br />
 *<br />
 * This program is a simple test for RS485 communication using ESP32-S3.<br />
 * It will send a message over RS485 and then read incoming messages.<br />
 * The TXD pin is defined as GPIO 18 and RXD pin is defined as GPIO 8.<br />
 */<br />
<br />
#include &lt;HardwareSerial.h&gt;<br />
<br />
// Define RS485 pins<br />
#define RS485_RXD 15<br />
#define RS485_TXD 7<br />
<br />
// Create a hardware serial object<br />
HardwareSerial rs485Serial(1);<br />
<br />
void setup() {<br />
  // Start serial communication for debugging<br />
  Serial.begin(115200);<br />
  while (!Serial);<br />
<br />
  // Initialize RS485 Serial communication<br />
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);<br />
  <br />
  Serial.println("RS485 Test Start");<br />
}<br />
<br />
void loop() {<br />
  // Send a test message<br />
  rs485Serial.println("Hello from KinCony A2v3!");<br />
<br />
  // Wait for a short period<br />
  delay(1000);<br />
<br />
  // Check if data is available to read<br />
  if (rs485Serial.available()) {<br />
    String receivedMessage = "";<br />
    while (rs485Serial.available()) {<br />
      char c = rs485Serial.read();<br />
      receivedMessage += c;<br />
    }<br />
    // Print the received message<br />
    Serial.print("Received: ");<br />
    Serial.println(receivedMessage);<br />
  }<br />
<br />
  // Wait before sending the next message<br />
  delay(2000);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7456" target="_blank" title="">4-RS485-Test.zip</a> (Size: 763 bytes / Downloads: 471)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7457" target="_blank" title="">4-RS485-Test.ino.merged.zip</a> (Size: 184.35 KB / Downloads: 450)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-02 Read digital input ports state]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7961</link>
			<pubDate>Sun, 20 Apr 2025 13:50:59 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7961</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Simple example to read two digital inputs using ESP32<br />
 * @details This program demonstrates how to read two digital input states<br />
 *          from GPIO16 and GPIO17 of an ESP32 development board.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for digital inputs<br />
#define INPUT1_PIN 16  // GPIO16 for Digital Input 1<br />
#define INPUT2_PIN 17  // GPIO17 for Digital Input 2<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Digital Input Read Example");<br />
<br />
    // Set the input pins as INPUT<br />
    pinMode(INPUT1_PIN, INPUT);<br />
    pinMode(INPUT2_PIN, INPUT);<br />
}<br />
<br />
void loop() {<br />
    // Read the state of the digital inputs<br />
    int state1 = digitalRead(INPUT1_PIN);<br />
    int state2 = digitalRead(INPUT2_PIN);<br />
<br />
    // Print the states to the Serial Monitor<br />
    Serial.print("Digital Input 1 State: ");<br />
    Serial.println(state1);<br />
    Serial.print("Digital Input 2 State: ");<br />
    Serial.println(state2);<br />
<br />
    // Wait for 500 milliseconds before reading again<br />
    delay(500);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7454" target="_blank" title="">2-digital-input.zip</a> (Size: 667 bytes / Downloads: 422)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7455" target="_blank" title="">2-digital-input.ino.merged.zip</a> (Size: 179.35 KB / Downloads: 414)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Simple example to read two digital inputs using ESP32<br />
 * @details This program demonstrates how to read two digital input states<br />
 *          from GPIO16 and GPIO17 of an ESP32 development board.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for digital inputs<br />
#define INPUT1_PIN 16  // GPIO16 for Digital Input 1<br />
#define INPUT2_PIN 17  // GPIO17 for Digital Input 2<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Digital Input Read Example");<br />
<br />
    // Set the input pins as INPUT<br />
    pinMode(INPUT1_PIN, INPUT);<br />
    pinMode(INPUT2_PIN, INPUT);<br />
}<br />
<br />
void loop() {<br />
    // Read the state of the digital inputs<br />
    int state1 = digitalRead(INPUT1_PIN);<br />
    int state2 = digitalRead(INPUT2_PIN);<br />
<br />
    // Print the states to the Serial Monitor<br />
    Serial.print("Digital Input 1 State: ");<br />
    Serial.println(state1);<br />
    Serial.print("Digital Input 2 State: ");<br />
    Serial.println(state2);<br />
<br />
    // Wait for 500 milliseconds before reading again<br />
    delay(500);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7454" target="_blank" title="">2-digital-input.zip</a> (Size: 667 bytes / Downloads: 422)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7455" target="_blank" title="">2-digital-input.ino.merged.zip</a> (Size: 179.35 KB / Downloads: 414)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A2v3]-01 Turn ON/OFF OUTPUT]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7960</link>
			<pubDate>Sun, 20 Apr 2025 13:48:14 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7960</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Simple example to control two relays using ESP32<br />
 * @details This program demonstrates how to control two relays connected to GPIO40 and GPIO39<br />
 *          of an ESP32 development board.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for the relays<br />
#define RELAY1_PIN 40  // GPIO40 for Relay 1<br />
#define RELAY2_PIN 39  // GPIO39 for Relay 2<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Relay Control Example");<br />
<br />
    // Set the relay pins as output<br />
    pinMode(RELAY1_PIN, OUTPUT);<br />
    pinMode(RELAY2_PIN, OUTPUT);<br />
<br />
    // Turn off both relays at startup (assuming active LOW relays)<br />
    digitalWrite(RELAY1_PIN, HIGH);<br />
    digitalWrite(RELAY2_PIN, HIGH);<br />
}<br />
<br />
void loop() {<br />
    Serial.println("Turning ON Relay 1");<br />
    digitalWrite(RELAY1_PIN, LOW); // Activate relay 1<br />
    delay(1000); // Wait for 1 second<br />
    <br />
    Serial.println("Turning OFF Relay 1");<br />
    digitalWrite(RELAY1_PIN, HIGH); // Deactivate relay 1<br />
    delay(1000);<br />
    <br />
    Serial.println("Turning ON Relay 2");<br />
    digitalWrite(RELAY2_PIN, LOW); // Activate relay 2<br />
    delay(1000);<br />
    <br />
    Serial.println("Turning OFF Relay 2");<br />
    digitalWrite(RELAY2_PIN, HIGH); // Deactivate relay 2<br />
    delay(1000);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7452" target="_blank" title="">1-output.zip</a> (Size: 683 bytes / Downloads: 427)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7453" target="_blank" title="">1-output.ino.merged.zip</a> (Size: 179.19 KB / Downloads: 461)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/**<br />
 * @brief Simple example to control two relays using ESP32<br />
 * @details This program demonstrates how to control two relays connected to GPIO40 and GPIO39<br />
 *          of an ESP32 development board.<br />
 *<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 */<br />
<br />
// Define the GPIO pins for the relays<br />
#define RELAY1_PIN 40  // GPIO40 for Relay 1<br />
#define RELAY2_PIN 39  // GPIO39 for Relay 2<br />
<br />
void setup() {<br />
    // Initialize the serial communication for debugging<br />
    Serial.begin(115200);<br />
    Serial.println("ESP32 Relay Control Example");<br />
<br />
    // Set the relay pins as output<br />
    pinMode(RELAY1_PIN, OUTPUT);<br />
    pinMode(RELAY2_PIN, OUTPUT);<br />
<br />
    // Turn off both relays at startup (assuming active LOW relays)<br />
    digitalWrite(RELAY1_PIN, HIGH);<br />
    digitalWrite(RELAY2_PIN, HIGH);<br />
}<br />
<br />
void loop() {<br />
    Serial.println("Turning ON Relay 1");<br />
    digitalWrite(RELAY1_PIN, LOW); // Activate relay 1<br />
    delay(1000); // Wait for 1 second<br />
    <br />
    Serial.println("Turning OFF Relay 1");<br />
    digitalWrite(RELAY1_PIN, HIGH); // Deactivate relay 1<br />
    delay(1000);<br />
    <br />
    Serial.println("Turning ON Relay 2");<br />
    digitalWrite(RELAY2_PIN, LOW); // Activate relay 2<br />
    delay(1000);<br />
    <br />
    Serial.println("Turning OFF Relay 2");<br />
    digitalWrite(RELAY2_PIN, HIGH); // Deactivate relay 2<br />
    delay(1000);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7452" target="_blank" title="">1-output.zip</a> (Size: 683 bytes / Downloads: 427)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7453" target="_blank" title="">1-output.ino.merged.zip</a> (Size: 179.19 KB / Downloads: 461)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-A2v3 ESPHome yaml for home assistant]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7959</link>
			<pubDate>Sun, 20 Apr 2025 13:46:01 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7959</guid>
			<description><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7451" target="_blank" title="">A2v3-HA.png</a> (Size: 95.9 KB / Downloads: 761)
<!-- end: postbit_attachments_attachment --><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: a2v3<br />
  friendly_name: a2v3<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
   - id: bus_a<br />
     sda: 48<br />
     scl: 47<br />
     scan: true<br />
     frequency: 400kHz<br />
<br />
uart:<br />
  - id: uart_1<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 7<br />
    rx_pin: 15<br />
<br />
  - id: uart_sim7600<br />
    baud_rate: 115200<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
      sequence:<br />
        - lambda: UARTDebug::log_string(direction, bytes);<br />
    tx_pin: 10<br />
    rx_pin: 9<br />
<br />
switch:<br />
<br />
  - platform: gpio<br />
    pin: 40<br />
    name: "A2v3-Relay1"<br />
<br />
  - platform: gpio<br />
    pin: 39<br />
    name: "A2v3-Relay2"<br />
<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: uart<br />
    uart_id: uart_sim7600<br />
    name: "UART 4G"<br />
    data: "AT+CGSN&#92;r&#92;n" # read 4G SIM7600 ID<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "A2v3-input1"<br />
    pin: <br />
      number: 16<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A2v3-input2"<br />
    pin:<br />
      number: 17<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO18"<br />
    pin:<br />
      number: 18<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO8"<br />
    pin:<br />
      number: 8<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO4"<br />
    pin:<br />
      number: 4<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO5"<br />
    pin:<br />
      number: 5<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO6"<br />
    pin:<br />
      number: 6<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO38"<br />
    pin:<br />
      number: 38<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "A2v3");</code></div></div> esphome yaml file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7450" target="_blank" title="">A2v3-HA.txt</a> (Size: 2.39 KB / Downloads: 383)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7451" target="_blank" title="">A2v3-HA.png</a> (Size: 95.9 KB / Downloads: 761)
<!-- end: postbit_attachments_attachment --><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: a2v3<br />
  friendly_name: a2v3<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
i2c:<br />
   - id: bus_a<br />
     sda: 48<br />
     scl: 47<br />
     scan: true<br />
     frequency: 400kHz<br />
<br />
uart:<br />
  - id: uart_1<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 7<br />
    rx_pin: 15<br />
<br />
  - id: uart_sim7600<br />
    baud_rate: 115200<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
      sequence:<br />
        - lambda: UARTDebug::log_string(direction, bytes);<br />
    tx_pin: 10<br />
    rx_pin: 9<br />
<br />
switch:<br />
<br />
  - platform: gpio<br />
    pin: 40<br />
    name: "A2v3-Relay1"<br />
<br />
  - platform: gpio<br />
    pin: 39<br />
    name: "A2v3-Relay2"<br />
<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: uart<br />
    uart_id: uart_sim7600<br />
    name: "UART 4G"<br />
    data: "AT+CGSN&#92;r&#92;n" # read 4G SIM7600 ID<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "A2v3-input1"<br />
    pin: <br />
      number: 16<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A2v3-input2"<br />
    pin:<br />
      number: 17<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO18"<br />
    pin:<br />
      number: 18<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO8"<br />
    pin:<br />
      number: 8<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO4"<br />
    pin:<br />
      number: 4<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO5"<br />
    pin:<br />
      number: 5<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO6"<br />
    pin:<br />
      number: 6<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "IO38"<br />
    pin:<br />
      number: 38<br />
      mode:<br />
        input: true<br />
        pullup: true<br />
      inverted: true<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "A2v3");</code></div></div> esphome yaml file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=7450" target="_blank" title="">A2v3-HA.txt</a> (Size: 2.39 KB / Downloads: 383)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-A2v3 ESP32-S3 IO pins define]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7958</link>
			<pubDate>Sun, 20 Apr 2025 13:44:35 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=7958</guid>
			<description><![CDATA[IIC Bus:<br />
<br />
SDA:GPIO48<br />
SCL:GPIO47<br />
<br />
24C02 EPROM i2c address: 0x50<br />
DS3231 RTC i2c address: 0x68<br />
SSD1306 display: i2c address:0x3c<br />
-----------------<br />
<br />
1-wire (pull-up resistance on PCB): <br />
1-wire(TMP1):GPIO18<br />
1-wire(TMP2):GPIO8<br />
<br />
<br />
free GPIOs (without pull-up resistance on PCB): <br />
free gpio-1:GPIO4<br />
free gpio-2:GPIO5<br />
free gpio-3:GPIO6<br />
free gpio-4:GPIO38<br />
-----------------<br />
<br />
Ethernet (W5500) I/O define:<br />
<br />
clk_pin: GPIO42<br />
mosi_pin: GPIO43<br />
miso_pin: GPIO44<br />
cs_pin: GPIO41<br />
<br />
interrupt_pin: GPIO2<br />
reset_pin: GPIO1<br />
<br />
--------------------<br />
RS485: <br />
RXD:GPIO15<br />
TXD:GPIO7<br />
<br />
4G module:<br />
RXD:GPIO9<br />
TXD:GPIO10<br />
<br />
--------------------<br />
SD Card:<br />
SPI-MOSI:GPIO12<br />
SPI-SCK:GPIO13<br />
SPI-MISO:GPIO14<br />
SPI-CS:GPIO11<br />
SPI-CD:GPIO21<br />
<br />
--------------------<br />
Relay1:GPIO40<br />
Relay2:GPIO39<br />
<br />
--------------------<br />
digital input-1:GPIO16<br />
digital input-2:GPIO17]]></description>
			<content:encoded><![CDATA[IIC Bus:<br />
<br />
SDA:GPIO48<br />
SCL:GPIO47<br />
<br />
24C02 EPROM i2c address: 0x50<br />
DS3231 RTC i2c address: 0x68<br />
SSD1306 display: i2c address:0x3c<br />
-----------------<br />
<br />
1-wire (pull-up resistance on PCB): <br />
1-wire(TMP1):GPIO18<br />
1-wire(TMP2):GPIO8<br />
<br />
<br />
free GPIOs (without pull-up resistance on PCB): <br />
free gpio-1:GPIO4<br />
free gpio-2:GPIO5<br />
free gpio-3:GPIO6<br />
free gpio-4:GPIO38<br />
-----------------<br />
<br />
Ethernet (W5500) I/O define:<br />
<br />
clk_pin: GPIO42<br />
mosi_pin: GPIO43<br />
miso_pin: GPIO44<br />
cs_pin: GPIO41<br />
<br />
interrupt_pin: GPIO2<br />
reset_pin: GPIO1<br />
<br />
--------------------<br />
RS485: <br />
RXD:GPIO15<br />
TXD:GPIO7<br />
<br />
4G module:<br />
RXD:GPIO9<br />
TXD:GPIO10<br />
<br />
--------------------<br />
SD Card:<br />
SPI-MOSI:GPIO12<br />
SPI-SCK:GPIO13<br />
SPI-MISO:GPIO14<br />
SPI-CS:GPIO11<br />
SPI-CD:GPIO21<br />
<br />
--------------------<br />
Relay1:GPIO40<br />
Relay2:GPIO39<br />
<br />
--------------------<br />
digital input-1:GPIO16<br />
digital input-2:GPIO17]]></content:encoded>
		</item>
	</channel>
</rss>