Smart Home Automation Forum
[Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-AI (https://www.kincony.com/forum/forumdisplay.php?fid=29)
+--- Thread: [Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code (/showthread.php?tid=2023)



[Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code - KinCony Support - 07-06-2022

[Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code

Code:
void setup() {
  // put your setup code here, to run once:
Serial2.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
Serial2.println("KinCony");
delay(500);
}



RE: [Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code - RoVen - 02-23-2023

(07-06-2022, 01:07 AM)KinCony Support Wrote: [Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code

Code:
void setup() {
  // put your setup code here, to run once:
Serial2.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
Serial2.println("KinCony");
delay(500);
}

the module does not work for sending via rs485 protocol. how is zero applied to the RE and DE pins MAX13487? there must be either a connection to the DI pin or control of a separate esp32 pin.


RE: [Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code - admin - 02-23-2023

DE/RE not need to use, MAX13487 will auto control the signal direction. for ESP32 just use RXD,TXD pins is ok.
DE/RE pin just connect together with 10k resistance to Vcc is ok.
do you have define the Serial2 pin in your arduino config fle firstly?


RE: [Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code - admin - 02-23-2023

[Image: attachment.php?aid=1924]
RS485:
RXD:GPIO16
TXD:GPIO14

just replace these pin number in your config file. Because I uploaded the image is KC868-A6's RS485 pin of ESP32.


RE: [Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code - RoVen - 02-23-2023

(02-23-2023, 12:02 PM)admin Wrote: RS485:
RXD:GPIO16
TXD:GPIO14

just replace these pin number in your config file. Because I uploaded the image is KC868-A6's RS485 pin of ESP32.

Thank you. it works


RE: [Arduino IDE demo source code for KC868-AI]--#06-KC868-AI_RS485_code - admin - 02-24-2023

ok, good.